### Question:
ApplyOverlayOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; ApplyOverlayOp other = (ApplyOverlayOp) obj; if (!linkTypes.equals(other.linkTypes)) return false; if (!variantSpan.equals(other.variantSpan)) return false; return true; } ApplyOverlayOp(DataInputStream dis);  ApplyOverlayOp(VariantSpan variantSpan, Set<Integer> linkTypes); @Override byte[] encode(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); final Set<Integer> linkTypes; final VariantSpan variantSpan; }### Answer:
@Test public void equalsTrue() throws Exception { ApplyOverlayOp op1 = new ApplyOverlayOp(new VariantSpan(1, 100), Sets.newHashSet(1, 10)); ApplyOverlayOp op2 = new ApplyOverlayOp(new VariantSpan(1, 100), Sets.newHashSet(1, 10)); assertTrue(op1.equals(op2)); assertTrue(op2.equals(op1)); }
@Test public void equalsVariantsFalse() throws Exception { ApplyOverlayOp op1 = new ApplyOverlayOp(new VariantSpan(1, 100), Sets.newHashSet(1, 10)); ApplyOverlayOp op2 = new ApplyOverlayOp(new VariantSpan(2, 100), Sets.newHashSet(1, 10)); assertFalse(op1.equals(op2)); assertFalse(op2.equals(op1)); }
@Test public void equalsLinkTypesFalse() throws Exception { ApplyOverlayOp op1 = new ApplyOverlayOp(new VariantSpan(1, 100), Sets.newHashSet(1)); ApplyOverlayOp op2 = new ApplyOverlayOp(new VariantSpan(1, 100), Sets.newHashSet(1, 10)); assertFalse(op1.equals(op2)); assertFalse(op2.equals(op1)); }