@Test public void compareToTest() { Objective o1 = new Objective("obj1", Sign.MAX); Objective o11 = new Objective("obj1", Sign.MAX); Objective o2 = new Objective("obj2", Sign.MAX); Assert.assertEquals(0, o1.compareTo(o11)); Assert.assertEquals(-1 * o1.compareTo(o2), o2.compareTo(o1)); Assert.assertEquals(1, o1.compareTo(null)); }
@Override public int compareTo(Objective other) { if (this.equals(other)) { return 0; } else if (other == null) { return 1; } else { return this.getName().compareTo(other.getName()); } }
Objective implements Comparable<Objective> { @Override public int compareTo(Objective other) { if (this.equals(other)) { return 0; } else if (other == null) { return 1; } else { return this.getName().compareTo(other.getName()); } } }
Objective implements Comparable<Objective> { @Override public int compareTo(Objective other) { if (this.equals(other)) { return 0; } else if (other == null) { return 1; } else { return this.getName().compareTo(other.getName()); } } Objective(String name);  Objective(String name, Sign sign); }
Objective implements Comparable<Objective> { @Override public int compareTo(Objective other) { if (this.equals(other)) { return 0; } else if (other == null) { return 1; } else { return this.getName().compareTo(other.getName()); } } Objective(String name);  Objective(String name, Sign sign); Sign getSign(); String getName(); @Override int compareTo(Objective other); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); }
Objective implements Comparable<Objective> { @Override public int compareTo(Objective other) { if (this.equals(other)) { return 0; } else if (other == null) { return 1; } else { return this.getName().compareTo(other.getName()); } } Objective(String name);  Objective(String name, Sign sign); Sign getSign(); String getName(); @Override int compareTo(Objective other); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); static final Value<?> INFEASIBLE; }