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