Tweak solution of AtomicLong based on Prof's explanation.  Use try/catch