import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import static org.assertj.core.api.Assertions.assertThat;

@RunWith(Parameterized.class)
public class SmallBidilarTest {

    /*
    O(n) anagram
     */
    @Test
    public void anagram_Test() {

        boolean result = anagram("williamshakespeare", "iamaweakishspeller");

        assertThat(result).isEqualTo(true);
    }

    private boolean anagram(String s1, String s2) {
        if (s1.length() != s2.length()) return false;

        int sum = 0;
        for (int i = 0; i < s1.length(); sum += s1.charAt(i) - s2.charAt(i), i++) ;

        return sum == 0;
    }


    @Parameterized.Parameters
    public static Object[] data() {
        return new Object[]{
                2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47,
                53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113,
                127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179,
                181, 191, 193, 197, 199
        };
    }

    @Parameterized.Parameter
    public int input;

    @Test
    public void isPrime_Test() {
        boolean result = isPrime(input);
        assertThat(result).isEqualTo(true);
    }

    private boolean isPrime(int n) {

        if (n == 1) {
            return true;
        } else {
            int sqrt = (int) Math.sqrt(n);

            for (int i = 2; i <= sqrt; i += 2) if (n % i == 0) return false;

            return true;
        }
    }
}

@@ -19,81 +19,8 @@
 est;
-%0Aimport org.junit.runner.RunWith;%0Aimport org.junit.runners.Parameterized;
 %0A%0Aim
@@ -80,38 +80,8 @@
 t;%0A%0A
-@RunWith(Parameterized.class)%0A
 publ
@@ -319,344 +319,81 @@
  %7D%0A%0A
+%0A
     
-private boolean anagram(String s1, String s2) %7B%0A        if (s1.length() != s2.length()) return false;%0A%0A        int sum = 0;%0A        for (int i = 0; i %3C s1.length(); sum += s1.charAt(i) - s2.charAt(i), i++) ;%0A%0A        return sum == 0;%0A    %7D%0A%0A%0A    @Parameterized.Parameters%0A    public static Object%5B%5D data() %7B%0A        return new Objec
+@Test%0A    public void isPrime_Test() %7B%0A        int%5B%5D primes = new in
 t%5B%5D%7B
@@ -672,65 +672,172 @@
  %7D;%0A
+%0A
     
-%7D%0A%0A
     
-@Parameterized.Parameter%0A    public int input;
+for (int i = 0; i %3C primes.length; i++) %7B%0A            boolean result = isPrime(primes%5Bi%5D);%0A            assertThat(result).isEqualTo(true);%0A        %7D%0A%0A    %7D
 %0A%0A  
@@ -855,34 +855,39 @@
  public void isP
-ri
+alindro
 me_Test() %7B%0A    
@@ -894,83 +894,1017 @@
     
-boolean result = isPrime(input);%0A        assertThat(result).isEqualTo(true)
+String%5B%5D palindromes = new String%5B%5D%7B%0A                %22Able was I ere I saw Elba%22,%0A                %22Never odd or even%22,%0A                %22madam%22,%0A                %22racecar%22,%0A                %22Was it a car or a cat I saw%22%0A        %7D;%0A%0A        for (String sentenceOrWord : palindromes) %7B%0A            boolean result = isPalindrome(sentenceOrWord);%0A            assertThat(result).isEqualTo(true);%0A        %7D%0A%0A    %7D%0A%0A    private boolean isPalindrome(String s) %7B%0A        if (s.length() %3C 2) return true;%0A%0A        s = s.toLowerCase().replaceAll(%22%5C%5Cs+%22, %22%22);%0A%0A        int midPoint = s.length() / 2;%0A%0A        for (int i = 0, j = s.length() - 1; i %3C= midPoint && j %3E= midPoint; i++, j--) %7B%0A            if (s.charAt(i) != s.charAt(j)) return false;%0A        %7D%0A%0A        return true;%0A%0A    %7D%0A%0A    private boolean anagram(String s1, String s2) %7B%0A%0A        if (s1.length() != s2.length()) return false;%0A%0A        int sum = 0;%0A        for (int i = 0; i %3C s1.length(); sum += s1.charAt(i) - s2.charAt(i), i++) ;%0A%0A        return sum == 0
 ;%0A  

add simple things