### Question:
CapabilityResponse { public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = parse(capabilityList); } else if (response.getTag() == null) { result = parse(response); } else { result = null; } if (result != null) { return result; } } return null; } private  CapabilityResponse(Set<String> capabilities); static CapabilityResponse parse(List<ImapResponse> responses); Set<String> getCapabilities();  }### Answer:
@Test public void parse_withTaggedResponse_shouldReturnNull() throws Exception { CapabilityResponse result = parse("1 OK"); assertNull(result); }
@Test public void parse_withoutOkResponse_shouldReturnNull() throws Exception { CapabilityResponse result = parse("* BAD Go Away"); assertNull(result); }
@Test public void parse_withOkResponseWithoutList_shouldReturnNull() throws Exception { CapabilityResponse result = parse("* OK Welcome"); assertNull(result); }
@Test public void parse_withListInCapabilityResponse_shouldReturnNull() throws Exception { ImapList list = createImapResponse("* CAPABILITY IMAP4rev1 []"); CapabilityResponse result = CapabilityResponse.parse(list); assertNull(result); }
@Test public void parse_withoutCapabilityResponse_shouldReturnNull() throws Exception { ImapList list = createImapResponse("* EXISTS 1"); CapabilityResponse result = CapabilityResponse.parse(list); assertNull(result); }
@Test public void parse_withEmptyResponseList_shouldReturnNull() throws Exception { List<ImapResponse> responses = Collections.emptyList(); CapabilityResponse result = CapabilityResponse.parse(responses); assertNull(result); }
@Test public void parse_withoutCapabilityResponseInResponseList_shouldReturnNull() throws Exception { List<ImapResponse> responses = Collections.singletonList(createImapResponse("* EXISTS 42")); CapabilityResponse result = CapabilityResponse.parse(responses); assertNull(result); }