public final void checkIntegrity ( ) { executeWithGlobalLock ( new Job < Void > ( ) { @ Override public Void call ( ) { IntegrityState is = getIntegrityState ( ) ; if ( is . getStateFlags ( ) > 0 ) { throw new Error ( "cache2k integrity error: " + is . getStateDescriptor ( ) + ", " + is . getFailingChecks ( ) + ", " + generateInfoUnderLock ( HeapCache . this , clock . millis ( ) ) . toString ( ) ) ; } return null ; } } ) ; }
Check internal data structures and throw and exception if something is wrong used for unit testing