@Test public void getDownloadingRatesInKilobytes() { List<Long> list = new ArrayList<>(Arrays.asList(100L, 100L, 100L, 100L, 100L, 100L, 100L)); testee.setDownloadingRatesInKilobytes(list); assertThat(testee.getDownloadingRatesInKilobytes()).containsExactlyElementsOf(list); list = new ArrayList<>(Arrays.asList(100L, 100L, 100L, 100L, 100L, 100L, 100L, 50000L)); testee.setDownloadingRatesInKilobytes(list); assertThat(testee.getDownloadingRatesInKilobytes()).containsExactly(100L, 100L, 100L, 100L, 100L, 100L, 100L); list = new ArrayList<>(Arrays.asList(100L, 100L, 100L, 100L, 100L, 100L, 100L, 50000L, 50000L)); testee.setDownloadingRatesInKilobytes(list); assertThat(testee.getDownloadingRatesInKilobytes()).containsExactlyElementsOf(list); }
public List<Long> getDownloadingRatesInKilobytes() { if (downloadingRatesInKilobytes.isEmpty() || downloadingRatesInKilobytes.size() < 5) { return downloadingRatesInKilobytes; } if (downloadingRatesInKilobytes.get(downloadingRatesInKilobytes.size() - 1) / (float) 10 > downloadingRatesInKilobytes.get(downloadingRatesInKilobytes.size() - 2)) { if (downloadingRatesInKilobytes.get(downloadingRatesInKilobytes.size() - 1) / (float) 10 > downloadingRatesInKilobytes.get(downloadingRatesInKilobytes.size() - 3)) { return downloadingRatesInKilobytes.subList(0, downloadingRatesInKilobytes.size() - 1); } } return downloadingRatesInKilobytes; }
DownloaderStatus { public List<Long> getDownloadingRatesInKilobytes() { if (downloadingRatesInKilobytes.isEmpty() || downloadingRatesInKilobytes.size() < 5) { return downloadingRatesInKilobytes; } if (downloadingRatesInKilobytes.get(downloadingRatesInKilobytes.size() - 1) / (float) 10 > downloadingRatesInKilobytes.get(downloadingRatesInKilobytes.size() - 2)) { if (downloadingRatesInKilobytes.get(downloadingRatesInKilobytes.size() - 1) / (float) 10 > downloadingRatesInKilobytes.get(downloadingRatesInKilobytes.size() - 3)) { return downloadingRatesInKilobytes.subList(0, downloadingRatesInKilobytes.size() - 1); } } return downloadingRatesInKilobytes; } }
DownloaderStatus { public List<Long> getDownloadingRatesInKilobytes() { if (downloadingRatesInKilobytes.isEmpty() || downloadingRatesInKilobytes.size() < 5) { return downloadingRatesInKilobytes; } if (downloadingRatesInKilobytes.get(downloadingRatesInKilobytes.size() - 1) / (float) 10 > downloadingRatesInKilobytes.get(downloadingRatesInKilobytes.size() - 2)) { if (downloadingRatesInKilobytes.get(downloadingRatesInKilobytes.size() - 1) / (float) 10 > downloadingRatesInKilobytes.get(downloadingRatesInKilobytes.size() - 3)) { return downloadingRatesInKilobytes.subList(0, downloadingRatesInKilobytes.size() - 1); } } return downloadingRatesInKilobytes; }  }
DownloaderStatus { public List<Long> getDownloadingRatesInKilobytes() { if (downloadingRatesInKilobytes.isEmpty() || downloadingRatesInKilobytes.size() < 5) { return downloadingRatesInKilobytes; } if (downloadingRatesInKilobytes.get(downloadingRatesInKilobytes.size() - 1) / (float) 10 > downloadingRatesInKilobytes.get(downloadingRatesInKilobytes.size() - 2)) { if (downloadingRatesInKilobytes.get(downloadingRatesInKilobytes.size() - 1) / (float) 10 > downloadingRatesInKilobytes.get(downloadingRatesInKilobytes.size() - 3)) { return downloadingRatesInKilobytes.subList(0, downloadingRatesInKilobytes.size() - 1); } } return downloadingRatesInKilobytes; }  Long getLastDownloadRate(); String getDownloadRateFormatted(); String getRemainingSizeFormatted(); List<Long> getDownloadingRatesInKilobytes(); }
DownloaderStatus { public List<Long> getDownloadingRatesInKilobytes() { if (downloadingRatesInKilobytes.isEmpty() || downloadingRatesInKilobytes.size() < 5) { return downloadingRatesInKilobytes; } if (downloadingRatesInKilobytes.get(downloadingRatesInKilobytes.size() - 1) / (float) 10 > downloadingRatesInKilobytes.get(downloadingRatesInKilobytes.size() - 2)) { if (downloadingRatesInKilobytes.get(downloadingRatesInKilobytes.size() - 1) / (float) 10 > downloadingRatesInKilobytes.get(downloadingRatesInKilobytes.size() - 3)) { return downloadingRatesInKilobytes.subList(0, downloadingRatesInKilobytes.size() - 1); } } return downloadingRatesInKilobytes; }  Long getLastDownloadRate(); String getDownloadRateFormatted(); String getRemainingSizeFormatted(); List<Long> getDownloadingRatesInKilobytes();  }