Remove Java 7 specific code in Maeyanie's PR