UniqueHashIndex extends CacheIndexBase { public List<Object> equalsTo(Object expectedValue) { List<Object> keys = new ArrayList<Object>(1); Object indexedKey = map.get(expectedValue); keys.add(indexedKey); return keys; }  void put(Object indexedKey, Object key); void remove(Object indexedKey, Object key); List<Object> equalsTo(Object expectedValue);  }
@Test public void equalsTo() { Object object = new Object(); doReturn(object).when(map).get(object); List<Object> actualObjects = index.equalsTo(object); assertEquals(object, actualObjects.get(0)); }