@@ -0,0 +1,1635 @@
+import org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.junit.runners.Parameterized;%0A%0Aimport java.math.BigInteger;%0Aimport java.util.Arrays;%0Aimport java.util.Collection;%0A%0Aimport static org.assertj.core.api.Assertions.assertThat;%0A%0A@RunWith(Parameterized.class)%0Apublic class ConvertBaseTenToBaseSevenTest %7B%0A%0A    /*%0A    Complete the function that takes an integer as its argument and returns the encoded string in base 7%0A    using the following encoding rule:%0A    base 10 0 1 2 3 4 5 6%0A    base 7  0 a t l s i N%0A%0A    Sample Input  : 7%0A    Sample Output : a0%0A%0A    NOTE: input can be bigger than 2%5E63-1 (long)%0A     */%0A%0A    @Parameterized.Parameters%0A    public static Collection%3CObject%5B%5D%3E data() %7B%0A        return Arrays.asList(new Object%5B%5D%5B%5D %7B%0A                 %7B %227%22, %22a0%22 %7D%0A        %7D);%0A    %7D%0A%0A    @Parameterized.Parameter%0A    public  String input;%0A%0A    @Parameterized.Parameter(1)%0A    public String expected;%0A%0A    @Test%0A    public void toBaseSeven_Test() %7B%0A        BigInteger bInput = new BigInteger(input);%0A%0A        String result = toBase7(bInput);%0A%0A        assertThat(result).isEqualTo(expected);%0A    %7D%0A%0A    private static String toBase7(BigInteger input) %7B%0A        StringBuilder builder = new StringBuilder();%0A        BigInteger base = new BigInteger(%227%22);%0A%0A        while (input.compareTo(BigInteger.ZERO) != 0) %7B%0A            builder.append(getChar(input.mod(base).intValue()));%0A            input = input.divide(base);%0A        %7D%0A%0A        return  builder.reverse().toString();%0A    %7D%0A%0A    private static char getChar(int number) %7B%0A        char%5B%5D array = %7B'0', 'a', 't', 'l', 's', 'i', 'N'%7D;%0A        return array%5Bnumber%5D;%0A    %7D%0A%7D%0A

rename file