Add fix for Java 7

Add compatibility with Java 7 where the first element in Iterator parameter provider is dropped due to different handling of casting in Java 7 and Java 8.