use Java 7 features

Diamond operator and automatic resource management.