SimpleAlignedSequence implements AlignedSequence<S, C> { @Override public int getNumGaps() { if (numGaps == -1) { numGaps = 0; C cGap = getCompoundSet().getCompoundForString(gap); boolean inGap = false; for (C compound : getAsList()) { if (compound == null || compound.equalsIgnoreCase(cGap)) { if (!inGap) { numGaps++; inGap = true; } } else { inGap = false; } } } return numGaps; } SimpleAlignedSequence(S original, List<Step> steps);  SimpleAlignedSequence(S original, List<Step> steps, int numBefore, int numAfter);  SimpleAlignedSequence(AlignedSequence<S, C> prev, List<Step> steps);  SimpleAlignedSequence(AlignedSequence<S, C> prev, List<Step> steps, int numBefore, int numAfter); @Override void clearCache(); @Override int getAlignmentIndexAt(int sequenceIndex); @Override Point getEnd(); @Override Location getLocationInAlignment(); @Override int getNumGaps(); @Override S getOriginalSequence(); @Override int getOverlapCount(); @Override int getSequenceIndexAt(int alignmentIndex); @Override Point getStart(); @Override boolean isCircular(); @Override boolean isGap(int alignmentIndex); @Override int countCompounds(C... compounds); @Override AccessionID getAccession(); @Override List<C> getAsList(); @Override C getCompoundAt(int alignmentIndex); @Override CompoundSet<C> getCompoundSet(); @Override int getIndexOf(C compound); @Override int getLastIndexOf(C compound); @Override int getLength(); @Override String getSequenceAsString(); @Override SequenceView<C> getSubSequence(Integer start, Integer end); @Override Iterator<C> iterator(); @Override String toString(); @Override //TODO Needs to implements SequenceView<C> getInverse();  }
@Test public void testGetNumGaps() { assertEquals(global.getNumGaps(), 3); assertEquals(local.getNumGaps(), 2); assertEquals(local2.getNumGaps(), 0); }