HostInterfaces implements Serializable { public Set<HostInterfaceModel> filterByName( final String pattern ) { Preconditions.checkNotNull( pattern ); return Sets.filter( interfaces, new Predicate<HostInterfaceModel>() { @Override public boolean apply( final HostInterfaceModel intf ) { return intf.getName().matches( pattern ); } } ); } HostInterfaces( @JsonProperty( "hostId" ) final String hostId,
                           @JsonProperty( "interfaces" ) final Set<HostInterfaceModel> interfaces );  HostInterfaces(); String getHostId(); HostInterfaceModel findByIp( final String ip ); HostInterfaceModel findByName( final String name ); Set<HostInterfaceModel> filterByIp( final String pattern ); Set<HostInterfaceModel> filterByName( final String pattern ); int size(); void addHostInterface( final HostInterfaceModel hostInterfaceModel ); @JsonIgnore Set<HostInterfaceModel> getAll(); @Override String toString();  }
@Test public void testFilterByName() { Set<HostInterfaceModel> ifaces = hostInterfaces.filterByName( Common.DEFAULT_CONTAINER_INTERFACE ); assertFalse( ifaces.isEmpty() ); }