@Test public void testEquals() { new EqualsTester() .addEqualityGroup( UdpApplication.ALL, new UdpApplication(ImmutableList.of(new SubRange(0, PortsApplication.MAX_PORT_NUMBER)))) .addEqualityGroup( new UdpApplication(80), new UdpApplication(ImmutableList.of(SubRange.singleton(80)))) .addEqualityGroup(new UdpApplication(ImmutableList.of(new SubRange(0, 80)))) .addEqualityGroup(new UdpApplication(ImmutableList.of(new SubRange(80, 0)))) .addEqualityGroup( new UdpApplication(ImmutableList.of(SubRange.singleton(0), SubRange.singleton(80)))) .addEqualityGroup(new TcpApplication(ImmutableList.of(new SubRange(0, 80)))) .testEquals(); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof UdpApplication)) { return false; } UdpApplication that = (UdpApplication) o; return Objects.equals(_ports, that._ports); }
UdpApplication extends PortsApplication { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof UdpApplication)) { return false; } UdpApplication that = (UdpApplication) o; return Objects.equals(_ports, that._ports); } }
UdpApplication extends PortsApplication { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof UdpApplication)) { return false; } UdpApplication that = (UdpApplication) o; return Objects.equals(_ports, that._ports); } UdpApplication(List<SubRange> ports);  UdpApplication(int port); }
UdpApplication extends PortsApplication { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof UdpApplication)) { return false; } UdpApplication that = (UdpApplication) o; return Objects.equals(_ports, that._ports); } UdpApplication(List<SubRange> ports);  UdpApplication(int port); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); @Override T accept(ApplicationVisitor<T> visitor); }
UdpApplication extends PortsApplication { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof UdpApplication)) { return false; } UdpApplication that = (UdpApplication) o; return Objects.equals(_ports, that._ports); } UdpApplication(List<SubRange> ports);  UdpApplication(int port); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); @Override T accept(ApplicationVisitor<T> visitor); static final UdpApplication ALL; }