public boolean isResourceOfType(
      String resourceName, ResourceUnitCapacityType capacityType) {
    return capacityTypes.containsKey(resourceName) &&
        capacityTypes.get(resourceName).equals(capacityType);
  }
@Test
  public void isResourceOfType() {
    QueueCapacityVector capacityVector = QueueCapacityVector.newInstance();

    capacityVector.setResource(MEMORY_URI, 10, ResourceUnitCapacityType.WEIGHT);
    capacityVector.setResource(VCORES_URI, 6, ResourceUnitCapacityType.PERCENTAGE);
    capacityVector.setResource(CUSTOM_RESOURCE, 3, ResourceUnitCapacityType.ABSOLUTE);

    Assert.assertTrue(capacityVector.isResourceOfType(MEMORY_URI, ResourceUnitCapacityType.WEIGHT));
    Assert.assertTrue(capacityVector.isResourceOfType(VCORES_URI,
        ResourceUnitCapacityType.PERCENTAGE));
    Assert.assertTrue(capacityVector.isResourceOfType(CUSTOM_RESOURCE,
        ResourceUnitCapacityType.ABSOLUTE));
  }