Fix for Java < 1.8

Uses raw class instead of Java Type API (which has a
default method in 1.8, unavailble in 1.7).