### Question:
OSMRelation extends OSMEntity implements Comparable<OSMRelation>, Serializable { @Override public int compareTo(OSMRelation o) { int c = Long.compare(id, o.id); if (c == 0) { c = Integer.compare(Math.abs(version), Math.abs(o.version)); if (c == 0) { c = Long.compare(timestamp.getRawUnixTimestamp(), o.timestamp.getRawUnixTimestamp()); } } return c; } OSMRelation(final long id, final int version, final OSHDBTimestamp timestamp, final long changeset,
      final int userId, final int[] tags, final OSMMember[] members); @Override OSMType getType(); OSMMember[] getMembers(); Stream<OSMEntity> getMemberEntities(OSHDBTimestamp timestamp, Predicate<OSMMember> memberFilter); Stream<OSMEntity> getMemberEntities(OSHDBTimestamp timestamp); @Override int compareTo(OSMRelation o); @Override String toString();  }### Answer:
@Test public void testCompareTo() { OSMMember part = new OSMMember(1L, OSMType.WAY, 1); OSMRelation instance = new OSMRelation(1L, 1, new OSHDBTimestamp(1L), 1L, 1, new int[] {1, 1, 2, 2}, new OSMMember[] {part, part}); OSMRelation o = new OSMRelation(1L, 2, new OSHDBTimestamp(1L), 1L, 1, new int[] {1, 1, 2, 2}, new OSMMember[] {part, part}); assertTrue(instance.compareTo(o) < 0); part = new OSMMember(1L, OSMType.WAY, 1); instance = new OSMRelation(1L, 1, new OSHDBTimestamp(1L), 1L, 1, new int[] {1, 1, 2, 2}, new OSMMember[] {part, part}); o = new OSMRelation(1L, 1, new OSHDBTimestamp(1L), 1L, 1, new int[] {1, 1, 2, 2}, new OSMMember[] {part, part}); assertTrue(instance.compareTo(o) == 0); part = new OSMMember(1L, OSMType.WAY, 1); instance = new OSMRelation(1L, 2, new OSHDBTimestamp(1L), 1L, 1, new int[] {1, 1, 2, 2}, new OSMMember[] {part, part}); o = new OSMRelation(1L, 1, new OSHDBTimestamp(1L), 1L, 1, new int[] {1, 1, 2, 2}, new OSMMember[] {part, part}); assertTrue(instance.compareTo(o) > 0); }