Code example for AtomicInteger

Methods: getAndSet

            return this.state.compareAndSet(MonitoredThreadState.RUNNING.ordinal(),
        public MonitoredThreadState markAsDone() { 
            int val = this.state.getAndSet(MonitoredThreadState.DONE.ordinal());
            return MonitoredThreadState.values()[val];
        boolean isMarkedAsStuck() { 
            return this.state.get() == MonitoredThreadState.STUCK.ordinal();
    private static class CompletedStuckThread { 
        private final String threadName;
        private final long totalActiveTime;
        public CompletedStuckThread(String threadName, long totalActiveTime) {
Connect your IDE to all the code out there  Get Codota for Java