It was a fashion.
Johann (and its short forms like
Hans or
Jan) was a long time favourite name in Germany.
For comparison, look at the family tree of the
German composer
Johann Sebastian Bach; you will find the same pattern:
https://en.wikipedia.org/wiki/Bach_family