Remove method requiring Java 8.