String s = formatter.format(g, false);
assertEquals("group: test@example.com, Foo! <foo@example.com>, Foo Bar <foo2@example.com>;", s);
}
public void testMailboxGetEncodedString() throws Exception {
Mailbox m1 = new Mailbox("john.doe", "acme.org");
assertEquals("john.doe@acme.org", formatter.encode(m1));
Mailbox m2 = new Mailbox("john doe", "acme.org");
assertEquals("\"john doe\"@acme.org", formatter.encode(m2));
Mailbox m3 = new Mailbox("John Doe", "john.doe", "acme.org");
assertEquals("John Doe <john.doe@acme.org>", formatter.encode(m3));
Mailbox m4 = new Mailbox("John Doe @Home", "john.doe", "acme.org");
assertEquals("\"John Doe @Home\" <john.doe@acme.org>", formatter.encode(m4));
Mailbox m5 = new Mailbox("Hans M\374ller", "hans.mueller", "acme.org");
assertEquals("=?ISO-8859-1?Q?Hans_M=FCller?= <hans.mueller@acme.org>", formatter.encode(m5));
}