1Set<String> animals = new HashSet<String>(
2 Arrays.asList("cat", "dog", "squirrel", "raccoon"));
3if (animals.contains("dog")) {
4 System.out.println("Yep, dog's here!"); // prints
5}
6if (!animals.contains("aardvark")) {
7 System.out.println("Ah, aardvark's missing!"); // prints
8}