#122 renamed WaitAll to Flush() to keep context of java