aspect Pair { class Pair { private F fst; private S snd; public Pair(F fst, S snd) { this.fst = fst; this.snd = snd; } public F fst() { return fst; } public S snd() { return snd; } public boolean equals(Object o) { if(!(o instanceof Pair)) return false; Pair that = (Pair)o; if(this.fst == null) { if(that.fst != null) return false; } else { if(!this.fst.equals(that.fst)) return false; } return this.snd == null ? that.snd == null : this.snd.equals(that.snd); } } }