### Question:
Batch implements IBatch { public Date getLastUpdate() { if (monitor == null) { return null; } return monitor.getLastUpdate(); } 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 testGetLastUpdate() { Batch batch = new Batch("12345"); assertThat(batch.getLastUpdate(), nullValue()); assertThat(new Batch("12345", "batchName", "batchGroup").getLastUpdate(), nullValue()); InProcessBatchProgressMonitor mockedProgressMonitor = mock(InProcessBatchProgressMonitor.class); batch.setProgressMonitor(mockedProgressMonitor); when(mockedProgressMonitor.getLastUpdate()).thenReturn(null); assertThat(batch.getLastUpdate(), nullValue()); when(mockedProgressMonitor.getLastUpdate()).thenReturn(new DateTime("2012-03-02T17:23:30").toDate()); assertThat(batch.getLastUpdate(), is(new DateTime("2012-03-02T17:23:30").toDate())); }