DefaultCache implements Cache<KeyType, ValueType> { @Override public int getMaxSize() { return cacheMap.getMaximumSize(); } DefaultCache(final String name, final int maximumSize); @Override void clear(); @Override synchronized void put(KeyType key, ValueType value); @Override ValueType get(KeyType key); @Override String getName(); @Override long getSize(); @Override int getMaxSize(); @Override boolean containsKey(KeyType key); @Override String toString();  }
@Test public void testGetMaxSize() { int maxSize = 550; Cache cache = new DefaultCache(getRandomString(), maxSize); assertEquals("invalid max size", maxSize, cache.getMaxSize()); }