Fix compile error for Java 8