PersistentSearchRequestControl extends AbstractControl implements RequestControl { @Override public byte[] encode() { int types = 0; for (PersistentSearchChangeType type : getChangeTypes()) { types |= type.value(); } final ConstructedDEREncoder se = new ConstructedDEREncoder( UniversalDERTag.SEQ, new IntegerType(types), new BooleanType(getChangesOnly()), new BooleanType(getReturnEcs())); return se.encode(); } PersistentSearchRequestControl();  PersistentSearchRequestControl(final EnumSet<PersistentSearchChangeType> types);  PersistentSearchRequestControl(final EnumSet<PersistentSearchChangeType> types, final boolean critical);  PersistentSearchRequestControl(
    final EnumSet<PersistentSearchChangeType> types,
    final boolean co,
    final boolean re);  PersistentSearchRequestControl(
    final EnumSet<PersistentSearchChangeType> types,
    final boolean co,
    final boolean re,
    final boolean critical); @Override boolean hasValue(); EnumSet<PersistentSearchChangeType> getChangeTypes(); void setChangeTypes(final EnumSet<PersistentSearchChangeType> types); boolean getChangesOnly(); void setChangesOnly(final boolean b); boolean getReturnEcs(); void setReturnEcs(final boolean b); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); @Override byte[] encode(); static final String OID; }
@Test(groups = "control", dataProvider = "request") public void encode(final byte[] berValue, final PersistentSearchRequestControl expected) throws Exception { Assert.assertEquals(expected.encode(), berValue); }