### Question:
ArrayTree { public int getAfterPosition( K key ) { if ( key == null ) { return -1; } switch ( size ) { case 0: return -1; case 1: if ( comparator.compare( array[0], key ) > 0 ) { return 0; } else { return -1; } case 2: if ( comparator.compare( array[0], key ) > 0 ) { return 0; } if ( comparator.compare( array[1], key ) > 0 ) { return 1; } else { return -1; } default: int current = size >> 1; int start = 0; int end = size - 1; while ( end - start + 1 > 2 ) { int res = comparator.compare( array[current], key ); if ( res == 0 ) { if ( current != size - 1 ) { return current + 1; } else { return -1; } } else if ( res < 0 ) { start = current; current = ( current + end + 1 ) >> 1; } else { end = current; current = ( current + start + 1 ) >> 1; } } switch ( end - start + 1 ) { case 1: if ( comparator.compare( array[start], key ) > 0 ) { return start; } else { return -1; } case 2: if ( comparator.compare( array[start], key ) > 0 ) { return start; } if ( comparator.compare( array[end], key ) > 0 ) { return end; } else { return -1; } default: return -1; } } } 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 testGetAfterPositionEmptyTree() { ArrayTree<Integer> tree = createTree(); assertEquals( -1, tree.getAfterPosition( ZERO ) ); }