@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); }
public static double calcMemoryUtilization(Long threadBytes, long totalBytes) { if (threadBytes == null || totalBytes == 0) { return 0; } return (threadBytes * 100d) / totalBytes; }
Utils { public static double calcMemoryUtilization(Long threadBytes, long totalBytes) { if (threadBytes == null || totalBytes == 0) { return 0; } return (threadBytes * 100d) / totalBytes; } }
Utils { public static double calcMemoryUtilization(Long threadBytes, long totalBytes) { if (threadBytes == null || totalBytes == 0) { return 0; } return (threadBytes * 100d) / totalBytes; }  }
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); }
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; }