class Context implements IContext<TEntity> {

    public void OnEntityCreated(ContextEntityChanged listener) {
        if (OnEntityCreated != null) {
            OnEntityCreated = EntitasCollections.createSet(ContextEntityChanged.class);
        }
        OnEntityCreated.add(listener);
    }

}

class ContextTest {

    @Rule
    public ExpectedException exception;
    private TestContext context;
    private TestEntity entity;

    @Test
    public void OnEntityCreatedTest() {

        context.OnEntityCreated((context, e) -> assertTrue(e.isEnabled()));
        entity = context.createEntity();
    }

}