@Test public void testBody() { Event e1 = EventBuilder.withBody("e1".getBytes()); Assert.assertNotNull(e1); Assert.assertArrayEquals("body is correct", "e1".getBytes(), e1.getBody()); Event e2 = EventBuilder.withBody(Long.valueOf(2).toString().getBytes()); Assert.assertNotNull(e2); Assert.assertArrayEquals("body is correct", Long.valueOf(2L).toString() .getBytes(), e2.getBody()); }
public static Event withBody(byte[] body, Map<String, String> headers) { Event event = new SimpleEvent(); if(body == null) { body = new byte[0]; } event.setBody(body); if (headers != null) { event.setHeaders(new HashMap<String, String>(headers)); } return event; }
EventBuilder { public static Event withBody(byte[] body, Map<String, String> headers) { Event event = new SimpleEvent(); if(body == null) { body = new byte[0]; } event.setBody(body); if (headers != null) { event.setHeaders(new HashMap<String, String>(headers)); } return event; } }
EventBuilder { public static Event withBody(byte[] body, Map<String, String> headers) { Event event = new SimpleEvent(); if(body == null) { body = new byte[0]; } event.setBody(body); if (headers != null) { event.setHeaders(new HashMap<String, String>(headers)); } return event; }  }
EventBuilder { public static Event withBody(byte[] body, Map<String, String> headers) { Event event = new SimpleEvent(); if(body == null) { body = new byte[0]; } event.setBody(body); if (headers != null) { event.setHeaders(new HashMap<String, String>(headers)); } return event; }  static Event withBody(byte[] body, Map<String, String> headers); static Event withBody(byte[] body); static Event withBody(String body, Charset charset,
      Map<String, String> headers); static Event withBody(String body, Charset charset); }
EventBuilder { public static Event withBody(byte[] body, Map<String, String> headers) { Event event = new SimpleEvent(); if(body == null) { body = new byte[0]; } event.setBody(body); if (headers != null) { event.setHeaders(new HashMap<String, String>(headers)); } return event; }  static Event withBody(byte[] body, Map<String, String> headers); static Event withBody(byte[] body); static Event withBody(String body, Charset charset,
      Map<String, String> headers); static Event withBody(String body, Charset charset);  }