### Question:
Utils { public static double calcLoad(long deltaCpuTime, long deltaUptime) { if (deltaCpuTime <= 0 || deltaUptime == 0) { return 0.0; } return deltaCpuTime * 100d / deltaUptime; }  static long[] sortAndFilterThreadIdsByValue(LongObjectMap map, int threadLimit); static double calcLoad(long deltaCpuTime, long deltaUptime); static double calcLoad(Long deltaCpuTime, long deltaUptime, long factor); static double calcMemoryUtilization(Long threadBytes, long totalBytes); static void sleep(long mills); static int getJavaMajorVersion(String javaSpecificationVersion); static long NANOS_TO_MILLS; }### Answer:
@Test public void calcLoadInputNegativeZeroZeroOutputZero() { final Long deltaCpuTime = -4_194_304L; final long deltaUptime = 0L; final long factor = 0L; final double retval = Utils.calcLoad(deltaCpuTime, deltaUptime, factor); Assert.assertEquals(0.0, retval, 0.0); }
@Test public void calcLoadInputPositivePositiveOutputPositive() { final long deltaCpuTime = 558_348_370L; final long deltaUptime = 1L; final double retval = Utils.calcLoad(deltaCpuTime, deltaUptime); Assert.assertEquals(0x1.a0008001p+35 , retval, 0.0); }
@Test public void calcLoadInputPositivePositiveZeroOutputPositiveInfinity() { final Long deltaCpuTime = 4_194_304L; final long deltaUptime = 4_611_686_018_427_387_904L; final long factor = 0L; final double retval = Utils.calcLoad(deltaCpuTime, deltaUptime, factor); Assert.assertEquals(Double.POSITIVE_INFINITY, retval, 0.0); }
@Test public void calcLoadInputPositiveZeroOutputZero() { final long deltaCpuTime = 558_348_370L; final long deltaUptime = 0L; final double retval = Utils.calcLoad(deltaCpuTime, deltaUptime); Assert.assertEquals(0.0, retval, 0.0); }
@Test public void calcLoadInputPositiveZeroZeroOutputZero() { final Long deltaCpuTime = 4_194_304L; final long deltaUptime = 0L; final long factor = 0L; final double retval = Utils.calcLoad(deltaCpuTime, deltaUptime, factor); Assert.assertEquals(0.0, retval, 0.0); }
@Test public void calcLoadInputZeroZeroOutputZero() { final long deltaCpuTime = 0L; final long deltaUptime = 0L; final double retval = Utils.calcLoad(deltaCpuTime, deltaUptime); Assert.assertEquals(0.0, retval, 0.0); }