### Question:
ContentManipulationLockService { public boolean removeLock(String providerName) { synchronized (CFGFILE_NAME) { List<String> locks = getCurrentLocks(); if (locks != null && !locks.isEmpty()) { if (locks.contains(API_ID_ALL)) return false; locks.remove(providerName); if (locks.isEmpty()) locks = null; storeCurrentLocks(locks); } return true; } }  boolean isLockedForProvider(String providerName); List<String> getLockInfo(); boolean createLock(String providerName); void createLockAll(); boolean removeLock(String providerName); void removeLockAll(); static final String API_ID_ALL; }### Answer:
@SuppressWarnings("unchecked") @Test public void removeLock() { ContentManipulationLockService tested = getTested(); Mockito.when(tested.configService.get(ContentManipulationLockService.CFGFILE_NAME)).thenReturn(null); Assert.assertTrue(tested.removeLock(PROVIDER_1)); Mockito.verify(tested.configService).get(ContentManipulationLockService.CFGFILE_NAME); Mockito.verifyNoMoreInteractions(tested.configService); Mockito.reset(tested.configService); Mockito.when(tested.configService.get(ContentManipulationLockService.CFGFILE_NAME)).thenReturn(createCfgFileAll()); Assert.assertFalse(tested.removeLock(PROVIDER_1)); Mockito.verify(tested.configService).get(ContentManipulationLockService.CFGFILE_NAME); Mockito.verifyNoMoreInteractions(tested.configService); Mockito.reset(tested.configService); Mockito.when(tested.configService.get(ContentManipulationLockService.CFGFILE_NAME)).thenReturn(createCfgFileP1P2()); Mockito.doAnswer(new StoreValidationgAnswer(PROVIDER_2)).when(tested.configService) .create(Mockito.eq(ContentManipulationLockService.CFGFILE_NAME), Mockito.anyMap()); Assert.assertTrue(tested.removeLock(PROVIDER_1)); Mockito.verify(tested.configService).get(ContentManipulationLockService.CFGFILE_NAME); Mockito.verify(tested.configService).create(Mockito.eq(ContentManipulationLockService.CFGFILE_NAME), Mockito.anyMap()); Mockito.verifyNoMoreInteractions(tested.configService); Mockito.reset(tested.configService); Mockito.when(tested.configService.get(ContentManipulationLockService.CFGFILE_NAME)).thenReturn( createCfgFile(PROVIDER_1)); Assert.assertTrue(tested.removeLock(PROVIDER_1)); Mockito.verify(tested.configService).get(ContentManipulationLockService.CFGFILE_NAME); Mockito.verify(tested.configService).delete(Mockito.eq(ContentManipulationLockService.CFGFILE_NAME)); Mockito.verifyNoMoreInteractions(tested.configService); }