@Test
public void getBranchList() {

    ISchemaRegistryClient client = new DefaultSchemaRegistryClientForTesting(){
        public List<String> getSchemaBranches(String schemaMetadataName) {
            if(!schemaMetadataName.equals("Schema1")) {
                return new ArrayList<>();
            }
            List<String> branches = new ArrayList<>();
            branches.add("testBranch");
            return branches;
        }
        public List<String> getSchemaNames(List<String> schemaGroup) {
            if(!schemaGroup.contains("Group1")) {
                return new ArrayList<>();
            }
            List<String> schemas = new ArrayList<>();
            schemas.add("Schema1");
            return schemas;
        }
    };
    AutocompletionAgent autocompletionAgent =
            new AutocompletionAgent("schema-registry", client);
    List<String> schemaList = new ArrayList<>();
    schemaList.add("Schema1");
    schemaList.add("Schema2");
    List<String> groups = new ArrayList<>();
    groups.add("Group1");
    List<String> res = autocompletionAgent.getBranchList("tes", groups, schemaList, new ArrayList<>());
    List<String> expected = new ArrayList<>();
    expected.add("testBranch");
    assertEquals(1, res.size());
    assertThat(res, is(expected));
    res = autocompletionAgent.getSchemaMetadataList("tesSome", schemaList, new ArrayList<>());
    assertEquals(0, res.size());
}