RepeatContextFactory { @VisibleForTesting static boolean match(int repeatIndex, int repeatLength, int readIndex, byte[] readSequence) { return matchingBasesFromLeft(repeatIndex, repeatLength, readIndex, readSequence) == repeatLength; } private  RepeatContextFactory(); @NotNull static Optional<RepeatContext> repeats(int index, final byte[] readSequence); @NotNull static Optional<RepeatContext> repeats(int index, @NotNull final String sequence); static int backwardRepeats(int index, int repeatLength, final byte[] readSequence);  }
@Test public void testMatchRepeatInBytes() { final String sequence = "AAGATCATC"; assertFalse(RepeatContextFactory.match(3, 3, 0, sequence.getBytes())); assertFalse(RepeatContextFactory.match(3, 3, 1, sequence.getBytes())); assertFalse(RepeatContextFactory.match(3, 3, 2, sequence.getBytes())); assertTrue(RepeatContextFactory.match(3, 3, 3, sequence.getBytes())); assertFalse(RepeatContextFactory.match(3, 3, 4, sequence.getBytes())); assertFalse(RepeatContextFactory.match(3, 3, 5, sequence.getBytes())); assertTrue(RepeatContextFactory.match(3, 3, 6, sequence.getBytes())); assertFalse(RepeatContextFactory.match(3, 3, 7, sequence.getBytes())); }