Duplicate { public void doUniqueArray(){ int count = deleteCopy(); String []tmp = new String[count]; System.arraycopy(strFull,0,tmp,0,count); strFull = tmp; } Duplicate(String [] unsort); void doUniqueArray(); void printArray(); static void main(String []args); public String [] strFull; }
@Test public void whenGiveMassiveShouldSortingIt(){ String []massive = {"as","sa","as","as","as"}; Duplicate bs = new Duplicate(massive); bs.doUniqueArray(); String []control = {"as","sa"}; Assert.assertThat(bs.strFull,is(control)); }