@Test
public void testGetInstanceForSameTypeLeadsToExecutionOfProcessBeforeAllOnlyOnce() throws Exception {

    // GIVEN
    // WHEN
    final ClassA obj1 = factory.getInstance(ClassA.class);
    final ClassA obj2 = factory.getInstance(ClassA.class);
    // THEN
    assertNotNull(obj1);
    assertNotNull(obj2);
    final ArgumentCaptor<TestInvocation> invocationCaptor = ArgumentCaptor.forClass(TestInvocation.class);
    verify(executor).processBeforeAll(invocationCaptor.capture());
    final TestInvocation invocation = invocationCaptor.getValue();
    assertThat(invocation.getTestClass(), equalTo(ClassA.class));
    assertThat(invocation.getContext(), equalTo(ctx));
    assertThat(invocation.getFeatureResolver(), notNullValue());
    verifyNoMoreInteractions(executor);
}