public static boolean fitsIn(Resource smaller, Resource bigger) {
    int maxLength = ResourceUtils.getNumberOfCountableResourceTypes();
    for (int i = 0; i < maxLength; i++) {
      try {
        ResourceInformation rhsValue = bigger.getResourceInformation(i);
        ResourceInformation lhsValue = smaller.getResourceInformation(i);
        if (lhsValue.getValue() > rhsValue.getValue()) {
          return false;
        }
      } catch (ResourceNotFoundException ye) {
        LOG.warn("Resource is missing:" + ye.getMessage());
        continue;
      }
    }
    return true;
  }
@Test
  @Timeout(1000)
  void testFitsIn() {
    assertTrue(fitsIn(createResource(1, 1), createResource(2, 2)));
    assertTrue(fitsIn(createResource(2, 2), createResource(2, 2)));
    assertFalse(fitsIn(createResource(2, 2), createResource(1, 1)));
    assertFalse(fitsIn(createResource(1, 2), createResource(2, 1)));
    assertFalse(fitsIn(createResource(2, 1), createResource(1, 2)));
    assertTrue(fitsIn(createResource(1, 1, 1), createResource(2, 2, 2)));
    assertTrue(fitsIn(createResource(1, 1, 0), createResource(2, 2, 0)));
    assertTrue(fitsIn(createResource(1, 1, 1), createResource(2, 2, 2)));
  }