IndexedBases { int leftFlankMatchingBases(int otherRefIndex, byte[] otherBases) { int otherLeftCentreIndex = otherRefIndex + leftCoreIndex - index; int otherLeftFlankLength = otherLeftCentreIndex - Math.max(0, otherLeftCentreIndex - this.flankSize); int totalLength = Math.min(leftFlankLength(), otherLeftFlankLength); for (int i = 1; i <= totalLength; i++) { if (bases[leftCoreIndex - i] != otherBases[otherLeftCentreIndex - i]) { return -1; } } return totalLength; } IndexedBases(final int position, final int index, final byte[] bases);  IndexedBases(final int position, final int index, final int leftCoreIndex, int rightCoreIndex, int flankSize,
            final byte[] bases); @NotNull static IndexedBases resize(final int position, final int recordIndex, final int recordLeftCoreIndex,
            final int recordRightCoreIndex, final int flankSize, final int additionalFlank, final byte[] recordBases); boolean phased(int offset, @NotNull final IndexedBases other); boolean isCentreCovered(int otherReadIndex, byte[] otherBases); @NotNull ReadContextMatch matchAtPosition(@NotNull final IndexedBases other); @NotNull ReadContextMatch matchAtPosition(int otherReadIndex, byte[] otherBases); @NotNull ReadContextMatch matchAtPosition(int otherReadIndex, int otherLength, byte[] otherBases); @NotNull String centerString(); @Override String toString(); int flankSize(); int index(); int index(int position); byte[] bases(); int leftCentreIndex(); int rightCentreIndex(); int position(); int leftFlankIndex(); int rightFlankIndex(); byte base(int position); int maxFlankLength(); byte[] trinucleotideContext(int position);  }
@Test public void testLeftFlankMatchingBases() { assertEquals(-1, victim.leftFlankMatchingBases(5, "TTCTCCTCA".getBytes())); assertEquals(3, victim.leftFlankMatchingBases(5, "GATCTCCTCA".getBytes())); assertEquals(3, victim.leftFlankMatchingBases(4, "ATCTCCTCA".getBytes())); assertEquals(2, victim.leftFlankMatchingBases(3, "TCTCCTCA".getBytes())); assertEquals(1, victim.leftFlankMatchingBases(2, "CTCCTCA".getBytes())); assertEquals(0, victim.leftFlankMatchingBases(1, "TCCTCA".getBytes())); }