public int compare( Object aa, Object bb ) { Entity a = (Entity)aa; Entity b = (Entity)bb;
public int compare( Entity a, Entity b ) {
                public int compare( Object aa, Object bb ) {                    Entity a = (Entity)aa;                    Entity b = (Entity)bb;                    Player p_a = a.getOwner();                    Player p_b = b.getOwner();                    int t_a = p_a.getTeam();                    int t_b = p_b.getTeam();                    if (p_a.equals(client.getLocalPlayer()) &&                        !p_b.equals(client.getLocalPlayer())) {                        return -1;                    } else if (p_b.equals(client.getLocalPlayer()) &&                               !p_a.equals(client.getLocalPlayer())) {                        return 1;                    } else if (t_a == client.getLocalPlayer().getTeam()                               && t_b != client.getLocalPlayer().getTeam()) {                        return -1;                    } else if (t_b == client.getLocalPlayer().getTeam()                               && t_a != client.getLocalPlayer().getTeam()) {                        return 1;                    } else if (t_a != t_b) {                        return t_a - t_b;                    } else if (!p_a.equals(p_b)) {                        return p_a.getName().compareTo(p_b.getName());                    } else {                        return a.getId() - b.getId();                    }                }