System.out.println("counter: " + val);
break;
case '3':
long expect=Util.readLongFromStdin("expected value: ");
long update=Util.readLongFromStdin("update: ");
if(counter.compareAndSet(expect, update)) {
System.out.println("-- set counter \"" + counter.getName() + "\" to " + update + "\n");
}
else {
System.err.println("failed setting counter \"" + counter.getName() + "\" from " + expect +
" to " + update + ", current value is " + counter.get() + "\n");