### Question:
F2SEvent implements Serializable { @Override public String toString() { ToStringBuilder toStringBuilder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("headers", headers); String bodyStr = StringUtils.toEncodedString(body, F2SEventFactory.DEFAULT_CHARACTER_SET); if (StringUtils.isAsciiPrintable(bodyStr)) { toStringBuilder.append("body", bodyStr); } else { toStringBuilder.append(Hex.encodeHexString(body)); } return toStringBuilder.toString(); } F2SEvent();  F2SEvent(Map<String, String> headers, byte[] body);  F2SEvent(F2SEvent event); byte[] getBody(); Map<String, String> getHeaders(); String getHeader(String key); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }### Answer:
@Test public void testToString() { Map<String, String> headers = ImmutableMap.of("K1", "v1", "k2", "v2"); String bodyStr = "Test string 1234"; System.out.println(new F2SEvent(headers, bodyStr.getBytes()).toString()); assertThat(new F2SEvent(headers, bodyStr.getBytes()).toString()).contains(bodyStr); byte[] data = Arrays.copyOf(bodyStr.getBytes(), bodyStr.length() + 1); System.out.println(new F2SEvent(headers, data).toString()); assertThat(new F2SEvent(headers, data).toString()).doesNotContain(bodyStr); }