@Override public boolean equals(Object obj) { if (!(obj instanceof KD)) { return false; } KD kd = (KD) obj; return k == kd.getK() && d == kd.getD(); }
@Override public int compareTo(KD other) { if (other.getK() > k) { return 1; } else if (other.getK() < k) { return -1; } else if (other.getD() > d) { return 1; } else if (other.getD() < d) { return -1; } return 0; }
void testCase(String lkd) throws ParseException { KD.parse(lkd); }