SpeedFormatterUtil { public static String getUnitString(final Context context, final UnitSystem system) { switch (system) { case IMPERIAL_UK: case IMPERIAL_US: return context.getString(R.string.msdkui_unit_miles_per_hour); case METRIC: default: return context.getString(R.string.msdkui_unit_km_per_h); } } private  SpeedFormatterUtil(); static int format(final double metersPerSecond, final UnitSystem system); static String getUnitString(final Context context, final UnitSystem system);  }
@Test public void testGetVelocityString() { assertEquals( SpeedFormatterUtil.getUnitString(getApplicationContext(), UnitSystem.METRIC), getApplicationContext().getString(R.string.msdkui_unit_km_per_h)); assertEquals( SpeedFormatterUtil.getUnitString(getApplicationContext(), UnitSystem.IMPERIAL_UK), getApplicationContext().getString(R.string.msdkui_unit_miles_per_hour)); assertEquals( SpeedFormatterUtil.getUnitString(getApplicationContext(), UnitSystem.IMPERIAL_US), getApplicationContext().getString(R.string.msdkui_unit_miles_per_hour)); }