Buggy code:
public class TestDataCacheBehavesIdentical extends AbstractTestCase { private static OpenJPAEntityManagerFactorySPI emfWithDataCache ; private static OpenJPAEntityManagerFactorySPI emfWithoutDataCache ; private static final boolean WITH_DATACACHE = true ; private static final boolean CONSISTENT = true ; private static final boolean DIRTY = true ; private static final boolean REFRESH_FROM_DATACACHE = true ; private static final LockModeType NOLOCK = null ; private static final Class < ? > ENTITY_NOT_FOUND_ERROR = EntityNotFoundException . class ; private static final Class < ? > NO_ERROR = null ; private static final String MARKER_DATACACHE = "in<seq2seq4repair_space>DataCache" ; private static final String MARKER_DATABASE = "in<seq2seq4repair_space>Database" ; private static final String MARKER_CACHE = "in<seq2seq4repair_space>Object<seq2seq4repair_space>Cache" ; private static final String MARKER_DIRTY_CACHE = "in<seq2seq4repair_space>Object<seq2seq4repair_space>Cache<seq2seq4repair_space>(dirty)" ; private static long ID_COUNTER = System . currentTimeMillis ( ) ; public void setUp ( ) throws Exception { } boolean isDataCacheActive ( OpenJPAEntityManagerFactorySPI emf ) { } public void createBidirectionalRelation ( EntityManager em , long id , boolean consistent ) { } public void verifyBidirectionalRelation ( boolean useDataCache , boolean createConsistent , boolean expectConsistent ) { } public void testConsitentBidirectionalRelationIsPreservedWithDataCache ( ) { } public void testConsitentBidirectionalRelationIsPreservedWithoutDataCache ( ) { } public void testInconsitentBidirectionalRelationIsPreservedWithDataCache ( ) { } public void testInconsitentBidirectionalRelationIsNotPreservedWithoutDataCache ( ) { } public void verifyRefresh ( boolean useDataCache , LockModeType lock , boolean makeDirtyBeforeRefresh , boolean refreshFromDataCache , String expected ) { } String getExpectedMarker ( boolean useDataCache , LockModeType lock , boolean makeDirtyBeforeRefresh ) { } public void testDirtyRefreshWithNoLockHitsDatabase ( ) { } public void testDirtyRefreshWithNoLockHitsDataCache ( ) { } public void testCleanRefreshWithNoLockDoesNotHitDatabase ( ) { } public void testCleanRefreshWithNoLockHitsDataCache ( ) { } public void testDirtyRefreshWithReadLockHitsDatabase ( ) { } public void testCleanRefreshWithReadLockDoesNotHitDatabase ( ) { } public void testDirtyRefreshWithWriteLockHitsDatabase ( ) { } public void testCleanRefreshWithWriteLockDoesNotHitDatabase ( ) { } public void testDirtyRefreshWithoutDataCacheAlwaysHitsDatabase ( ) { } public void testCleanRefreshWithoutDataCacheDoesNotHitDatabase ( ) { } public void verifyDeleteDetectionOnRefresh ( boolean useDataCache , boolean dirty , LockModeType lock , Class < ? > expectedExceptionType ) { } public void testDeleteIsNotDetectedOnCleanRefreshWithoutLockWithDataCache ( ) { <START_BUG> verifyDeleteDetectionOnRefresh ( TestDataCacheBehavesIdentical . WITH_DATACACHE , ( ! ( TestDataCacheBehavesIdentical . DIRTY ) ) , TestDataCacheBehavesIdentical . NOLOCK , TestDataCacheBehavesIdentical . NO_ERROR ) ; <END_BUG> } public void testDeleteIsDetectedOnCleanRefreshWithLockWithDataCache ( ) { } public void testDeleteIsDetectedOnDirtyRefreshWithoutLockWithDataCache ( ) { } public void testDeleteIsDetectedOnDirtyRefreshWithLockWithDataCache ( ) { } public void testDeleteIsDetectedOnDirtyRefreshWitDataCache ( ) { } public void testDeleteIsDetectedOnCleanRefreshWithoutLockWithoutDataCache ( ) { } public void testDeleteIsDetectedOnCleanRefreshWithLockWithoutDataCache ( ) { } }

Fix:
verifyDeleteDetectionOnRefresh ( TestDataCacheBehavesIdentical . WITH_DATACACHE , ( ! ( TestDataCacheBehavesIdentical . DIRTY ) ) , TestDataCacheBehavesIdentical . NOLOCK , TestDataCacheBehavesIdentical . ENTITY_NOT_FOUND_ERROR ) ;