MetricConverter { public static String getPlato(double gravity) { DecimalFormat df = new DecimalFormat("#.#"); double plato = (EBC_A * -1) + (EBC_B * gravity) - (EBC_C * Math.pow(gravity, 2)) + (EBC_D * Math.pow(gravity, 3)); if (0 > plato && -0.05 < plato) { plato = 0.0; } return df.format(plato); }  static double getEBC(double inSRM); static double getEBC(String inSRM); static double getSRM(double inEBC); static String getPlato(double gravity); static boolean isCountryMetric(String country);  }
@Test public void getPlatoFromGravity() { assert("-13.5".equals(MetricConverter.getPlato(0.950))); assert("0".equals(MetricConverter.getPlato(1.000))); assert("0.5".equals(MetricConverter.getPlato(1.002))); assert("12.4".equals(MetricConverter.getPlato(1.050))); assert("23.8".equals(MetricConverter.getPlato(1.100))); assert("39.9".equals(MetricConverter.getPlato(1.179))); assert("43.9".equals(MetricConverter.getPlato(1.200))); assert("-616.9".equals(MetricConverter.getPlato(0.000))); assert("-2782.8".equals(MetricConverter.getPlato(-1.100))); }