Resources { @Private @Unstable public static Resource createResourceWithSameValue(long value) { LightWeightResource res = new LightWeightResource(value, Long.valueOf(value).intValue()); int numberOfResources = ResourceUtils.getNumberOfKnownResourceTypes(); for (int i = 2; i < numberOfResources; i++) { res.setResourceValue(i, value); } return res; }  @Private @Unstable static Resource createResourceWithSameValue(long value); static Resource createResource(int memory); static Resource createResource(int memory, int cores); static Resource createResource(long memory); static Resource createResource(long memory, int cores); static Resource none(); static boolean isNone(Resource other); static Resource unbounded(); static Resource clone(Resource res); static Resource addTo(Resource lhs, Resource rhs); static Resource add(Resource lhs, Resource rhs); static Resource subtractFrom(Resource lhs, Resource rhs); static Resource subtract(Resource lhs, Resource rhs); static Resource subtractFromNonNegative(Resource lhs, Resource rhs); static Resource subtractNonNegative(Resource lhs, Resource rhs); static Resource negate(Resource resource); static Resource multiplyTo(Resource lhs, double by); static Resource multiply(Resource lhs, double by); static Resource multiplyAndAddTo(
      Resource lhs, Resource rhs, double by); static Resource multiplyAndNormalizeUp(ResourceCalculator calculator,
      Resource lhs, double[] by, Resource factor); static Resource multiplyAndNormalizeUp(
      ResourceCalculator calculator,Resource lhs, double by, Resource factor); static Resource multiplyAndNormalizeDown(
      ResourceCalculator calculator,Resource lhs, double by, Resource factor); static Resource multiplyAndRoundDown(Resource lhs, double by); static Resource multiplyAndRoundUp(Resource lhs, double by); static Resource normalize(
      ResourceCalculator calculator, Resource lhs, Resource min,
      Resource max, Resource increment); static Resource roundUp(
      ResourceCalculator calculator, Resource lhs, Resource factor); static Resource roundDown(
      ResourceCalculator calculator, Resource lhs, Resource factor); static boolean isInvalidDivisor(
      ResourceCalculator resourceCalculator, Resource divisor); static float ratio(
      ResourceCalculator resourceCalculator, Resource lhs, Resource rhs); static float divide(
      ResourceCalculator resourceCalculator,
      Resource clusterResource, Resource lhs, Resource rhs); static Resource divideAndCeil(
      ResourceCalculator resourceCalculator, Resource lhs, int rhs); static Resource divideAndCeil(
      ResourceCalculator resourceCalculator, Resource lhs, float rhs); static boolean equals(Resource lhs, Resource rhs); static boolean lessThan(
      ResourceCalculator resourceCalculator, 
      Resource clusterResource,
      Resource lhs, Resource rhs); static boolean lessThanOrEqual(
      ResourceCalculator resourceCalculator, 
      Resource clusterResource,
      Resource lhs, Resource rhs); static boolean greaterThan(
      ResourceCalculator resourceCalculator,
      Resource clusterResource,
      Resource lhs, Resource rhs); static boolean greaterThanOrEqual(
      ResourceCalculator resourceCalculator, 
      Resource clusterResource,
      Resource lhs, Resource rhs); static Resource min(
      ResourceCalculator resourceCalculator, 
      Resource clusterResource,
      Resource lhs, Resource rhs); static Resource max(
      ResourceCalculator resourceCalculator, 
      Resource clusterResource,
      Resource lhs, Resource rhs); static boolean fitsIn(Resource smaller, Resource bigger); static boolean fitsIn(ResourceCalculator rc,
      Resource smaller, Resource bigger); static Resource componentwiseMin(Resource lhs, Resource rhs); static Resource componentwiseMax(Resource lhs, Resource rhs); static Resource normalizeDown(ResourceCalculator calculator,
      Resource resource, Resource factor);  }
@Test public void testCreateResourceWithSameLongValue() throws Exception { unsetExtraResourceType(); setupExtraResourceType(); Resource res = Resources.createResourceWithSameValue(11L); assertEquals(11L, res.getMemorySize()); assertEquals(11, res.getVirtualCores()); assertEquals(11L, res.getResourceInformation(EXTRA_RESOURCE_TYPE).getValue()); }
@Test public void testCreateResourceWithSameIntValue() throws Exception { unsetExtraResourceType(); setupExtraResourceType(); Resource res = Resources.createResourceWithSameValue(11); assertEquals(11, res.getMemorySize()); assertEquals(11, res.getVirtualCores()); assertEquals(11, res.getResourceInformation(EXTRA_RESOURCE_TYPE).getValue()); }
@Test public void testCreateSimpleResourceWithSameLongValue() { Resource res = Resources.createResourceWithSameValue(11L); assertEquals(11L, res.getMemorySize()); assertEquals(11, res.getVirtualCores()); }
@Test public void testCreateSimpleResourceWithSameIntValue() { Resource res = Resources.createResourceWithSameValue(11); assertEquals(11, res.getMemorySize()); assertEquals(11, res.getVirtualCores()); }