@Test public void saveDatastoreIsNotClosed() { try { testedClass.save(new OutputStreamStub()); } catch (UnsupportedOperationException e) { fail("It is not allowed to call a method close on OutputStream"); } catch (IOException e) { fail("Unexpected Error"); } }
public void save(OutputStream out) throws IOException { readerLock.lock(); try { serialize(datastore, out); } finally { readerLock.unlock(); } }
ReadWriteLockDataStore implements InMemoryDataStore, ObservableDataStore { public void save(OutputStream out) throws IOException { readerLock.lock(); try { serialize(datastore, out); } finally { readerLock.unlock(); } } }
ReadWriteLockDataStore implements InMemoryDataStore, ObservableDataStore { public void save(OutputStream out) throws IOException { readerLock.lock(); try { serialize(datastore, out); } finally { readerLock.unlock(); } }  }
ReadWriteLockDataStore implements InMemoryDataStore, ObservableDataStore { public void save(OutputStream out) throws IOException { readerLock.lock(); try { serialize(datastore, out); } 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 void save(OutputStream out) throws IOException { readerLock.lock(); try { serialize(datastore, out); } 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();  }