public Pair < Long , Long > getFirstGap ( ) { if ( m_map . isEmpty ( ) || size ( ) < 2 ) { return null ; } Iterator < Range < Long > > iter = m_map . asRanges ( ) . iterator ( ) ; long start = end ( iter . next ( ) ) + 1 ; long end = start ( iter . next ( ) ) - 1 ; return new Pair < Long , Long > ( start , end ) ; }
Find range of the first gap if it exists . If there is only one entry range after the first entry is NOT a gap .