DiskObjectRepository implements ObjectRepository { public boolean objectAlreadyExist(String objectId, String location) { return fileOperations.fileAlreadyExists(objectId, location); }  void saveObject(Object objectToBeSerialized, OutputStream outputStream); Object getObject(InputStream inputStream); boolean objectAlreadyExist(String objectId, String location); void saveObject(Object object, String objectId, String location); Object getObject(String objectId, String location); @Override boolean clearObjectIfAvailable(String objectId, String location);  }
@Test public void testObjectAlreadyExists() throws Exception { String locationDirectory = getAbsolutePath("src", "test", "resources", "com", "svashishtha","mocktail", "util"); boolean objectAlreadyExist = objectRepository.objectAlreadyExist( "recorded_list.ser", locationDirectory); assertThat(objectAlreadyExist, is(true)); }