@Test public void parseList_withValidResponses_shouldReturnListResponses() throws Exception { List<ImapResponse> responses = asList( createImapResponse("* LIST () \"/\" blurdybloop"), createImapResponse("* LIST (\\Noselect) \"/\" foo"), createImapResponse("* LIST () \"/\" foo/bar"), createImapResponse("* LIST (\\NoInferiors) NIL INBOX"), createImapResponse("X OK LIST completed") ); List<ListResponse> result = ListResponse.parseList(responses); assertEquals(4, result.size()); assertListResponseEquals(noAttributes(), "/", "blurdybloop", result.get(0)); assertListResponseEquals(singletonList("\\Noselect"), "/", "foo", result.get(1)); assertListResponseEquals(noAttributes(), "/", "foo/bar", result.get(2)); assertListResponseEquals(singletonList("\\NoInferiors"), null, "INBOX", result.get(3)); }
public static List<ListResponse> parseList(List<ImapResponse> responses) { return parse(responses, Responses.LIST); }
ListResponse { public static List<ListResponse> parseList(List<ImapResponse> responses) { return parse(responses, Responses.LIST); } }
ListResponse { public static List<ListResponse> parseList(List<ImapResponse> responses) { return parse(responses, Responses.LIST); } private  ListResponse(List<String> attributes, String hierarchyDelimiter, String name); }
ListResponse { public static List<ListResponse> parseList(List<ImapResponse> responses) { return parse(responses, Responses.LIST); } private  ListResponse(List<String> attributes, String hierarchyDelimiter, String name); static List<ListResponse> parseList(List<ImapResponse> responses); static List<ListResponse> parseLsub(List<ImapResponse> responses); List<String> getAttributes(); boolean hasAttribute(String attribute); @Nullable String getHierarchyDelimiter(); String getName(); }
ListResponse { public static List<ListResponse> parseList(List<ImapResponse> responses) { return parse(responses, Responses.LIST); } private  ListResponse(List<String> attributes, String hierarchyDelimiter, String name); static List<ListResponse> parseList(List<ImapResponse> responses); static List<ListResponse> parseLsub(List<ImapResponse> responses); List<String> getAttributes(); boolean hasAttribute(String attribute); @Nullable String getHierarchyDelimiter(); String getName();  }