class GridAtomicInteger extends AtomicInteger {
    /** */
    private static final long serialVersionUID = 0L;

    /**
     * Creates a new AtomicInteger with initial value {@code 0}.
     */
    public GridAtomicInteger() {
        // No-op.
    }

    /**
     * Creates a new AtomicInteger with the given initial value.
     *
     * @param initVal the initial value
     */
    public GridAtomicInteger(int initVal) {
        super(initVal);
    }

    /**
     * Atomically updates value only if {@code check} value is greater
     * than current value.
     *
     * @param check Value to check against.
     * @param update Value to set.
     * @return {@code True} if value was set.
     */
    public boolean greaterAndSet(int check, int update) {
        while (true) {
            int cur = get();

            if (check > cur) {
                if (compareAndSet(cur, update))
                    return true;
            }
            else
                return false;
        }
    }

    /**
     * Atomically updates value only if {@code check} value is greater
     * than or equal to current value.
     *
     * @param check Value to check against.
     * @param update Value to set.
     * @return {@code True} if value was set.
     */
    public boolean greaterEqualsAndSet(int check, int update) {
        while (true) {
            int cur = get();

            if (check >= cur) {
                if (compareAndSet(cur, update))
                    return true;
            }
            else
                return false;
        }
    }

    /**
     * Atomically updates value only if {@code check} value is less
     * than current value.
     *
     * @param check Value to check against.
     * @param update Value to set.
     * @return {@code True} if value was set.
     */
    public boolean lessAndSet(int check, int update) {
        while (true) {
            int cur = get();

            if (check < cur) {
                if (compareAndSet(cur, update))
                    return true;
            }
            else
                return false;
        }
    }

    /**
     * Atomically updates value only if {@code check} value is less
     * than current value.
     *
     * @param check Value to check against.
     * @param update Value to set.
     * @return {@code True} if value was set.
     */
    public boolean lessEqualsAndSet(int check, int update) {
        while (true) {
            int cur = get();

            if (check <= cur) {
                if (compareAndSet(cur, update))
                    return true;
            }
            else
                return false;
        }
    }

    /**
     * Sets value only if it is greater than current one.
     *
     * @param update Value to set.
     * @return {@code True} if value was set.
     */
    public boolean setIfGreater(int update) {
        while (true) {
            int cur = get();

            if (update > cur) {
                if (compareAndSet(cur, update))
                    return true;
            }
            else
                return false;
        }
    }

    /**
     * Sets value only if it is greater than or equals to current one.
     *
     * @param update Value to set.
     * @return {@code True} if value was set.
     */
    public boolean setIfGreaterEquals(int update) {
        while (true) {
            int cur = get();

            if (update >= cur) {
                if (compareAndSet(cur, update))
                    return true;
            }
            else
                return false;
        }
    }

    /**
     * Sets value only if it is less than current one.
     *
     * @param update Value to set.
     * @return {@code True} if value was set.
     */
    public boolean setIfLess(int update) {
        while (true) {
            int cur = get();

            if (update < cur) {
                if (compareAndSet(cur, update))
                    return true;
            }
            else
                return false;
        }
    }

    /**
     * Sets value only if it is less than or equals to current one.
     *
     * @param update Value to set.
     * @return {@code True} if value was set.
     */
    public boolean setIfLessEquals(int update) {
        while (true) {
            int cur = get();

            if (update <= cur) {
                if (compareAndSet(cur, update))
                    return true;
            }
            else
                return false;
        }
    }

    /**
     * Sets value only if it is not equals to current one.
     *
     * @param update Value to set.
     * @return {@code True} if value was set.
     */
    public boolean setIfNotEquals(int update) {<FILL_FUNCTION_BODY>}

    /**
     * Atomically updates value only if passed in predicate returns {@code true}.
     *
     * @param p Predicate to check.
     * @param update Value to set.
     * @return {@code True} if value was set.
     */
    public boolean checkAndSet(IgnitePredicate<Integer> p, int update) {
        while (true) {
            int cur = get();

            if (p.apply(cur)) {
                if (compareAndSet(cur, update))
                    return true;
            }
            else
                return false;
        }
    }
}

        while (true) {
            int cur = get();

            if (update != cur) {
                if (compareAndSet(cur, update))
                    return true;
            }
            else
                return false;
        }
    
<methods>public void <init>() ,public void <init>(int) ,public final int accumulateAndGet(int, java.util.function.IntBinaryOperator) ,public final int addAndGet(int) ,public final int compareAndExchange(int, int) ,public final int compareAndExchangeAcquire(int, int) ,public final int compareAndExchangeRelease(int, int) ,public final boolean compareAndSet(int, int) ,public final int decrementAndGet() ,public double doubleValue() ,public float floatValue() ,public final int get() ,public final int getAcquire() ,public final int getAndAccumulate(int, java.util.function.IntBinaryOperator) ,public final int getAndAdd(int) ,public final int getAndDecrement() ,public final int getAndIncrement() ,public final int getAndSet(int) ,public final int getAndUpdate(java.util.function.IntUnaryOperator) ,public final int getOpaque() ,public final int getPlain() ,public final int incrementAndGet() ,public int intValue() ,public final void lazySet(int) ,public long longValue() ,public final void set(int) ,public final void setOpaque(int) ,public final void setPlain(int) ,public final void setRelease(int) ,public java.lang.String toString() ,public final int updateAndGet(java.util.function.IntUnaryOperator) ,public final boolean weakCompareAndSet(int, int) ,public final boolean weakCompareAndSetAcquire(int, int) ,public final boolean weakCompareAndSetPlain(int, int) ,public final boolean weakCompareAndSetRelease(int, int) ,public final boolean weakCompareAndSetVolatile(int, int) <variables>private static final jdk.internal.misc.Unsafe U,private static final long VALUE,private static final long serialVersionUID,private volatile int value