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

import java.util.Map;

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

public class NucleotideTest {

    @Test
    public void testEmptyDnaStringHasNoAdenosine() {
        DNA dna = new DNA("");
        assertThat(dna.count('A'), is(0));
    }

    @Ignore
    @Test
    public void testEmptyDnaStringHasNoNucleotides() {
        DNA dna = new DNA("");
        Map<Character, Integer> counts = dna.nucleotideCounts();
        assertThat(counts.size(), is(4));
        assertThat(counts, allOf(
                hasEntry('A', 0),
                hasEntry('C', 0),
                hasEntry('G', 0),
                hasEntry('T', 0)
        ));
    }

    @Ignore
    @Test
    public void testRepetitiveCytidineGetsCounted() {
        DNA dna = new DNA("CCCCC");
        assertThat(dna.count('C'), is(5));
    }

    @Ignore
    @Test
    public void testRepetitiveSequenceWithOnlyGuanosine() {
        DNA dna = new DNA("GGGGGGGG");
        Map<Character, Integer> counts = dna.nucleotideCounts();
        assertThat(counts.size(), is(4));
        assertThat(counts, allOf(
                hasEntry('A', 0),
                hasEntry('C', 0),
                hasEntry('G', 8),
                hasEntry('T', 0)
        ));
    }

    @Ignore
    @Test
    public void testCountsOnlyThymidine() {
        DNA dna = new DNA("GGGGGTAACCCGG");
        assertThat(dna.count('T'), is(1));
    }

    @Ignore
    @Test
    public void testCountsANucleotideOnlyOnce() {
        DNA dna = new DNA("CGATTGGG");
        dna.count('T');
        assertThat(dna.count('T'), is(2));
    }

    @Ignore
    @Test
    public void testDnaCountsDoNotChangeAfterCountingAdenosine() {
        DNA dna = new DNA("GATTACA");
        dna.count('A');
        Map<Character, Integer> counts = dna.nucleotideCounts();
        assertThat(counts.size(), is(4));
        assertThat(counts, allOf(
                hasEntry('A', 3),
                hasEntry('C', 1),
                hasEntry('G', 1),
                hasEntry('T', 2)
        ));
    }

    @Ignore
    @Test(expected = IllegalArgumentException.class)
    public void testValidatesNucleotides() {
        DNA dna = new DNA("GACT");
        dna.count('X');
    }

    @Ignore
    @Test
    public void testCountsAllNucleotides() {
        String s = "AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC";
        DNA dna = new DNA(s);
        Map<Character, Integer> counts = dna.nucleotideCounts();
        assertThat(counts.size(), is(4));
        assertThat(counts, allOf(
                hasEntry('A', 20),
                hasEntry('C', 12),
                hasEntry('G', 17),
                hasEntry('T', 21)
        ));
    }
}

@@ -40,16 +40,81 @@
 it.Test;
+%0Aimport org.junit.Rule;%0Aimport org.junit.rules.ExpectedException;
 %0A%0Aimport
@@ -235,16 +235,95 @@
 Test %7B%0A%0A
+    @Rule%0A    public ExpectedException thrown = ExpectedException.none();%0A    %0A
     @Tes
@@ -2255,51 +2255,8 @@
 Test
-(expected = IllegalArgumentException.class)
 %0A   
@@ -2289,32 +2289,87 @@
 Nucleotides() %7B%0A
+        thrown.expect(IllegalArgumentException.class);%0A
         DNA dna 

use JUnit's @Rule feature