class SpeedFormatterUtil {

    public static int format(final double metersPerSecond, final UnitSystem system) {
        SpeedConverter speedConverter = new SpeedConverter();
        Measurement speedMeterPerSecond = new Measurement(metersPerSecond,
                MeasurementUnit.METERS_PER_SECOND);
        double ret;
        switch (system) {
            case IMPERIAL_UK:
            case IMPERIAL_US:
                ret = speedConverter.convert(speedMeterPerSecond.getValue(),
                        speedMeterPerSecond.getUnit(), MeasurementUnit.MILES_PER_HOUR).getValue();
                break;
            case METRIC:
            default: // metric
                ret = speedConverter.convert(speedMeterPerSecond.getValue(),
                        speedMeterPerSecond.getUnit(), MeasurementUnit.KILOMETERS_PER_HOUR).getValue();
                break;
        }
        return (int) Math.round(ret);
    }

    private  SpeedFormatterUtil();

}