@Test
public void testGetNextToken() {

  String stringInput = " lorem:ipsum\n{dolor}#sit,amet;lorem:ipsum\r\t\f\ndolor(())\n";
  ParsableByteArray input = new ParsableByteArray(Util.getUtf8Bytes(stringInput));
  StringBuilder builder = new StringBuilder();
  assertThat(parseNextToken(input, builder)).isEqualTo("lorem");
  assertThat(parseNextToken(input, builder)).isEqualTo(":");
  assertThat(parseNextToken(input, builder)).isEqualTo("ipsum");
  assertThat(parseNextToken(input, builder)).isEqualTo("{");
  assertThat(parseNextToken(input, builder)).isEqualTo("dolor");
  assertThat(parseNextToken(input, builder)).isEqualTo("}");
  assertThat(parseNextToken(input, builder)).isEqualTo("#sit");
  assertThat(parseNextToken(input, builder)).isEqualTo(",");
  assertThat(parseNextToken(input, builder)).isEqualTo("amet");
  assertThat(parseNextToken(input, builder)).isEqualTo(";");
  assertThat(parseNextToken(input, builder)).isEqualTo("lorem");
  assertThat(parseNextToken(input, builder)).isEqualTo(":");
  assertThat(parseNextToken(input, builder)).isEqualTo("ipsum");
  assertThat(parseNextToken(input, builder)).isEqualTo("dolor");
  assertThat(parseNextToken(input, builder)).isEqualTo("(");
  assertThat(parseNextToken(input, builder)).isEqualTo("(");
  assertThat(parseNextToken(input, builder)).isEqualTo(")");
  assertThat(parseNextToken(input, builder)).isEqualTo(")");
  assertThat(parseNextToken(input, builder)).isNull();
}