public static <E> void setMax(E obj, AtomicLongFieldUpdater<E> updater, long value) {
        for (; ; ) {
            long current = updater.get(obj);
            if (current >= value) {
                return;
            }

            if (updater.compareAndSet(obj, current, value)) {
                return;
            }
        }
    }
@Test
    public void setMax() {
        setMax(8, 7);
        setMax(9, 9);
        setMax(10, 11);
    }