private synchronized void trimHead() {
    if(offsets.size()<=1) {
      return;
    }
    FileOffset head = offsets.first();
    FileOffset head2 = offsets.higher(head);
    if( head.isNextOffset(head2) ) {
      offsets.pollFirst();
      trimHead();
    }
    return;
  }
private synchronized void trimHead ( ) { if ( offsets . size ( ) <= 1 ) { return ; } FileOffset head = offsets . first ( ) ; FileOffset head2 = offsets . higher ( head ) ; if ( head . isNextOffset ( head2 ) ) { offsets . pollFirst ( ) ; trimHead ( ) ; } return ; }
e.g.:  1,2,3,4,10,11,12,15  =>  4,10,11,12,15