@Test
public void testExclusion() throws ClassNotFoundException,
    InstantiationException, IllegalAccessException {

  Interceptor.Builder builder = InterceptorBuilderFactory.newInstance(
      InterceptorType.REGEX_FILTER.toString());
  Context ctx = new Context();
  ctx.put(Constants.REGEX, ".*DEBUG.*");
  ctx.put(Constants.EXCLUDE_EVENTS, "true");
  builder.configure(ctx);
  Interceptor interceptor = builder.build();
  Event shouldPass1 = EventBuilder.withBody("INFO: some message",
      Charsets.UTF_8);
  Assert.assertNotNull(interceptor.intercept(shouldPass1));
  Event shouldPass2 = EventBuilder.withBody("WARNING: some message",
      Charsets.UTF_8);
  Assert.assertNotNull(interceptor.intercept(shouldPass2));
  Event shouldNotPass = EventBuilder.withBody("this message has DEBUG in it",
      Charsets.UTF_8);
  Assert.assertNull(interceptor.intercept(shouldNotPass));
  builder.configure(ctx);
}