UnitUtil { public static double getBytesInMb( double bytes ) { return convert( bytes, UnitUtil.Unit.B, UnitUtil.Unit.MB ); }  static double convert( Double value, Unit from, Unit to ); static double getBytesInMb( double bytes );  }
@Test public void testGetBytesInMb() { double result = UnitUtil.getBytesInMb( 1024 * 1024 ); assertEquals( 1.0, result, DELTA ); result = UnitUtil.getBytesInMb( 1024 * 1024 * 4 ); assertEquals( 4.0, result, DELTA ); }