Converter { protected static boolean isMetric(MeasurementUnit unit) { switch (unit) { case KILOMETERS_PER_HOUR: case METERS_PER_SECOND: case KILOMETER: case METER: return true; default: return false; } }  Measurement convert(double in, MeasurementUnit from, MeasurementUnit to); static double round(double value, int places);  }
@Test public void testIsMetric() { assertTrue(Converter.isMetric(MeasurementUnit.METER)); assertTrue(Converter.isMetric(MeasurementUnit.KILOMETER)); assertTrue(Converter.isMetric(MeasurementUnit.KILOMETERS_PER_HOUR)); assertTrue(Converter.isMetric(MeasurementUnit.METERS_PER_SECOND)); assertFalse(Converter.isMetric(MeasurementUnit.FOOT)); assertFalse(Converter.isMetric(MeasurementUnit.YARD)); assertFalse(Converter.isMetric(MeasurementUnit.MILE)); assertFalse(Converter.isMetric(MeasurementUnit.MILES_PER_HOUR)); }