public void stopEndlessStatement() throws Throwable {
InfiniteLoopStatement infiniteLoop = new InfiniteLoopStatement();
FailOnTimeout infiniteLoopTimeout = new FailOnTimeout(infiniteLoop,
TIMEOUT);
try {
infiniteLoopTimeout.evaluate();
} catch (Exception timeoutException) {
sleep(20); // time to interrupt the thread
int firstCount = InfiniteLoopStatement.COUNT;
sleep(20); // time to increment the count
assertTrue("Thread has not been stopped.",