@Test public void testEqualToPredicateInitWithOnlyAttrName(){ Attribute.Name attributeName = Attribute.Name.valueOf("test-attr"); EqualToPredicate equalToPredicate = new EqualToPredicate(attributeName); Collection<Attribute> attributes = Collections.emptyList(); assertFalse(equalToPredicate.apply(attributes)); }
@Override public boolean apply(Collection<Attribute> attributes) { return Objects.nonNull(attributeName) && Objects.nonNull(value) && attributes.stream() .anyMatch(attr -> attr.getName().equals(attributeName) && value.equals(attr.getValue(value.getClass())) ); }
EqualToPredicate implements StreamPredicate { @Override public boolean apply(Collection<Attribute> attributes) { return Objects.nonNull(attributeName) && Objects.nonNull(value) && attributes.stream() .anyMatch(attr -> attr.getName().equals(attributeName) && value.equals(attr.getValue(value.getClass())) ); } }
EqualToPredicate implements StreamPredicate { @Override public boolean apply(Collection<Attribute> attributes) { return Objects.nonNull(attributeName) && Objects.nonNull(value) && attributes.stream() .anyMatch(attr -> attr.getName().equals(attributeName) && value.equals(attr.getValue(value.getClass())) ); } EqualToPredicate();  EqualToPredicate(Attribute.Name attributeName);   EqualToPredicate(Attribute.Name attributeName, Object value); }
EqualToPredicate implements StreamPredicate { @Override public boolean apply(Collection<Attribute> attributes) { return Objects.nonNull(attributeName) && Objects.nonNull(value) && attributes.stream() .anyMatch(attr -> attr.getName().equals(attributeName) && value.equals(attr.getValue(value.getClass())) ); } EqualToPredicate();  EqualToPredicate(Attribute.Name attributeName);   EqualToPredicate(Attribute.Name attributeName, Object value); @Override boolean apply(Collection<Attribute> attributes); }
EqualToPredicate implements StreamPredicate { @Override public boolean apply(Collection<Attribute> attributes) { return Objects.nonNull(attributeName) && Objects.nonNull(value) && attributes.stream() .anyMatch(attr -> attr.getName().equals(attributeName) && value.equals(attr.getValue(value.getClass())) ); } EqualToPredicate();  EqualToPredicate(Attribute.Name attributeName);   EqualToPredicate(Attribute.Name attributeName, Object value); @Override boolean apply(Collection<Attribute> attributes);  }