@Test public void testExpandBindings() throws Exception { assertEquals(2, Search.expandBindings(getBindings("127.0.0.5/24"), 2).size()); assertEquals(1, Search.expandBindings(getBindings("127.0.0.5/32"), 20).size()); assertEquals(21, Search.expandBindings(getBindings("127.0.0.5/32", "8.8.8.8/24"), 20).size()); }
public static <T extends SxpBindingFields> List<T> expandBindings(List<T> bindings, int quantity) { if (quantity > 0 && bindings != null && !bindings.isEmpty()) { List<T> toAdd = new ArrayList<>(); bindings.removeIf(b -> { int len = IpPrefixConv.getPrefixLength(b.getIpPrefix()); return (len != 32 && len != 128) && toAdd.addAll(expandBinding(b, quantity)); }); bindings.addAll(toAdd); } return bindings; }
Search { public static <T extends SxpBindingFields> List<T> expandBindings(List<T> bindings, int quantity) { if (quantity > 0 && bindings != null && !bindings.isEmpty()) { List<T> toAdd = new ArrayList<>(); bindings.removeIf(b -> { int len = IpPrefixConv.getPrefixLength(b.getIpPrefix()); return (len != 32 && len != 128) && toAdd.addAll(expandBinding(b, quantity)); }); bindings.addAll(toAdd); } return bindings; } }
Search { public static <T extends SxpBindingFields> List<T> expandBindings(List<T> bindings, int quantity) { if (quantity > 0 && bindings != null && !bindings.isEmpty()) { List<T> toAdd = new ArrayList<>(); bindings.removeIf(b -> { int len = IpPrefixConv.getPrefixLength(b.getIpPrefix()); return (len != 32 && len != 128) && toAdd.addAll(expandBinding(b, quantity)); }); bindings.addAll(toAdd); } return bindings; } private  Search(); }
Search { public static <T extends SxpBindingFields> List<T> expandBindings(List<T> bindings, int quantity) { if (quantity > 0 && bindings != null && !bindings.isEmpty()) { List<T> toAdd = new ArrayList<>(); bindings.removeIf(b -> { int len = IpPrefixConv.getPrefixLength(b.getIpPrefix()); return (len != 32 && len != 128) && toAdd.addAll(expandBinding(b, quantity)); }); bindings.addAll(toAdd); } return bindings; } private  Search(); static InetAddress getBestLocalDeviceAddress(); static List<T> expandBindings(List<T> bindings, int quantity); static List<T> expandBinding(T binding, int quantity); static Stream<InetAddress> expandPrefix(final IpPrefix prefix); static Stream<InetAddress> expandPrefix(final IpPrefix prefix, final long limit); static String getAddress(
            org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress address); }
Search { public static <T extends SxpBindingFields> List<T> expandBindings(List<T> bindings, int quantity) { if (quantity > 0 && bindings != null && !bindings.isEmpty()) { List<T> toAdd = new ArrayList<>(); bindings.removeIf(b -> { int len = IpPrefixConv.getPrefixLength(b.getIpPrefix()); return (len != 32 && len != 128) && toAdd.addAll(expandBinding(b, quantity)); }); bindings.addAll(toAdd); } return bindings; } private  Search(); static InetAddress getBestLocalDeviceAddress(); static List<T> expandBindings(List<T> bindings, int quantity); static List<T> expandBinding(T binding, int quantity); static Stream<InetAddress> expandPrefix(final IpPrefix prefix); static Stream<InetAddress> expandPrefix(final IpPrefix prefix, final long limit); static String getAddress(
            org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress address);  }