private void add(final LinkedList<? super String> recentEntries, final String newEntry) {
    final int oldIndex = recentEntries.indexOf(newEntry);
    if (oldIndex >= 0) {
      recentEntries.remove(oldIndex);
    }
    else if (recentEntries.size() == myRecentsNumberToKeep) {
      recentEntries.removeLast();
    }

    recentEntries.addFirst(newEntry);
  }
private void add(final LinkedList<? super String> recentEntries, final String newEntry)