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

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

import static org.junit.Assert.assertEquals;

@RunWith(Parameterized.class)
public class PrimeFactorsCalculatorTest {

    private long input;
    private List<Long> expectedOutput;

    @Parameters(name="Prime factors of {0} = {1}")
    public static Collection<Object[]> data() {
        return Arrays.asList(new Object[][]{
                {1L, Collections.emptyList()},
                {2L, Collections.singletonList(2L)},
                {9L, Arrays.asList(3L, 3L)},
                {8L, Arrays.asList(2L, 2L, 2L)},
                {12L, Arrays.asList(2L, 2L, 3L)},
                {901255L, Arrays.asList(5L, 17L, 23L, 461L)},
                {93819012551L, Arrays.asList(11L, 9539L, 894119L)}
        });
    }

    public PrimeFactorsCalculatorTest(long input, List<Long> expectedOutput) {
        this.input = input;
        this.expectedOutput = expectedOutput;
    }

    @Test
    public void test() {
        assertEquals(expectedOutput, new PrimeFactorsCalculator().calculatePrimeFactorsOf(input));
    }

}

@@ -14,191 +14,88 @@
 nit.
-Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.junit.runners.Parameterized;%0Aimport org.junit.runners.Parameterized.Parameters;%0A%0Aimport java.util.Arrays;%0Aimport java.util.Collection
+Before;%0Aimport org.junit.Ignore;%0Aimport org.junit.Test;%0A%0Aimport java.util.Arrays
 ;%0Aim
@@ -125,31 +125,8 @@
 ons;
-%0Aimport java.util.List;
 %0A%0Aim
@@ -173,38 +173,8 @@
 s;%0A%0A
-@RunWith(Parameterized.class)%0A
 publ
@@ -228,370 +228,610 @@
 ate 
-long input
+PrimeFactorsCalculator primeFactorsCalculator
 ;%0A
+%0A
     
-private List%3CLong%3E expectedOutput;%0A%0A    @Parameters(name=%22
+@Before%0A    public void setUp() %7B%0A        primeFactorsCalculator = new 
 Prime
- f
+F
 actors
- of %7B0%7D = %7B1%7D%22)%0A    public static Collection%3CObject%5B%5D%3E data() %7B%0A        return Arrays.asList(new Object%5B%5D%5B%5D%7B%0A                %7B1L, Collections.emptyList()%7D,%0A                %7B2L, Collections.singletonList(2L)%7D,%0A  
+Calculator();%0A    %7D%0A%0A    @Test%0A    public void testNoFactors() %7B%0A        assertEquals(Collections.emptyList(), primeFactorsCalculator.calculatePrimeFactorsOf(1L));%0A    %7D%0A%0A    @Ignore(%22Remove to run test%22)%0A    @Test%0A    public void testPrimeNumber() %7B%0A        assertEquals(Collections.singletonList(2L), primeFactorsCalculator.calculatePrimeFactorsOf(2L));%0A
     
+%7D%0A%0A
     
-      %7B9L, Arrays.asList(3L, 3L)%7D,%0A                %7B8L, 
+@Ignore(%22Remove to run test%22)%0A    @Test%0A    public void testSquareOfAPrime() %7B%0A        assertEquals(
 Arra
@@ -844,98 +844,383 @@
 ist(
-2L, 2L, 2L)%7D,%0A                %7B12L, Arrays.asList(2L, 2L, 3L)%7D,%0A                %7B901255L, 
+3L, 3L), primeFactorsCalculator.calculatePrimeFactorsOf(9L));%0A    %7D%0A%0A    @Ignore(%22Remove to run test%22)%0A    @Test%0A    public void testCubeOfAPrime() %7B%0A        assertEquals(Arrays.asList(2L, 2L, 2L), primeFactorsCalculator.calculatePrimeFactorsOf(8L));%0A    %7D%0A%0A    @Ignore(%22Remove to run test%22)%0A    @Test%0A    public void testProductOfPrimesAndNonPrimes() %7B%0A        assertEquals(
 Arra
@@ -1233,353 +1233,441 @@
 ist(
-5L, 17
+2L, 2
 L, 
-2
 3L
+)
 , 
-461L)%7D,%0A                %7B93819012551L, Arrays.asList(11L, 9539L, 894119L)%7D%0A        %7D);%0A    %7D%0A%0A    public PrimeFactorsCalculatorTest(long input, List%3CLong%3E expectedOutput) %7B%0A        this.input = input
+primeFactorsCalculator.calculatePrimeFactorsOf(12L));%0A    %7D%0A%0A    @Ignore(%22Remove to run test%22)%0A    @Test%0A    public void testProductOfPrimes() %7B%0A        assertEquals(Arrays.asList(5L, 17L, 23L, 461L), primeFactorsCalculator.calculatePrimeFactorsOf(901255L))
 ;%0A    
+%7D%0A%0A
     
-this.expectedOutput = expectedOutput;%0A    %7D%0A%0A    @Test%0A    public void test() %7B%0A        assertEquals(expectedOutput, new P
+@Ignore(%22Remove to run test%22)%0A    @Test%0A    public void testFactorsIncludingALargePrime() %7B%0A        assertEquals(Arrays.asList(11L, 9539L, 894119L), p
 rime
@@ -1683,18 +1683,16 @@
 lculator
-()
 .calcula
@@ -1712,13 +1712,20 @@
 sOf(
-input
+93819012551L
 ));%0A

Update PrimeFactorsCalculatorTest (#1308)