Size { public static long parseSizeToMegabytes(String humanSize) { return parseAndConvertToBytes(humanSize) / M; } private  Size(); static String toHumanSize(long sizeInBytes); static long parseSize(String humanSize); static long parseSizeToMegabytes(String humanSize);  }
@Test public void testParseToMegabyte() { Assert.assertEquals(Size.parseSizeToMegabytes("10485760"), 10); Assert.assertEquals(Size.parseSizeToMegabytes("12 MB"), 12); Assert.assertEquals(Size.parseSizeToMegabytes("1GB"), 1024); }