import org.junit.Test;
import org.junit.Ignore;

import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;

public class PrimeTest {

    @Test
    public void testFirstPrime() {
        assertThat(Prime.nth(1), is(2));
    }

    @Ignore
    @Test
    public void testSecondPrime() {
        assertThat(Prime.nth(2), is(3));
    }

    @Ignore
    @Test
    public void testSixthPrime() {
        assertThat(Prime.nth(6), is(13));
    }

    @Ignore
    @Test
    public void testBigPrime() {
        assertThat(Prime.nth(10001), is(104743));
    }

    @Ignore
    @Test(expected = IllegalArgumentException.class)
    public void testUndefinedPrime() {
        Prime.nth(0);
    }
}

@@ -40,16 +40,81 @@
 .Ignore;
+%0Aimport org.junit.Rule;%0Aimport org.junit.rules.ExpectedException;
 %0A%0Aimport
@@ -211,16 +211,95 @@
 Test %7B%0A%0A
+    @Rule%0A    public ExpectedException thrown = ExpectedException.none();%0A    %0A
     @Tes
@@ -732,90 +732,102 @@
 Test
-(expected = IllegalArgumentException.class)%0A    public void testUndefinedPrime() %7B
+%0A    public void testUndefinedPrime() %7B%0A        thrown.expect(IllegalArgumentException.class);
 %0A   
@@ -851,10 +851,15 @@
 ;%0A    %7D%0A
+    %0A
 %7D%0A

use JUnit's @Rule feature