InterestTable { public void setCapacity(int capacity) { synchronized (_contents) { _capacity = capacity; _contentNamesLRU = new LinkedList<ContentName>(); } }  void setCapacity(int capacity); Integer getCapacity(); void add(Interest interest, V value); void add(ContentName name, V value); Entry<V> remove(ContentName name, V value); Entry<V> remove(Interest interest, V value); V getValue(ContentObject target); Entry<V> getMatch(ContentObject target); List<V> getValues(ContentObject target); List<Entry<V>> getMatches(ContentObject target); V getValue(ContentName target); Entry<V> getMatch(ContentName target); List<V> getValues(ContentName target); List<Entry<V>> getMatches(ContentName target); Collection<Entry<V>> values(); V removeValue(ContentObject target); Entry<V> removeMatch(ContentObject target); List<V> removeValues(ContentObject target); List<Entry<V>> removeMatches(ContentObject target); int size(); int sizeNames(); void clear();  }
@Test public void testLRU() throws MalformedContentNameStringException, InvalidKeyException, SignatureException, ConfigurationException { Log.info(Log.FAC_TEST, "Starting testLRU"); InterestTable<Integer> table = new InterestTable<Integer>(); table.setCapacity(6); addEntry(table, a, new Integer(1)); addEntry(table, ab, new Integer(2)); addEntry(table, c, new Integer(3)); addEntry(table, b, new Integer(4)); addEntry(table, a_bb, new Integer(5)); addEntry(table, _aa, new Integer(6)); addEntry(table, ab, new Integer(45)); addEntry(table, abc, new Integer(7)); addEntry(table, zero, new Integer(8)); addEntry(table, onethree, new Integer(9)); addEntry(table, one, new Integer(10)); match(table, abc, 7); matches(table, ab, new String[] {ab, ab}, new int[] {2, 45}); noMatch(table, a); Log.info(Log.FAC_TEST, "Completed testLRU"); }