### Question:
RankUser implements Comparable { @Override public int compareTo(Object o) { if ( o instanceof RankUser ) { RankUser other = (RankUser)o; if ( this.rank != other.rank ) { return this.rank - other.rank; } else { if ( this.score != other.score ) { return other.score - this.score; } else { if ( this.rankChange != other.rankChange ) { return other.rankChange - this.rankChange; } else { if ( this.basicUser != null && this.basicUser.getUsername() != null && other.basicUser != null ) { return this.basicUser.getUsername().compareTo( other.basicUser.getUsername()); } else { return 0; } } } } } return -1; }  int getRank(); void setRank(int rank); int getScore(); void setScore(int score); int getRankChange(); void setRankChange(int rankChange); BasicUser getBasicUser(); void setBasicUser(BasicUser basicUser); ArrangeInfo toArrangeInfo(RankScoreType scoreType); BseMyRankInfo toBseMyRankInfo(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); @Override int compareTo(Object o);  }### Answer:
@Test public void testCompareTo() { Random random = new Random(); RankUser[] rankUsers = new RankUser[5]; Set<RankUser> sortUsers = new TreeSet<RankUser>(); for ( int i=0; i<rankUsers.length; i++ ) { rankUsers[i] = new RankUser(); rankUsers[i].setRank(random.nextInt(10)); rankUsers[i].setScore(random.nextInt(10000)); rankUsers[i].setRankChange(random.nextInt(10)); rankUsers[i].setBasicUser(new BasicUser()); sortUsers.add(rankUsers[i]); } for ( RankUser r : sortUsers ) { System.out.println(r); } assertTrue("Not yet implemented", true); }