adding waitfor to ActionSystem and implementing the java version test.