### Question:
Batch implements IBatch { public String getStatus() { if (monitor == null) { return null; } if (!monitor.isDone()) { if (new Date().getTime() - monitor.getLastUpdate().getTime() > zombieInterval) { return STATUS_ZOMBIE; } return STATUS_RUNNING; } if (monitor.isSuccess()) { return STATUS_SUCCESS; } return STATUS_FAILURE; } 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 testGetStatus() { Batch batch = new Batch("12345"); assertNull(batch.getStatus()); assertNull(new Batch("12345", "batchName", "batchGroup").getStatus()); InProcessBatchProgressMonitor mockedProgressMonitor = mock(InProcessBatchProgressMonitor.class); batch.setProgressMonitor(mockedProgressMonitor); when(mockedProgressMonitor.isDone()).thenReturn(false); when(mockedProgressMonitor.getLastUpdate()).thenReturn(new Date()); assertThat(batch.getStatus(), is(IBatch.STATUS_RUNNING)); when(mockedProgressMonitor.isDone()).thenReturn(true); when(mockedProgressMonitor.isSuccess()).thenReturn(false); assertThat(batch.getStatus(), is(IBatch.STATUS_FAILURE)); when(mockedProgressMonitor.isDone()).thenReturn(true); when(mockedProgressMonitor.isSuccess()).thenReturn(true); assertThat(batch.getStatus(), is(IBatch.STATUS_SUCCESS)); }