@Test public void testAclIpSpace_fourIps() { Ip ip1 = Ip.parse("1.0.0.0"); Ip ip2 = Ip.parse("0.1.0.0"); Ip ip3 = Ip.parse("0.0.1.0"); Ip ip4 = Ip.parse("0.0.0.3"); IpSpace ipSpace = AclIpSpace.builder() .thenPermitting(ip1.toIpSpace()) .thenPermitting(ip2.toIpSpace()) .thenPermitting(ip3.toIpSpace()) .thenPermitting(ip4.toIpSpace()) .build(); Optional<Ip> representative = _ipSpaceRepresentative.getRepresentative(ipSpace); assertTrue("no representative", representative.isPresent()); assertThat(representative.get(), Matchers.oneOf(ip1, ip2, ip3, ip4)); }
public Optional<Ip> getRepresentative(IpSpace ipSpace) { return _ipSpaceToBDD .getBDDInteger() .getValueSatisfying(_ipSpaceToBDD.visit(ipSpace)) .map(Ip::create); }
IpSpaceRepresentative { public Optional<Ip> getRepresentative(IpSpace ipSpace) { return _ipSpaceToBDD .getBDDInteger() .getValueSatisfying(_ipSpaceToBDD.visit(ipSpace)) .map(Ip::create); } }
IpSpaceRepresentative { public Optional<Ip> getRepresentative(IpSpace ipSpace) { return _ipSpaceToBDD .getBDDInteger() .getValueSatisfying(_ipSpaceToBDD.visit(ipSpace)) .map(Ip::create); } IpSpaceRepresentative(); }
IpSpaceRepresentative { public Optional<Ip> getRepresentative(IpSpace ipSpace) { return _ipSpaceToBDD .getBDDInteger() .getValueSatisfying(_ipSpaceToBDD.visit(ipSpace)) .map(Ip::create); } IpSpaceRepresentative(); Optional<Ip> getRepresentative(IpSpace ipSpace); }
IpSpaceRepresentative { public Optional<Ip> getRepresentative(IpSpace ipSpace) { return _ipSpaceToBDD .getBDDInteger() .getValueSatisfying(_ipSpaceToBDD.visit(ipSpace)) .map(Ip::create); } IpSpaceRepresentative(); Optional<Ip> getRepresentative(IpSpace ipSpace);  }