@Test
public void testRemoveContextListener() {

    System.out.println("removeContextListener");
    TestContextListener<Foo> fooContextListener = new TestContextListener<>();
    context.addContextListener(Foo.class, fooContextListener);
    TestContextListener<MyCustomFoo> myCustomFooContextListener = new TestContextListener<>();
    context.addContextListener(MyCustomFoo.class, myCustomFooContextListener);
    TestContextListener<AbstractFoo> abstractFooContextListener = new TestContextListener<>();
    context.addContextListener(AbstractFoo.class, abstractFooContextListener);
    TestContextListener<Object> objectContextListener = new TestContextListener<>();
    context.addContextListener(Object.class, objectContextListener);
    TestContextListener<Date> dateContextListener = new TestContextListener<>();
    context.addContextListener(Date.class, dateContextListener);
    context.removeContextListener(Foo.class, fooContextListener);
    context.removeContextListener(MyCustomFoo.class, myCustomFooContextListener);
    context.removeContextListener(AbstractFoo.class, abstractFooContextListener);
    context.removeContextListener(Object.class, objectContextListener);
    context.removeContextListener(Date.class, dateContextListener);
    SimpleContextContent content1 = new SimpleContextContent();
    SimpleContext context1 = new SimpleContext(content1);
    context.addContext(context1);
    Foo foo1 = new MyCustomFoo();
    content1.add(foo1);
    assertFalse(fooContextListener.isContextChanged());
    assertFalse(myCustomFooContextListener.isContextChanged());
    assertFalse(abstractFooContextListener.isContextChanged());
    assertFalse(objectContextListener.isContextChanged());
    assertFalse(dateContextListener.isContextChanged());
    context.removeContext(context1);
    assertFalse(fooContextListener.isContextChanged());
    assertFalse(myCustomFooContextListener.isContextChanged());
    assertFalse(abstractFooContextListener.isContextChanged());
    assertFalse(objectContextListener.isContextChanged());
    assertFalse(dateContextListener.isContextChanged());
    content1.remove(foo1);
    assertFalse(fooContextListener.isContextChanged());
    assertFalse(myCustomFooContextListener.isContextChanged());
    assertFalse(abstractFooContextListener.isContextChanged());
    assertFalse(objectContextListener.isContextChanged());
    assertFalse(dateContextListener.isContextChanged());
}