Method doSomething
// if this is my session only then the data will be 0
boolean succeeded = true;
int count = countUp();
if (count != 1) {
System.out.println("Failed with count=" + count);
succeeded = false;
}
try {
// simulate some busy processing
Thread.currentThread().sleep(999);
} catch (InterruptedException e) {
// ignore
}
// check exit count
count = countDown();
if (count != 0) {
System.out.println("Failed with count=" + count);
succeeded = false;
}
return succeeded;