### Question:
HazelcastLockFileHandler extends LockFileHandler { @Override public void deleteLockAndCleanUp() { Lock monitor = hazelcast.getLock("monitor"); monitor.lock(); try { if (hazelcast.getCluster().getMembers().size() == 1) { hotfolder.delete(lockUri); } } catch (IOException e) { logger.error("Error while deleting lock file: " + lockUri, e); } finally { monitor.unlock(); hazelcast.getLifecycleService().shutdown(); } } HazelcastLockFileHandler(HazelcastInstance hazelcast); @Override void createOrOverwriteLock(boolean overwriteLock); @Override void deleteLockAndCleanUp();  }### Answer:
@Test public void shouldDeleteLock() throws IOException { when(hazelMock.getCluster().getMembers().size()).thenReturn(1); lockHandlerSut.deleteLockAndCleanUp(); verify(hotfolderMock).delete(lockUri); }
@Test public void shouldNotDeleteLock() throws IOException { when(hazelMock.getCluster().getMembers().size()).thenReturn(2); lockHandlerSut.deleteLockAndCleanUp(); verify(hotfolderMock, never()).delete(lockUri); }