Make code Java 7 compatible