### Question:
ArrayTree { public K get( int position ) { if ( ( position < 0 ) || ( position >= size ) ) { throw new ArrayIndexOutOfBoundsException(); } return array[position]; } 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 testGetEmptyTree() { ArrayTree<Integer> tree = createTree(); try { assertNull( tree.get( 0 ) ); fail(); } catch ( ArrayIndexOutOfBoundsException aioobe ) { assertTrue( true ); } }
@Test public void testGetEmptyTreeAIOOBException() { ArrayTree<Integer> tree = createTree(); try { tree.get( -1 ); fail(); } catch ( ArrayIndexOutOfBoundsException aioobe ) { assertTrue( true ); } try { tree.get( 1 ); fail(); } catch ( ArrayIndexOutOfBoundsException aioobe ) { assertTrue( true ); } }