@Test public void testEquals() { new EqualsTester() .addEqualityGroup(packet1, sameAsPacket1) .addEqualityGroup(packet2, sameAsPacket2) .testEquals(); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof InboundPacket) { final DefaultInboundPacket other = (DefaultInboundPacket) obj; return Objects.equals(this.receivedFrom, other.receivedFrom) && Objects.equals(this.parsed, other.parsed) && Objects.equals(this.unparsed, other.unparsed); } return false; }
DefaultInboundPacket implements InboundPacket { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof InboundPacket) { final DefaultInboundPacket other = (DefaultInboundPacket) obj; return Objects.equals(this.receivedFrom, other.receivedFrom) && Objects.equals(this.parsed, other.parsed) && Objects.equals(this.unparsed, other.unparsed); } return false; } }
DefaultInboundPacket implements InboundPacket { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof InboundPacket) { final DefaultInboundPacket other = (DefaultInboundPacket) obj; return Objects.equals(this.receivedFrom, other.receivedFrom) && Objects.equals(this.parsed, other.parsed) && Objects.equals(this.unparsed, other.unparsed); } return false; } DefaultInboundPacket(ConnectPoint receivedFrom, Ethernet parsed,
                                ByteBuffer unparsed);  DefaultInboundPacket(ConnectPoint receivedFrom, Ethernet parsed,
            ByteBuffer unparsed, Optional<Long> cookie); }
DefaultInboundPacket implements InboundPacket { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof InboundPacket) { final DefaultInboundPacket other = (DefaultInboundPacket) obj; return Objects.equals(this.receivedFrom, other.receivedFrom) && Objects.equals(this.parsed, other.parsed) && Objects.equals(this.unparsed, other.unparsed); } return false; } DefaultInboundPacket(ConnectPoint receivedFrom, Ethernet parsed,
                                ByteBuffer unparsed);  DefaultInboundPacket(ConnectPoint receivedFrom, Ethernet parsed,
            ByteBuffer unparsed, Optional<Long> cookie); @Override ConnectPoint receivedFrom(); @Override Ethernet parsed(); @Override ByteBuffer unparsed(); @Override Optional<Long> cookie(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
DefaultInboundPacket implements InboundPacket { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof InboundPacket) { final DefaultInboundPacket other = (DefaultInboundPacket) obj; return Objects.equals(this.receivedFrom, other.receivedFrom) && Objects.equals(this.parsed, other.parsed) && Objects.equals(this.unparsed, other.unparsed); } return false; } DefaultInboundPacket(ConnectPoint receivedFrom, Ethernet parsed,
                                ByteBuffer unparsed);  DefaultInboundPacket(ConnectPoint receivedFrom, Ethernet parsed,
            ByteBuffer unparsed, Optional<Long> cookie); @Override ConnectPoint receivedFrom(); @Override Ethernet parsed(); @Override ByteBuffer unparsed(); @Override Optional<Long> cookie(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }