@Test public void testHeaders() { Map<String, String> headers = new HashMap<String, String>(); headers.put("one", "1"); headers.put("two", "2"); Event e1 = EventBuilder.withBody("e1".getBytes(), headers); Assert.assertNotNull(e1); Assert.assertArrayEquals("e1 has the proper body", "e1".getBytes(), e1.getBody()); Assert.assertEquals("e1 has the proper headers", 2, e1.getHeaders().size()); Assert.assertEquals("e1 has a one key", "1", e1.getHeaders().get("one")); }
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);  }