class Terms {

    synchronized long get( long logIndex )
    {
        if ( logIndex == -1 || logIndex < min || logIndex > max )
        {
            return -1;
        }

        for ( int i = size - 1; i >= 0; i-- )
        {
            if ( logIndex >= indexes[i] )
            {
                return terms[i];
            }
        }

        throw new RuntimeException( "Should be possible to find index >= min" );
    }

      Terms( long prevIndex, long prevTerm );

}