### Question:
AkubraLowlevelStorage implements ILowlevelStorage, IListable, ISizable, ICheckable { public long replaceDatastream(String dsKey, InputStream content, Map<String, String> hints) throws LowlevelStorageException { return replace(datastreamStore, dsKey, content, forceSafeDatastreamOverwrites, hints); } AkubraLowlevelStorage(BlobStore objectStore,
                                 BlobStore datastreamStore,
                                 boolean forceSafeObjectOverwrites,
                                 boolean forceSafeDatastreamOverwrites); long addDatastream(String dsKey, InputStream content, Map<String, String> hints); long addDatastream(String pid, InputStream content); void addObject(String objectKey, InputStream content, Map<String, String> hints); void addObject(String pid, InputStream content); @Override void auditDatastream(); @Override void auditObject(); @Override void rebuildDatastream(); @Override void rebuildObject(); @Override void removeDatastream(String dsKey); @Override void removeObject(String objectKey); long replaceDatastream(String dsKey, InputStream content, Map<String, String> hints); long replaceDatastream(String pid, InputStream content); void replaceObject(String objectKey, InputStream content, Map<String, String> hints); void replaceObject(String pid, InputStream content); @Override InputStream retrieveDatastream(String dsKey); @Override InputStream retrieveObject(String objectKey); @Override Iterator<String> listDatastreams(); @Override Iterator<String> listObjects(); @Override long getDatastreamSize(String dsKey); @Override boolean objectExists(String objectKey);  }### Answer:
@Test (expected=ObjectNotInLowlevelStorageException.class) public void testReplaceNonExistingDatastream() throws Exception { instance.replaceDatastream(DS_KEY, toStream(DS_CONTENT)); }
@Test (expected=ObjectNotInLowlevelStorageException.class) public void testReplaceNonExistingDatastreamSafely() throws Exception { safeInstance.replaceDatastream(DS_KEY, toStream(DS_CONTENT)); }