### Question:
ArrayDuplicate { public String[] remove(String[] array) { int repeatedWords = 0; for (int wordIndex = 0; wordIndex < array.length - 1; wordIndex++) { for (int comparedWordIndex = 0; comparedWordIndex < array.length - 1 - repeatedWords; comparedWordIndex++) { if (comparedWordIndex == wordIndex) { comparedWordIndex++; } else if (array[wordIndex].equals(array[comparedWordIndex])) { String tmp = array[comparedWordIndex]; array[comparedWordIndex] = array[array.length - repeatedWords - 1]; array[array.length - repeatedWords - 1] = tmp; repeatedWords++; } } } return Arrays.copyOf(array, array.length - repeatedWords); }  String[] remove(String[] array);  }### Answer:
@Test public void whenRemoveDuplicatesThenArrayWithoutDuplicate() { String[] array = {"Привет", "Мир", "Привет", "Супер", "Мир"}; String[] except = {"Привет", "Супер", "Мир"}; ArrayDuplicate duplicate = new ArrayDuplicate(); String[] result = duplicate.remove(array); assertThat(result, is(except)); }