BaseServerListResponse extends ArrayList<BaseServerResponse> { public List<Exception> listExceptions() { return this .stream() .filter(this::isJobNotQueued) .map(this::errorMessage) .map(ClcClientException::new) .collect(toList()); } BaseServerListResponse(int initialCapacity);  BaseServerListResponse();  BaseServerListResponse(Collection<? extends BaseServerResponse> collection); List<Exception> listExceptions(); ClcException summaryException(); boolean hasErrors();  }
@Test public void testListExceptions_emptyResult() throws Exception { response = prepareResponseList(basicServerResponse("VA1ALTDSRV101")); List<Exception> errors = response.listExceptions(); assertEquals(errors.size(), 1); assertContains(firstErrorMessage(errors), "VA1ALTDSRV101", "not queued"); }
@Test public void testListExceptions_onlyNotQueued() throws Exception { response = prepareResponseList(basicServerResponse("VA1ALTDSRV101").queued(false)); List<Exception> errors = response.listExceptions(); assertEquals(errors.size(), 1); assertContains(firstErrorMessage(errors), "VA1ALTDSRV101", "not queued"); }