### Question:
Batch implements IBatch { public long getItemCount() { if (monitor == null) { return 0; } return monitor.getItemCount(); } Batch(String uuid);  Batch(String uuid, String name, String group); @Override boolean equals(Object obj); String getCurrentItem(); String getCurrentTask(); Date getEndDate(); String getGroup(); long getItemCount(); String getLastMessage(); Date getLastUpdate(); String getName(); IBatchProgressMonitor getProgressMonitor(); float getProgressStatus(); List<String> getRejectedItemsId(); Date getStartDate(); String getStatus(); String getUuid(); boolean isSuccess(); void setProgressMonitor(IBatchProgressMonitor monitor); void setZombieInterval(int zombieInterval);  }### Answer:
@Test public void testGetItemCount() { Batch batch = new Batch("12345"); assertThat(batch.getItemCount(), is((long) 0)); assertThat(new Batch("12345", "batchName", "batchGroup").getItemCount(), is((long) 0)); InProcessBatchProgressMonitor mockedProgressMonitor = mock(InProcessBatchProgressMonitor.class); batch.setProgressMonitor(mockedProgressMonitor); when(mockedProgressMonitor.getItemCount()).thenReturn((long) 0); assertThat(batch.getItemCount(), is((long) 0)); when(mockedProgressMonitor.getItemCount()).thenReturn((long) 45); assertThat(batch.getItemCount(), is((long) 45)); }