// one line HashSet initialise private static final HashSet<String> exceptions = new HashSet<String>(Arrays.asList( "platypus", "kangaroo", "wallaby" )); // prior to JDK 1.5 you would write that as: private static final HashSet exceptions = new HashSet(Arrays.asList( new String[] {"platypus", "kangaroo", "wallaby"} ));