OrFilter implements FilterSet { @Override public DEREncoder getEncoder() { if (filterComponents.size() == 0) { return new NullType(new ContextDERTag(Type.OR.ordinal(), true)); } else { return new ConstructedDEREncoder( new ContextDERTag(Type.OR.ordinal(), true), filterComponents.stream().map(Filter::getEncoder).toArray(DEREncoder[]::new)); } } OrFilter();  OrFilter(final Filter... components); @Override Type getType(); @Override void add(final Filter component); @Override DEREncoder getEncoder(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString();  }
@Test(dataProvider = "component") public void encode(final OrFilter filter, final byte[] berValue) throws Exception { Assert.assertEquals(filter.getEncoder().encode(), berValue); }