Clean way to limit the execution of a java code block by a timeout

Sometimes you want to limit the execution of a java code block by a timeout. This is a class I created, if a timeout is reached »