@Test
public void testClobber() throws Exception {

  Context ctx = new Context();
  ctx.put("preserveExisting", "false"); // default behavior
  Interceptor.Builder builder = InterceptorBuilderFactory
          .newInstance(InterceptorType.HOST.toString());
  builder.configure(ctx);
  Interceptor interceptor = builder.build();
  final String ORIGINAL_HOST = "originalhost";
  Event eventBeforeIntercept = EventBuilder.withBody("test event",
          Charsets.UTF_8);
  eventBeforeIntercept.getHeaders().put(Constants.HOST, ORIGINAL_HOST);
  Assert.assertEquals(ORIGINAL_HOST, eventBeforeIntercept.getHeaders()
          .get(Constants.HOST));
  String expectedHost = InetAddress.getLocalHost().getHostAddress();
  Event eventAfterIntercept = interceptor.intercept(eventBeforeIntercept);
  String actualHost = eventAfterIntercept.getHeaders().get(Constants.HOST);
  Assert.assertNotNull(actualHost);
  Assert.assertEquals(expectedHost, actualHost);
}