### Question:
ContainsDuplicate { public boolean containsDuplicate2(int[] nums) { Set<Integer> set = new HashSet<>(nums.length); for (int num : nums) { if (set.contains(num)) { return true; } else { set.add(num); } } return false; }  boolean containsDuplicate(int[] nums); boolean containsDuplicate2(int[] nums); boolean containsDuplicate3(int[] nums);  }### Answer:
@Test void go2() { ContainsDuplicate containsDuplicate = new ContainsDuplicate(); for (int i = 0; i < cases.size(); i++) { assertEquals(results.get(i),containsDuplicate.containsDuplicate2(cases.get(i))); } }