tests: test for Java classes with polymorphic methods