    @Test
    public void testFormat_pretty() {

        OptionalFields credentials = OptionalFields
                .builder()
                .setStringValue("username")
                .setBinaryValue(Binary.fromBase64("password"))
                .build();

        LogFormatter formatter = new LogFormatter(true, (writer, field, value) -> {
            if (field.getName()
                     .contains("binary")) {
                writer.append("\"********\"");
                return true;
            }
            return false;
        });

        assertThat(formatter.format(credentials),
                   is("providence.OptionalFields {\n" +
                      "  stringValue = \"username\"\n" +
                      "  binaryValue = \"********\"\n" +
                      "}"));
    }