Added possible fix for compiler errors with some unit tests and Java 7