@@ -0,0 +1,1056 @@
+import java.util.HashMap;%0Aimport java.util.Map;%0A%0Apublic final class DNA %7B%0A  private final String sequence;%0A%0A  public DNA(String sequence) %7B%0A    this.sequence = sequence;%0A  %7D%0A%0A  public int count(char base) %7B%0A    if (isCountable(base))%0A      throw new IllegalArgumentException(base + %22 is not a nucleotide%22);%0A%0A    try %7B%0A      return nucleotideCounts().get(base);%0A    %7D catch (NullPointerException e) %7B%0A      return 0;%0A    %7D%0A  %7D%0A%0A  private static boolean isCountable(char base) %7B%0A    final String COUNTABLE_NUCLEOTIDES = %22ACGTU%22;%0A    return COUNTABLE_NUCLEOTIDES.indexOf(base) == -1;%0A  %7D%0A%0A  public Map%3CCharacter, Integer%3E nucleotideCounts() %7B%0A    Map%3CCharacter, Integer%3E counts = emptyCounts();%0A    for (char c : sequence.toCharArray()) %7B%0A      counts.put(c, counts.get(c) + 1);%0A    %7D%0A    return counts;%0A  %7D%0A%0A  private static Map%3CCharacter, Integer%3E emptyCounts() %7B%0A    Map%3CCharacter, Integer%3E counts = new HashMap%3CCharacter, Integer%3E();%0A    counts.put('A', 0);%0A    counts.put('C', 0);%0A    counts.put('T', 0);%0A    counts.put('G', 0);%0A    return counts;%0A  %7D%0A%7D%0A

Add sample nucleotide-count implementation