### Question:
TailableFile implements Closeable { static boolean skipUntil(ByteBuffer bytes, byte b) { while (bytes.hasRemaining()) { if (bytes.get() == b) { return true; } } return false; } TailableFile(File file); void deleteStateFileOnExit(); void ack(); void nak(); int tail(ByteBuffer buffer, FileChangeListener listener, int maxLines); @Override void close(); File getFile(); @Override String toString();  }### Answer:
@Test void testIndexOfNewLine() { ByteBuffer buffer = ByteBuffer.wrap(new byte[]{'c', 'a', 'f', 'e', '\n', 'b', 'a', 'b', 'e', '\r', '\n'}); assertThat(TailableFile.skipUntil(buffer, (byte) '\n')).isTrue(); assertThat(buffer.position()).isEqualTo(5); assertThat(TailableFile.skipUntil(buffer, (byte) '\n')).isTrue(); assertThat(buffer.position()).isEqualTo(11); assertThat(TailableFile.skipUntil(buffer, (byte) '\n')).isFalse(); }