Converter { public static String getDurationStringShort(int duration, boolean durationIsInHours) { int firstPartBase = durationIsInHours ? HOURS_MIL : MINUTES_MIL; int firstPart = duration / firstPartBase; int leftoverFromFirstPart = duration - firstPart * firstPartBase; int secondPart = leftoverFromFirstPart / (durationIsInHours ? MINUTES_MIL : SECONDS_MIL); return String.format(Locale.getDefault(), "%02d:%02d", firstPart, secondPart); } private  Converter(); static String getDurationStringLong(int duration); static String getDurationStringShort(int duration, boolean durationIsInHours); static int durationStringLongToMs(String input); static int durationStringShortToMs(String input, boolean durationIsInHours); static String getDurationStringLocalized(Context context, long duration); static String shortLocalizedDuration(Context context, long time); static float getVolumeFromPercentage(int progress);  }
@Test public void testGetDurationStringShort() { String expected = "13:05"; assertEquals(expected, Converter.getDurationStringShort(47110000, true)); assertEquals(expected, Converter.getDurationStringShort(785000, false)); }