@Override public void declareBehavior(GreenRuntime runtime) { runtime.addStartupListener(new KickoffBehavior(runtime, target)); runtime.addPubSubListener(new GenerateBehavior(runtime, "Count", target, seed)) .addSubscription("Next"); CountBehavior counter = new CountBehavior(runtime, "Next"); runtime.registerListener(counter) .addSubscription("Count", counter::triggerNextAndCount) .addSubscription("AnExample", counter::anotherMessage); }