ScreenshotService { void sortScreenshotBySequence(List<Screenshot> screenshots) { Collections.sort(screenshots, new Comparator<Screenshot>() { @Override public int compare(Screenshot o1, Screenshot o2) { return NullSafeComparator.NULLS_HIGH.compare(o1.getSequence(), o2.getSequence()); } }); }  @Transactional ScreenshotRun createOrUpdateScreenshotRun(ScreenshotRun screenshotRun, boolean setLastSuccessfulScreenshotRun); @Transactional List<Screenshot> searchScreenshots(
            List<Long> repositoryIds,
            List<String> bcp47Tags,
            String screenshotName,
            Screenshot.Status status,
            String name,
            String source,
            String target,
            SearchType searchType,
            ScreenshotRunType screenshotRunType, int offset, int limit); Map<Long, Set<Screenshot>> getScreenshotsByTmTextUnitId(Set<Long> tmTextUnitIds); void updateScreenshot(Screenshot screenshot);  }
@Test public void testSortScreenshotBySequence() { List<Screenshot> screenshots = new ArrayList<>(); Screenshot screen1 = new Screenshot(); screen1.setSequence(1L); screenshots.add(screen1); Screenshot screen2 = new Screenshot(); screen2.setSequence(10L); screenshots.add(screen2); Screenshot screen3 = new Screenshot(); screen3.setSequence(5L); screenshots.add(screen3); screenshotService.sortScreenshotBySequence(screenshots); assertEquals(screen1, screenshots.get(0)); assertEquals(screen3, screenshots.get(1)); assertEquals(screen2, screenshots.get(2)); }