Quantities { public static String normalizeMemory(String memory) { return formatMemory(parseMemory(memory)); } private  Quantities(); static long parseMemory(String memory); static String formatMemory(long bytes); static String normalizeMemory(String memory); static int parseCpuAsMilliCpus(String cpu); static String formatMilliCpu(int milliCpu); static String normalizeCpu(String milliCpu);  }
@Test public void testNormalizeMemory() { assertThat(normalizeMemory("1K"), is("1000")); assertThat(normalizeMemory("1Ki"), is("1024")); assertThat(normalizeMemory("1M"), is("1000000")); assertThat(normalizeMemory("1Mi"), is("1048576")); assertThat(normalizeMemory("12345"), is("12345")); assertThat(normalizeMemory("500Mi"), is("524288000")); assertThat(normalizeMemory("1.1Gi"), is("1181116006")); assertThat(normalizeMemory("1.2Gi"), is("1288490188")); }