### Question:
ArrayTree { public K getLast() { if ( size != 0 ) { return array[size - 1]; } else { return null; } } ArrayTree( Comparator<K> comparator );  ArrayTree( Comparator<K> comparator, K[] array ); Comparator<K> getComparator(); K insert( K key ); K remove( K key ); boolean isEmpty(); int size(); List<K> getKeys(); void printTree(); K get( int position ); K getFirst(); K getLast(); K findGreater( K key ); K findGreaterOrEqual( K key ); K findLess( K key ); K findLessOrEqual( K key ); K find( K key ); int getPosition( K key ); int getAfterPosition( K key ); int getBeforePosition( K key ); boolean contains( K key ); String toString();  }### Answer:
@Test public void testGetLastEmptyTree() { ArrayTree<Integer> tree = createTree(); assertNull( tree.getLast() ); }
@Test public void testGetLast() { ArrayTree<Integer> tree = createTree(); tree.insert( FIVE ); assertEquals( FIVE, tree.getLast() ); tree.insert( TEN ); assertEquals( TEN, tree.getLast() ); tree.insert( EIGHT ); assertEquals( TEN, tree.getLast() ); tree.insert( ELEVEN ); assertEquals( ELEVEN, tree.getLast() ); tree.remove( ELEVEN ); assertEquals( TEN, tree.getLast() ); }