@Test public void testEqualsWithCreationTime() { Image image1 = createMockImage("2020-06-08", Long.valueOf(1589562459)); Image image2 = createMockImage("2020-06-08", Long.valueOf(1589562459)); assertEquals(0L, underTest.compare(image1, image2)); }
@Override public int compare(Image image1, Image image2) { return image1.getCreated() == null || image2.getCreated() == null ? image1.getDate().compareTo(image2.getDate()) : image1.getCreated().compareTo(image2.getCreated()); }
ImageComparator implements Comparator<Image>, Serializable { @Override public int compare(Image image1, Image image2) { return image1.getCreated() == null || image2.getCreated() == null ? image1.getDate().compareTo(image2.getDate()) : image1.getCreated().compareTo(image2.getCreated()); } }
ImageComparator implements Comparator<Image>, Serializable { @Override public int compare(Image image1, Image image2) { return image1.getCreated() == null || image2.getCreated() == null ? image1.getDate().compareTo(image2.getDate()) : image1.getCreated().compareTo(image2.getCreated()); }  }
ImageComparator implements Comparator<Image>, Serializable { @Override public int compare(Image image1, Image image2) { return image1.getCreated() == null || image2.getCreated() == null ? image1.getDate().compareTo(image2.getDate()) : image1.getCreated().compareTo(image2.getCreated()); }  @Override int compare(Image image1, Image image2); }
ImageComparator implements Comparator<Image>, Serializable { @Override public int compare(Image image1, Image image2) { return image1.getCreated() == null || image2.getCreated() == null ? image1.getDate().compareTo(image2.getDate()) : image1.getCreated().compareTo(image2.getCreated()); }  @Override int compare(Image image1, Image image2);  }