### Question:
ItemManagerImpl implements ItemManager { @Override public boolean isExist(SessionContext context, Id itemId) { Response<Boolean> response; response = getStateAdaptor(context).isItemExist(context, itemId); if (!response.isSuccessful()) { ReturnCode returnCode = new ReturnCode(ErrorCode.ZU_ITEM_IS_EXIST, Module.ZDB, null, response.getReturnCode()); logger.error(returnCode.toString()); throw new ZusammenException(returnCode); } return response.getValue(); }  @Override Collection<Item> list(SessionContext context); @Override boolean isExist(SessionContext context, Id itemId); @Override Item get(SessionContext context, Id itemId); @Override Id create(SessionContext context, Info itemInfo); @Override Id create(SessionContext context, Id itemId, Info itemInfo); @Override void update(SessionContext context, Id itemId, Info itemInfo); @Override void delete(SessionContext context, Id itemId); @Override void updateModificationTime(SessionContext context, Id itemId, Date modificationTime);  }### Answer:
@Test public void testIsExist() { Id itemId = new Id(); doReturn(new Response<>(true)).when(stateAdaptorMock).isItemExist(context, itemId); boolean exist = itemManagerImpl.isExist(context, itemId); Assert.assertTrue(exist); }
@Test public void testIsExistWhenNot() { Id itemId = new Id(); doReturn(new Response<>(false)).when(stateAdaptorMock).isItemExist(context, itemId); boolean exist = itemManagerImpl.isExist(context, itemId); Assert.assertFalse(exist); }