@Test
  public void testFiltersParsing(){
    Map<String, String> requestProperties = new HashMap<String, String>() {{
      put(DIRECTIVE_HOSTS, "host1,host2,host3");
      put(DIRECTIVE_COMPONENTS, "SERVICE1:COMPONENT1;COMPONENT2,SERVICE2:COMPONENT1;COMPONENT2;COMPONENT3");
    }};

    Set<String> expectedHosts = new HashSet<>(Arrays.asList("host1", "host2", "host3"));
    Set<String> hosts = KerberosHelperImpl.parseHostFilter(requestProperties);

    assertEquals(expectedHosts, hosts);

    Map<String, Set<String>> expectedComponents = new HashMap<String, Set<String>>(){{
      put("SERVICE1", new HashSet<String>(){{
        add("COMPONENT1");
        add("COMPONENT2");
      }});
      put("SERVICE2", new HashSet<String>(){{
        add("COMPONENT1");
        add("COMPONENT2");
        add("COMPONENT3");
      }});
    }};
    Map<String, Set<String>> components = KerberosHelperImpl.parseComponentFilter(requestProperties);

    assertEquals(expectedComponents, components);
  }
Test that a Kerberos Descriptor that contains a Service with 0 Components does not raise any exceptions.
ambari-server/src/test/java/org/apache/ambari/server/controller/KerberosHelperTest.java