### Question:
Batch implements IBatch { public List<String> getRejectedItemsId() { if (monitor == null) { return new ArrayList<String>(); } return monitor.getRejectedItems(); } 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 testGetRejectedItemsId() { Batch batch = new Batch("12345"); assertThat(batch.getRejectedItemsId(), notNullValue()); assertThat(batch.getRejectedItemsId().size(), is(0)); assertThat(new Batch("12345", "batchName", "batchGroup").getRejectedItemsId(), notNullValue()); assertThat(new Batch("12345", "batchName", "batchGroup").getRejectedItemsId().size(), is(0)); InProcessBatchProgressMonitor mockedProgressMonitor = mock(InProcessBatchProgressMonitor.class); batch.setProgressMonitor(mockedProgressMonitor); final List<String> rejectedItems = new ArrayList<String>(); rejectedItems.add("1234"); rejectedItems.add("4321"); rejectedItems.add("3412"); rejectedItems.add("2143"); when(mockedProgressMonitor.getRejectedItems()).thenReturn(rejectedItems); assertThat(batch.getRejectedItemsId(), notNullValue()); assertThat(batch.getRejectedItemsId().size(), is(4)); assertThat(batch.getRejectedItemsId().get(0), is("1234")); assertThat(batch.getRejectedItemsId().get(1), is("4321")); assertThat(batch.getRejectedItemsId().get(2), is("3412")); assertThat(batch.getRejectedItemsId().get(3), is("2143")); }