### Question:
Rotate { public void rotate3(int[] nums, int k) { if (nums.length != 0 && k != 0) { k = k % nums.length; if (k != 0) { int[] tmp = new int[k]; for (int i = nums.length - 1; i >= 0; i--) { if (i - k >= 0) { if (nums.length - i <= k) { tmp[k - nums.length + i] = nums[i]; } nums[i] = nums[i - k]; } else { nums[i] = tmp[i]; } } } } }  void rotate(int[] nums, int k); void rotate(int[] nums); void rotate2(int[] nums, int k); void rotate3(int[] nums, int k); void rotate4(int[] nums, int k); void rotate5(int[] nums, int k); void reverse(int[] nums, int start, int end);  }### Answer:
@Test void go3(){ Rotate rotate = new Rotate(); for (int i = 0; i < cases.size(); i++) { rotate.rotate3(cases.get(i),caseNums.get(i)); assertArrayEquals(results.get(i), cases.get(i)); } }