@Test public void testCompareWhenTwoGroupsEqual() { DomainGroupModelView gmv1 = new DomainGroupModelView(1L, "groupz", "Group ZA", 50L, new Date(), 8L); DomainGroupModelView gmv2 = new DomainGroupModelView(2L, "groupz", "Group ZB", 50L, new Date(), 9L); Assert.assertEquals(0, sut.compare(gmv1, gmv2)); }
@Override public int compare(final StreamDTO inA, final StreamDTO inB) { if (inA.getFollowersCount() == inB.getFollowersCount()) { if (inA.getEntityType() == EntityType.GROUP && inB.getEntityType() == EntityType.PERSON) { return -1; } if (inA.getEntityType() == EntityType.PERSON && inB.getEntityType() == EntityType.GROUP) { return 1; } return inA.getUniqueId().compareTo(inB.getUniqueId()); } if (inA.getFollowersCount() > inB.getFollowersCount()) { return -1; } return 1; }
StreamDTOFollowerCountDescendingComparator implements Comparator<StreamDTO> { @Override public int compare(final StreamDTO inA, final StreamDTO inB) { if (inA.getFollowersCount() == inB.getFollowersCount()) { if (inA.getEntityType() == EntityType.GROUP && inB.getEntityType() == EntityType.PERSON) { return -1; } if (inA.getEntityType() == EntityType.PERSON && inB.getEntityType() == EntityType.GROUP) { return 1; } return inA.getUniqueId().compareTo(inB.getUniqueId()); } if (inA.getFollowersCount() > inB.getFollowersCount()) { return -1; } return 1; } }
StreamDTOFollowerCountDescendingComparator implements Comparator<StreamDTO> { @Override public int compare(final StreamDTO inA, final StreamDTO inB) { if (inA.getFollowersCount() == inB.getFollowersCount()) { if (inA.getEntityType() == EntityType.GROUP && inB.getEntityType() == EntityType.PERSON) { return -1; } if (inA.getEntityType() == EntityType.PERSON && inB.getEntityType() == EntityType.GROUP) { return 1; } return inA.getUniqueId().compareTo(inB.getUniqueId()); } if (inA.getFollowersCount() > inB.getFollowersCount()) { return -1; } return 1; }  }
StreamDTOFollowerCountDescendingComparator implements Comparator<StreamDTO> { @Override public int compare(final StreamDTO inA, final StreamDTO inB) { if (inA.getFollowersCount() == inB.getFollowersCount()) { if (inA.getEntityType() == EntityType.GROUP && inB.getEntityType() == EntityType.PERSON) { return -1; } if (inA.getEntityType() == EntityType.PERSON && inB.getEntityType() == EntityType.GROUP) { return 1; } return inA.getUniqueId().compareTo(inB.getUniqueId()); } if (inA.getFollowersCount() > inB.getFollowersCount()) { return -1; } return 1; }  @Override int compare(final StreamDTO inA, final StreamDTO inB); }
StreamDTOFollowerCountDescendingComparator implements Comparator<StreamDTO> { @Override public int compare(final StreamDTO inA, final StreamDTO inB) { if (inA.getFollowersCount() == inB.getFollowersCount()) { if (inA.getEntityType() == EntityType.GROUP && inB.getEntityType() == EntityType.PERSON) { return -1; } if (inA.getEntityType() == EntityType.PERSON && inB.getEntityType() == EntityType.GROUP) { return 1; } return inA.getUniqueId().compareTo(inB.getUniqueId()); } if (inA.getFollowersCount() > inB.getFollowersCount()) { return -1; } return 1; }  @Override int compare(final StreamDTO inA, final StreamDTO inB);  }