Make tests pass with Java 8