Fixed Java 8 build

Don't assume that there is only 1 method on a class when Java 8 adds
many synthetic methods to it when you have lambdas.