PasswordExpiringControl extends AbstractControl implements ResponseControl { @Override public void decode(final DERBuffer encoded) { final String time = OctetStringType.decode(encoded); setTimeBeforeExpiration(Integer.valueOf(time)); } PasswordExpiringControl();  PasswordExpiringControl(final boolean critical);  PasswordExpiringControl(final int time);  PasswordExpiringControl(final int time, final boolean critical); int getTimeBeforeExpiration(); void setTimeBeforeExpiration(final int time); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); @Override void decode(final DERBuffer encoded); static final String OID; }
@Test(groups = "control", dataProvider = "response") public void decode(final DERBuffer berValue, final PasswordExpiringControl expected) throws Exception { final PasswordExpiringControl actual = new PasswordExpiringControl(expected.getCriticality()); actual.decode(berValue); Assert.assertEquals(actual, expected); }