@@ -0,0 +1,1733 @@
+/*%0ACopyright 2015-2016 Artem Stasiuk%0A%0ALicensed under the Apache License, Version 2.0 (the %22License%22);%0Ayou may not use this file except in compliance with the License.%0AYou may obtain a copy of the License at%0A%0A    http://www.apache.org/licenses/LICENSE-2.0%0A%0AUnless required by applicable law or agreed to in writing, software%0Adistributed under the License is distributed on an %22AS IS%22 BASIS,%0AWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0ASee the License for the specific language governing permissions and%0Alimitations under the License.%0A */%0A%0Apackage com.github.terma.fastselect.utils;%0A%0Aimport junit.framework.Assert;%0Aimport org.junit.Test;%0A%0Apublic class RoundValueTest %7B%0A%0A    @Test%0A    public void alwaysStartFromZero() %7B%0A        Assert.assertEquals(0, new RoundValue(11).next());%0A        Assert.assertEquals(0, new RoundValue(11).next());%0A        Assert.assertEquals(0, new RoundValue(11).next());%0A    %7D%0A%0A    @Test%0A    public void incrementWhenNext() %7B%0A        RoundValue roundValue = new RoundValue(11);%0A        Assert.assertEquals(0, roundValue.next());%0A        Assert.assertEquals(1, roundValue.next());%0A        Assert.assertEquals(2, roundValue.next());%0A    %7D%0A%0A    @Test%0A    public void nextAfterMaxWillBeZero() %7B%0A        RoundValue roundValue = new RoundValue(2);%0A        Assert.assertEquals(0, roundValue.next());%0A        Assert.assertEquals(1, roundValue.next());%0A        Assert.assertEquals(2, roundValue.next());%0A        Assert.assertEquals(0, roundValue.next());%0A    %7D%0A%0A    @Test%0A    public void zeroOrNegativeMaxAlwaysProduceZero() %7B%0A        RoundValue roundValue = new RoundValue(0);%0A        Assert.assertEquals(0, roundValue.next());%0A        Assert.assertEquals(0, roundValue.next());%0A    %7D%0A%0A%7D%0A

Add tests