As2DispositionNotificationOptions { @Override public String toString() { return String.format("%s; %s", getSignedReceiptProtocol(), getSignedReceiptMicalg()); } As2DispositionNotificationOptions(List<Parameter> parameters); static As2DispositionNotificationOptions getDefault(SMimeDigestMethod digestMethod); static As2DispositionNotificationOptions valueOf(String s); List<Parameter> getParameters(); Parameter getSignedReceiptMicalg(); String getPreferredSignedReceiptMicAlgorithmName(); Parameter getSignedReceiptProtocol(); @Override String toString();  }
@Test public void testToString() { As2DispositionNotificationOptions options = As2DispositionNotificationOptions.valueOf("signed-receipt-protocol=required, pkcs7-signature; signed-receipt-micalg=required,sha1"); assertEquals(options.toString(), "signed-receipt-protocol=required,pkcs7-signature; signed-receipt-micalg=required,sha1"); As2DispositionNotificationOptions opt2 = As2DispositionNotificationOptions.valueOf(options.toString()); assertNotNull(opt2); assertEquals(opt2.getSignedReceiptMicalg().getImportance(), As2DispositionNotificationOptions.Importance.REQUIRED); }