@Test public void testGetNullEntity() { CombinedFeed combinedFeed = testedClass.get("1", CombinedFeed.class); assertNull(combinedFeed); }
public <T extends Serializable> T get(String key, Class<T> type) { requireNonNull(key, "The parameter 'key' must not be null"); requireNonNull(type, "The parameter 'type' must not be null"); readerLock.lock(); try { Serializable object = datastore.get(key); return type.cast(object); } finally { readerLock.unlock(); } }
ReadWriteLockDataStore implements InMemoryDataStore, ObservableDataStore { public <T extends Serializable> T get(String key, Class<T> type) { requireNonNull(key, "The parameter 'key' must not be null"); requireNonNull(type, "The parameter 'type' must not be null"); readerLock.lock(); try { Serializable object = datastore.get(key); return type.cast(object); } finally { readerLock.unlock(); } } }
ReadWriteLockDataStore implements InMemoryDataStore, ObservableDataStore { public <T extends Serializable> T get(String key, Class<T> type) { requireNonNull(key, "The parameter 'key' must not be null"); requireNonNull(type, "The parameter 'type' must not be null"); readerLock.lock(); try { Serializable object = datastore.get(key); return type.cast(object); } finally { readerLock.unlock(); } }  }
ReadWriteLockDataStore implements InMemoryDataStore, ObservableDataStore { public <T extends Serializable> T get(String key, Class<T> type) { requireNonNull(key, "The parameter 'key' must not be null"); requireNonNull(type, "The parameter 'type' must not be null"); readerLock.lock(); try { Serializable object = datastore.get(key); return type.cast(object); } finally { readerLock.unlock(); } }  Serializable put(String key, T data); T get(String key, Class<T> type); void save(OutputStream out); @SuppressWarnings("unchecked") void load(InputStream in); @Override void addObserver(DataStoreObserver observer); @Override void deleteObserver(DataStoreObserver observer); Collection<Serializable> getAll(); }
ReadWriteLockDataStore implements InMemoryDataStore, ObservableDataStore { public <T extends Serializable> T get(String key, Class<T> type) { requireNonNull(key, "The parameter 'key' must not be null"); requireNonNull(type, "The parameter 'type' must not be null"); readerLock.lock(); try { Serializable object = datastore.get(key); return type.cast(object); } finally { readerLock.unlock(); } }  Serializable put(String key, T data); T get(String key, Class<T> type); void save(OutputStream out); @SuppressWarnings("unchecked") void load(InputStream in); @Override void addObserver(DataStoreObserver observer); @Override void deleteObserver(DataStoreObserver observer); Collection<Serializable> getAll();  }