Fixed unittest for Java 8 compatibility