public static List<TriStateSelection> forAgentsResources(Set<ResourceConfig> resourceConfigs, Agents agents) {
        return convert(resourceConfigs, agents, new Assigner<>() {
            @Override
            public boolean shouldAssociate(Agent agent, ResourceConfig resourceConfig) {
                return agent.getResourcesAsList().contains(resourceConfig.getName());
            }

            @Override
            public String identifier(ResourceConfig resourceConfig) {
                return resourceConfig.getName();
            }

            @Override
            public boolean shouldEnable(Agent agent, ResourceConfig resourceConfig) {
                return true;
            }
        });
    }
@Test
    public void shouldListResourceSelectionInAlhpaOrder() {
        HashSet<ResourceConfig> resourceConfigs = new HashSet<>();
        resourceConfigs.add(new ResourceConfig("B02"));
        resourceConfigs.add(new ResourceConfig("b01"));
        resourceConfigs.add(new ResourceConfig("a01"));
        List<TriStateSelection> selections = TriStateSelection.forAgentsResources(resourceConfigs, agents);

        assertThat(selections.get(0), Matchers.is(new TriStateSelection("a01", TriStateSelection.Action.remove)));
        assertThat(selections.get(1), Matchers.is(new TriStateSelection("b01", TriStateSelection.Action.remove)));
        assertThat(selections.get(2), Matchers.is(new TriStateSelection("B02", TriStateSelection.Action.remove)));
    }