public Set<String> getResourceNamesByCapacityType(
      ResourceUnitCapacityType capacityType) {
    return new HashSet<>(capacityTypePerResource.getOrDefault(capacityType,
        Collections.emptySet()));
  }
@Test
  public void getResourceNamesByCapacityType() {
    QueueCapacityVector capacityVector = QueueCapacityVector.newInstance();

    capacityVector.setResource(MEMORY_URI, 10, ResourceUnitCapacityType.PERCENTAGE);
    capacityVector.setResource(VCORES_URI, 6, ResourceUnitCapacityType.PERCENTAGE);

    // custom is not set, defaults to 0
    Assert.assertEquals(1, capacityVector.getResourceNamesByCapacityType(
        ResourceUnitCapacityType.ABSOLUTE).size());
    Assert.assertTrue(capacityVector.getResourceNamesByCapacityType(
        ResourceUnitCapacityType.ABSOLUTE).contains(CUSTOM_RESOURCE));

    Assert.assertEquals(2, capacityVector.getResourceNamesByCapacityType(
        ResourceUnitCapacityType.PERCENTAGE).size());
    Assert.assertTrue(capacityVector.getResourceNamesByCapacityType(
        ResourceUnitCapacityType.PERCENTAGE).contains(VCORES_URI));
    Assert.assertTrue(capacityVector.getResourceNamesByCapacityType(
        ResourceUnitCapacityType.PERCENTAGE).contains(MEMORY_URI));
    Assert.assertEquals(10, capacityVector.getResource(MEMORY_URI).getResourceValue(), EPSILON);
    Assert.assertEquals(6, capacityVector.getResource(VCORES_URI).getResourceValue(), EPSILON);
  }