@Override public boolean apply(DockerHostLocation input) { Iterable<Entity> deployed = Iterables.filter( Iterables.transform(input.getDockerContainerList(), EntityFunctions.config(DockerContainer.ENTITY.getConfigKey())), Predicates.notNull()); Iterable<Entity> sameParent = Iterables.filter(deployed, EntityPredicates.isChildOf(parent)); if (Iterables.isEmpty(sameParent)) { LOG.debug("No entities with parent {} on {}", parent, input ); return false; } else { LOG.debug("Found entities with parent {} on {}", parent, input ); return true; } } }