Replace Java 1.7 only code