IndexedBases { @NotNull public ReadContextMatch matchAtPosition(@NotNull final IndexedBases other) { return matchAtPosition(other.index(), other.length(), other.bases()); } 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 testPartialMatchMustHaveAtLeastOneFullSide() { ReadContext victim = new ReadContext("", 1000, 2, 2, 2, 2, "GGTAA".getBytes(), Strings.EMPTY); Assert.assertEquals(ReadContextMatch.FULL, victim.matchAtPosition(2, "GGTAA".getBytes())); assertEquals(ReadContextMatch.PARTIAL, victim.matchAtPosition(2, "GGTA".getBytes())); assertEquals(ReadContextMatch.PARTIAL, victim.matchAtPosition(2, "GGT".getBytes())); assertEquals(ReadContextMatch.CORE, victim.matchAtPosition(1, "GT".getBytes())); assertEquals(ReadContextMatch.PARTIAL, victim.matchAtPosition(1, "GTAA".getBytes())); assertEquals(ReadContextMatch.PARTIAL, victim.matchAtPosition(0, "TAA".getBytes())); assertEquals(ReadContextMatch.CORE, victim.matchAtPosition(0, "TA".getBytes())); assertEquals(ReadContextMatch.CORE, victim.matchAtPosition(0, "T".getBytes())); }
@Test public void testNegativeReadIndex() { ReadContext victim = new ReadContext("", 1000, 2, 2, 2, 2, "GGTAA".getBytes(), Strings.EMPTY); assertEquals(ReadContextMatch.FULL, victim.matchAtPosition(2, "GGTAA".getBytes())); assertEquals(ReadContextMatch.NONE, victim.matchAtPosition(-1, "GGTAA".getBytes())); }