@@ -0,0 +1,907 @@
+package com.github.kaaveland.tryagain;%0A%0Aimport org.junit.Test;%0A%0Aimport static org.hamcrest.MatcherAssert.assertThat;%0Aimport static org.hamcrest.core.IsEqual.equalTo;%0A%0Apublic class ExponentialBackoffStrategyTest %7B%0A%0A    private DelayStrategy base4 = new ExponentialBackoffStrategy(4);%0A    private DelayStrategy base2 = new ExponentialBackoffStrategy(2);%0A%0A    @Test%0A    public void that_the_first_attempt_delays_baseBackoff() %7B%0A        assertThat(base2.delay(1), equalTo(2L));%0A        assertThat(base4.delay(1), equalTo(4L));%0A    %7D%0A%0A    @Test%0A    public void that_the_second_attempt_delays_square_of_baseBackoff() %7B%0A        assertThat(base2.delay(2), equalTo(4L));%0A        assertThat(base4.delay(2), equalTo(16L));%0A    %7D%0A%0A    @Test%0A    public void that_the_third_attempt_delays_cube_of_baseBackoff() %7B%0A        assertThat(base2.delay(3), equalTo(8L));%0A        assertThat(base4.delay(3), equalTo(64L));%0A    %7D%0A%0A%7D%0A

Test ExponentialBackoff.