code: void removeAndShift(int firstPara, int lastPara, int shift) {
      for(int i = 0; i < entries.size(); i++) {
        if(entries.get(i).numberOfParagraph >= firstPara && entries.get(i).numberOfParagraph <= lastPara) {
          entries.remove(i);
          i--;
        } 
      }
      for (CacheEntry anEntry : entries) {
        if (anEntry.numberOfParagraph > lastPara) {
          anEntry.numberOfParagraph += shift;
        }
      }
    }
docs: Remove all cache entries between firstPara (included) and lastPara (included)
  shift all numberOfParagraph by 'shift'