SyncthingUtils { public static String humanReadableTransferRate(long bytes) { return humanReadableSize(bytes) + "/s"; }  static void notifyForegroundStateChanged(final Context context, boolean inForeground); static File getConfigDirectory(Context context); static String getSyncthingCACert(Context context); static String getSyncthingBinaryPath(Context context); static String getSyncthingInotifyBinaryPath(Context context); static String getDisplayName(DeviceConfig device); static String truncateId(String deviceId); static String humanReadableSize(long bytes); static String humanReadableTransferRate(long bytes); static String daysToSeconds(String days); static String secondsToDays(String seconds); static String[] rollArray(String string); static String unrollArray(String[] strings); static String generateName(boolean dashed); static String generateDeviceName(boolean dashed); static String generateUsername(); static String generatePassword(); static String hiddenString(int len); static String randomString(int len); static Interval getIntervalForRange(DateTime now, long start, long end); static boolean isNowBetweenRange(long start, long end); static long parseTime(String str); static long hoursToMillis(int hours); static long minutesToMillis(int minutes); static File[] listExportedConfigs(Context context); static void exportConfig(Context context); static void importConfig(Context context, Uri uri, boolean force); static boolean isClipBoardSupported(Context context); static void copyToClipboard(Context context, CharSequence label, String id); static void shareDeviceId(Context context, String id); static boolean isIpAddress(String ipAddress); static boolean isIpAddressWithPort(String ipAddress); static boolean isDomainName(String hostName); static boolean isDomainNameWithPort(String hostName); static boolean isDomainNameWithPath(String hostname); static String extractHost(String uri); static String extractPort(String uri); static boolean isHttps(String uri); static String buildUrl(@NonNull String host, @NonNull String port, boolean tls); static String buildAuthorization(String user, String pass);  }
@Test public void testTransferrate() { assertEquals("1.5 MiB/s", humanReadableTransferRate(1572864)); }