@Test public void testFindLastFinishedDateWithEmptyList() { assertThat(detector.findLastFinishedDate(Collections.<Torrent>emptyList()), equalTo(-1L)); }
public long findLastFinishedDate(Collection<Torrent> torrents) { if (torrents.isEmpty()) return -1; List<Torrent> sortedTorrents = sortByDoneDate(torrents); return sortedTorrents.get(0).getDoneDate(); }
FinishedTorrentsDetector { public long findLastFinishedDate(Collection<Torrent> torrents) { if (torrents.isEmpty()) return -1; List<Torrent> sortedTorrents = sortByDoneDate(torrents); return sortedTorrents.get(0).getDoneDate(); } }
FinishedTorrentsDetector { public long findLastFinishedDate(Collection<Torrent> torrents) { if (torrents.isEmpty()) return -1; List<Torrent> sortedTorrents = sortByDoneDate(torrents); return sortedTorrents.get(0).getDoneDate(); }  }
FinishedTorrentsDetector { public long findLastFinishedDate(Collection<Torrent> torrents) { if (torrents.isEmpty()) return -1; List<Torrent> sortedTorrents = sortByDoneDate(torrents); return sortedTorrents.get(0).getDoneDate(); }  Collection<Torrent> filterFinishedTorrentsToNotify(Collection<Torrent> torrents, Server server); long findLastFinishedDate(Collection<Torrent> torrents); }
FinishedTorrentsDetector { public long findLastFinishedDate(Collection<Torrent> torrents) { if (torrents.isEmpty()) return -1; List<Torrent> sortedTorrents = sortByDoneDate(torrents); return sortedTorrents.get(0).getDoneDate(); }  Collection<Torrent> filterFinishedTorrentsToNotify(Collection<Torrent> torrents, Server server); long findLastFinishedDate(Collection<Torrent> torrents);  }