MemoryDataStore implements DataStore<K, E> { @Override public Class<E> getEntityType() { return entityType; } MemoryDataStore(Class<E> entityType); @Override boolean hasKey(K key); @Override boolean save(K key, E entity); @Override boolean delete(K key); @Override E retrieve(K key); @Override Collection<K> keys(); @Override synchronized Collection<E> retrieveAll(); @Override Class<E> getEntityType(); @Override void truncate();  }
@Test public void testEntityType() { assertThat(dataStore.getEntityType(), is(equalTo(Person.class))); }