void () { final List<Object> stock = new CopyOnWriteArrayList<>(); measure(stock); final List<Object> my = new LockFreeCopyOnWriteArrayList<>(); measure(my); measure(stock); measure(my); // warm up for (int i = 0; i < 5; i++) { long stockElapsed = measure(stock); long myElapsed = measure(my); LOG.debug("LockFree my: " + myElapsed + "; stock: " + stockElapsed); assertTrue("lockFree: " + myElapsed + "; stock: " + stockElapsed, (myElapsed - stockElapsed + 0.0) / myElapsed < 0.1); } }