Java: replace Event.loop() with EventLoop class and same for Behavior.