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