private boolean determineIfWeShouldExit() {
        boolean shouldStop = stop.get();
        if (!shouldStop) {
            Thread.interrupted();
        } else {
            System.out.println("Exiting processing loop as requested");
            return true;
        }
        return false;
    }
private boolean determineIfWeShouldExit() {
        boolean shouldStop = stop.get();
        if (!shouldStop) {
            Thread.interrupted();
        } else {
            System.out.println("Exiting processing loop as requested");
            return true;
        }
        return false;
    }
private boolean determineIfWeShouldExit ( ) { boolean shouldStop = stop . get ( ) ; if ( ! shouldStop ) { Thread . interrupted ( ) ; } else { System . out . println ( "Exiting processing loop as requested" ) ; return true ; } return false ; }
See if it is time to stop
We have been interrupted. Should we ignore it or break out of the loop.

@return
See if it is time to stop We have been interrupted . Should we ignore it or break out of the loop .