### Question:
SingleNumber { public int singleNumber2(int[] nums) { int ans = nums[0]; if (nums.length > 1) { for (int i = 1; i < nums.length; i++) { ans = ans ^ nums[i]; } } return ans; }  int singleNumber(int[] nums); int singleNumber2(int[] nums); int singleNumber3(int[] nums);  }### Answer:
@Test void go2() { SingleNumber singleNumber = new SingleNumber(); for (int i = 0; i < cases.size(); i++) { assertEquals((int)results.get(i), singleNumber.singleNumber2(cases.get(i))); } }