### Question:
RemoveDuplicatesFromArray { public static int[] removeDuplicates(int[] sequence) { if (sequence == null || sequence.length == 0) { return sequence; } Map<Integer, Integer> unique = new HashMap<>(); int cnt = 0; for (int element : sequence) { Integer pos = unique.get(element); if (pos == null) { unique.put(element, cnt); cnt++; } } if (sequence.length == cnt) { return sequence; } int[] result = new int[cnt]; for (Entry<Integer, Integer> entry : unique.entrySet()) { result[entry.getValue()] = entry.getKey(); } return result; }  static int[] removeDuplicates(int[] sequence);  }### Answer:
@Test public void testRemoveDuplicates() { assertThat(removeDuplicates(actual), is(expected)); }