### Question:
Utils { public static double calcMemoryUtilization(Long threadBytes, long totalBytes) { if (threadBytes == null || totalBytes == 0) { return 0; } return (threadBytes * 100d) / totalBytes; }  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 calcMemoryUtilizationInputNegativePositiveOutputNegative() { final Long threadBytes = -507_680_768_073_012_547L; final long totalBytes = 1_147_301_170_758_571_992L; final double retval = Utils.calcMemoryUtilization(threadBytes, totalBytes); Assert.assertEquals(-0x1.6200000024f82p+5 , retval, 0.0); }
@Test public void calcMemoryUtilizationInputPositiveZeroOutputZero() { final Long threadBytes = 1L; final long totalBytes = 0L; final double retval = Utils.calcMemoryUtilization(threadBytes, totalBytes); Assert.assertEquals(0.0, retval, 0.0); }