@Test(expected = ClassCastException.class)
public void testStandAloneEntityManagerDispose() {

    // GIVEN
    final EntityManagerProducerProxy producer = new EntityManagerProducerProxy(delegate);
    // WHEN
    producer.dispose(mock(EntityManager.class));
    // THEN
    // ClassCastException is thrown. Given object has not been produced by this producer
}