### Question:
Anchors { public static int countLeadingGaps(List<Anchor> anchors) { if (anchors.size() < 2) { throw new RuntimeException("Must have at least two anchors!"); } else if (anchors.size() < 2 || (anchors.get(0).getSeqPos() != anchors.get(1) .getSeqPos())) { return 0; } else { assert anchors.get(0).getSeqPos() == 0; return anchors.get(1).getGapPos(); } }  static int gapLength(List<Anchor> anchors); static int seqLength(List<Anchor> anchors); static int projectGapToSeqPos(final List<Anchor> anchors, final int gapPos); static int projectSeqToGapPos(final List<Anchor> anchors, final int seqPos); static int countLeadingGaps(List<Anchor> anchors); static int countTrailingGaps(List<Anchor> anchors);  }### Answer:
@Test public void testCountLeadingGaps() { assertEquals(0, Anchors.countLeadingGaps(ungapped)); assertEquals(2, Anchors.countLeadingGaps(leadingGap)); assertEquals(0, Anchors.countLeadingGaps(oneGap)); assertEquals(0, Anchors.countLeadingGaps(twoGaps)); assertEquals(0, Anchors.countLeadingGaps(trailingGap)); }