MyBatisCacheImpl implements Cache { @Override public int getSize() { return Ints.saturatedCast(delegate.size()); } MyBatisCacheImpl(String id); void setSize(Integer size); @Override String getId(); @Override void putObject(Object key, Object value); @Override Object getObject(Object key); @Override Object removeObject(Object key); @Override void clear(); @Override int getSize(); @Override ReadWriteLock getReadWriteLock();  }
@Test(expected = NullPointerException.class) public void testExceptionWithoutSize() { cache.getSize(); }