### Question:
ArrayTree { public K findGreaterOrEqual( K key ) { if ( key == null ) { return null; } switch ( size ) { case 0: return null; case 1: if ( comparator.compare( array[0], key ) >= 0 ) { return array[0]; } else { return null; } case 2: if ( comparator.compare( array[0], key ) >= 0 ) { return array[0]; } else if ( comparator.compare( array[1], key ) >= 0 ) { return array[1]; } else { return null; } 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 ) { return array[current]; } 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: int res = comparator.compare( array[start], key ); if ( res >= 0 ) { return array[start]; } else { if ( start == size - 1 ) { return null; } else { return array[start + 1]; } } case 2: res = comparator.compare( array[start], key ); if ( res < 0 ) { res = comparator.compare( array[start + 1], key ); if ( res < 0 ) { if ( start == size - 2 ) { return null; } return array[start + 2]; } return array[start + 1]; } return array[start]; default: 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 testFindGreaterOrEqualEmptyTree() { ArrayTree<Integer> tree = createTree(); assertNull( tree.findGreaterOrEqual( ONE ) ); }
@Test public void testFindGreaterOrEqualNullFromEmptyTree() { ArrayTree<Integer> tree = createTree(); assertNull( tree.findGreaterOrEqual( null ) ); }
@Test public void testFindGreaterOrEqual() { ArrayTree<Integer> tree = createTree(); tree.insert( ZERO ); tree.insert( TWO ); tree.insert( FOUR ); tree.insert( SIX ); tree.insert( EIGHT ); tree.insert( TEN ); assertEquals( ZERO, tree.findGreater( MINUS_ONE ) ); assertNotSame( ONE, tree.findGreaterOrEqual( ONE ) ); assertEquals( TWO, tree.findGreaterOrEqual( ONE ) ); assertEquals( TWO, tree.findGreaterOrEqual( TWO ) ); assertEquals( SIX, tree.findGreaterOrEqual( FIVE ) ); tree.remove( SIX ); assertEquals( EIGHT, tree.findGreaterOrEqual( FIVE ) ); assertEquals( TEN, tree.findGreaterOrEqual( TEN ) ); assertNull( tree.findGreaterOrEqual( ELEVEN ) ); }