void () { final LookupTraceBase<?>[] traces = { TRACE_OF_ALL_KEYS_LOOKUP.get(), TRACE_OF_ENTRIES_LOOKUP.get(), TRACE_OF_STUB_ENTRIES_LOOKUP.get() }; for (LookupTraceBase<?> trace : traces) { if (trace.traceWasStarted()) { final String message = "All traces must be returned to un-initialized state after test: " + trace; //now fix it, so next tests are not affected while (trace.traceWasStarted()) { trace.lookupFinished(); } //fail: i.e. assume test must clean for itself, and lack of cleanup is a test bug fail(message); } } }