OverviewPredicate implements Predicate<Metacard> { @Override public boolean test(Metacard metacard) { final Attribute derivedResourceUris = metacard.getAttribute(Core.DERIVED_RESOURCE_URI); if (derivedResourceUris != null) { return derivedResourceUris.getValues().stream() .map(Objects::toString) .anyMatch(isDerivedResourceOverviewUri); } return false; }  @Override boolean test(Metacard metacard);  }
@Test public void testOverview() { final Metacard metacard = new MetacardImpl(); metacard.setAttribute(new AttributeImpl(Core.DERIVED_RESOURCE_URI, "content:abc123#overview")); assertThat(predicate.test(metacard), is(true)); }
@Test public void testNoDerivedResourceUris() { assertThat(predicate.test(new MetacardImpl()), is(false)); }
@Test public void testNoOverview() { final Metacard metacard = new MetacardImpl(); metacard.setAttribute(new AttributeImpl(Core.DERIVED_RESOURCE_URI, "content:abc123")); assertThat(predicate.test(metacard), is(false)); }