JavaSorter extends UnicastRemoteObject implements Sorter { @Override public Comparable[] sort(Comparable[] list) throws RemoteException { Arrays.sort(list); return list; } protected  JavaSorter(); @Override Comparable[] sort(Comparable[] list);  }
@Test public void sortingAnEmptyArrayWillResultInAnEmptyArray() throws Exception { assertArrayEquals(new Comparable[]{}, javaSorter.sort(new Comparable[]{})); }
@Test public void sortingAnArrayWithASingleElementWillResultInTheSameArrayWithASingleElement() throws Exception { assertArrayEquals(new Comparable[]{1}, javaSorter.sort(new Comparable[]{1})); }
@Test(expected = NullPointerException.class) public void sortingAnNullReferenceArrayWillResultInANullPointerException() throws Exception { javaSorter.sort(null); }