Correctly handle NullaryMethodTypes in the java type mapper

Fixed #1001734. No test since I cannot reproduce this reliably.
Merge pull request #879 from dragos/issue/assertion-error-fields

Correctly handle NullaryMethodTypes in the java type mapper