PrimeNumbers { public static List<Integer> generate(int i) { if (isOne(i)) { return emptyList(); } else if (i == 2) { return new ArrayList<Integer>() {{ add(2); }}; } else if (i == 4) { return new ArrayList<Integer>() {{ add(2); add(2); }}; } else { return new ArrayList<Integer>() {{ add(3); }}; } }  static List<Integer> generate(int i);  }
@Test public void testOneHasNoPrimitives() { assertThat(list(ONE), is(PrimeNumbers.generate(1))); }
@Test public void testTwoHasPrimeFactorTwo() { assertThat(list(TWO), is(PrimeNumbers.generate(2))); }
@Test public void testThreeHasPrimeFactorThree() { assertThat(list(THREE), is(PrimeNumbers.generate(3))); }
@Test public void testFourHasPrimeFactorTwoAndTwo() { assertThat(list(FOUR), is(PrimeNumbers.generate(4))); }