### Question:
Anchors { public static int countTrailingGaps(List<Anchor> anchors) { final int len = anchors.size(); if (len < 2) { throw new RuntimeException("Must have at least two anchors!"); } else if ((anchors.get(len - 1).getSeqPos() != anchors.get(len - 2).getSeqPos())) { return 0; } else { return anchors.get(len - 1).getGapPos() - anchors.get(len - 2).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 testCountTrailingGaps() { assertEquals(0, Anchors.countTrailingGaps(ungapped)); assertEquals(0, Anchors.countTrailingGaps(leadingGap)); assertEquals(0, Anchors.countTrailingGaps(oneGap)); assertEquals(0, Anchors.countTrailingGaps(twoGaps)); assertEquals(2, Anchors.countTrailingGaps(trailingGap)); }