class PositionCache {

    synchronized LogPosition lookup( long offsetIndex )
    {
        if ( offsetIndex == 0 )
        {
            return BEGINNING_OF_RECORDS;
        }

        LogPosition best = BEGINNING_OF_RECORDS;

        for ( int i = 0; i < CACHE_SIZE; i++ )
        {
            if ( cache[i].logIndex <= offsetIndex && cache[i].logIndex > best.logIndex )
            {
                best = cache[i];
            }
        }

        return best;
    }

      PositionCache();

}