@SuppressWarnings({ "unchecked", "rawtypes" })

@Test
public void testPersistWithPersistenceDisabled() throws Exception {
    doReturn(false).when(mockDelegateProvider).isRecoveryApplicable();
    provider.persist(mockPersistentLogEntry, mockProcedure);
    ArgumentCaptor<Procedure> procedureCaptor = ArgumentCaptor.forClass(Procedure.class);
    verify(mockPersistentProvider).persist(eq(PERSISTENT_PAYLOAD), procedureCaptor.capture());
    verify(mockDelegateProvider, never()).persist(mockNonPersistentLogEntry, mockProcedure);
    procedureCaptor.getValue().apply(PERSISTENT_PAYLOAD);
    verify(mockProcedure).apply(mockPersistentLogEntry);
    provider.persist(mockNonPersistentLogEntry, mockProcedure);
    verify(mockDelegateProvider).persist(mockNonPersistentLogEntry, mockProcedure);
    provider.persist(OTHER_DATA_OBJECT, mockProcedure);
    verify(mockDelegateProvider).persist(OTHER_DATA_OBJECT, mockProcedure);
}