code: protected void insertBeforeEntry(T e, T insertPos) {
          T oldPrev = insertPos.getPrev();
          e.setNext(insertPos);
          e.setPrev(oldPrev);
          insertPos.setPrev(e);
          if (oldPrev != null) {
              oldPrev.setNext(e);
          } else {
              head = e;
          }
          size++;
      }
docs: Inserts a new entry <i>before</i> a given one.
  
  @param e
  the entry to add.
  @param insertPos
  the entry before which to add the new one.