@Override public int compare(ServerType s1, ServerType s2) { int res = Double.compare(s1.getEfficiency(), s2.getEfficiency()); if (res != 0) return res; return Integer.compare(s1.getCapacity(), s2.getCapacity()); // TODO reverse? }
@Override public int compare(ServerType s1, ServerType s2) { return Integer.compare(s1.getCapacity(), s2.getCapacity()); }