static long stupidFib_collab(ICollab collab, int n) { new Var var; stupidFib_collab(collab, n, result -> { var.set(result); collab.done(); }); collab.run(); ret var!; } svoid stupidFib_collab(ICollab collab, int n, LongConsumer continuation) { if (n < 3) ret with continuation.accept(1L); LongPairCollector collector = new { void complete(long a, long b) { continuation.accept(a+b); } }; collab.addWork(-> stupidFib_collab(collab, n-1, collector.setterForA())); collab.addWork(-> stupidFib_collab(collab, n-2, collector.setterForB())); }