class HistoryMap extends HashMap<Integer, T> {

  public void add(T obj) {
    // do not add if object already exists
    if (suppressDuplicates && containsValue(obj))
      return;
    counter++;
    put(new Integer(counter), obj);
    if (size() >= maxEntries)
      try {
        remove(new Integer(counter - maxEntries));
      } catch (Exception e) {
        log.error("Remove of entry from historymap without success." +
                  e.getMessage());
      }
  }

  public  HistoryMap();
  public  HistoryMap(int maxEntries, boolean suppressDuplicates);

}