PasswordEncodeMetadataFilter extends PasswordMetadataFilter { public PasswordEncodeMetadataFilter withStyle(String s) { setStyle(s); return this; }  String getStyle(); void setStyle(String style); PasswordEncodeMetadataFilter withStyle(String s);  }
@Test public void testFilter() throws Exception { PasswordEncodeMetadataFilter filter = new PasswordEncodeMetadataFilter().withStyle(Password.PORTABLE_PASSWORD) .withPatterns("^.*password.*$"); AdaptrisMessage msg = createMessage(); MetadataCollection filtered = filter.filter(msg); assertEquals(3, filtered.size()); assertEquals("password1", msg.getMetadataValue("passwordKey1")); assertEquals("password2", msg.getMetadataValue("passwordKey2")); assertEquals("value1", msg.getMetadataValue("key1")); assertPasswords(filtered); }