@@ -0,0 +1,1331 @@
+package com.tradeshift.reaktive.testkit;%0A%0Aimport akka.japi.pf.FI;%0Aimport javaslang.CheckedFunction0;%0A%0Apublic class Eventually %7B%0A    public static long startInterval = 15;%0A    public static long maxInterval = 300;%0A    public static long timeout = 5000;%0A    %0A    public static %3CT%3E T eventually(CheckedFunction0%3CT%3E f) %7B%0A        final long deadline = System.currentTimeMillis() + timeout;%0A        long delay = startInterval;%0A        AssertionError lastError;%0A        do %7B%0A            try %7B%0A                return f.apply();%0A            %7D catch (AssertionError x) %7B%0A                lastError = x;%0A                // re-try%0A                try %7B %0A                    Thread.sleep(delay); %0A                %7D catch (InterruptedException y) %7B%0A                    throw new RuntimeException(x);%0A                %7D%0A                delay = Math.min((long) (delay * 1.2), maxInterval);%0A            %7D catch (RuntimeException x) %7B%0A                throw x;%0A            %7D catch (Throwable x) %7B%0A                throw new RuntimeException(x);%0A            %7D%0A        %7D while (System.currentTimeMillis() %3C deadline);%0A        %0A        throw new AssertionError(%22Timed out after %22 + timeout + %22ms. Last error: %22, lastError);%0A    %7D%0A    %0A    public static void eventuallyDo(FI.UnitApplyVoid f) %7B%0A        eventually(() -%3E %7B f.apply(); return null; %7D);%0A    %7D%0A%7D%0A

Add Eventually to do scalatest-like "eventually { ... }" in tests