@Override
        public void run() {
            int n;
            int previous;

            try {
                sharedLock.get(5 * 60 * 1000);
            } catch (final InterruptedException e) {
                fail("Test interrupted.");
            }
            n = countElements();
            assertFalse(n < 5);
            previous = n;
            for (int i = 0; i < 1000; ++i) {
                int reverse = reverseCountElements();
                n = countElements();
                assertFalse(n < reverse);
                assertFalse(n < previous);
                previous = n;
            }
        }
Check we keep the consistent view when reading and writing in parallell.

@author Steinar Knutsen
vespajlib/src/test/java/com/yahoo/concurrent/ThreadRobustListTestCase.java