code: protected void replaceEntry(T oldEntry, T newEntry) {
          T prev = oldEntry.getPrev();
          T next = newEntry.getNext();
          if (prev != null) {
              prev.setNext(newEntry);
          } else {
              head = newEntry;
          }
          if (next != null) {
              next.setPrev(newEntry);
          } else {
              last = newEntry;
          }
      }
docs: Replaces an entry in the list.
  
  @param oldEntry
  the entry to be replaced.
  @param newEntry
  the replacement entry.