Attachment { static String encodeRFC2231(String key, String value) { StringBuilder buf = new StringBuilder(); boolean encoded = encodeRFC2231value(value, buf); if (encoded) { return "; " + key + "*=" + buf.toString(); } else { return "; " + key + "=" + value; } } private  Attachment();   }
@Test public void shouldEncodeRFC2231() throws Exception { assertThat(encodeRFC2231("key", "value")).isEqualTo("; key=value"); assertThat(encodeRFC2231("key", "\"*über*")).isEqualTo("; key*=UTF-8''%22%2A%C3%BCber%2A"); }