@Test
public void testPrintfNextTerm() throws ParseException {

  assertThat(PrintfMessageParser.nextPrintfTerm("", 0)).isEqualTo(-1);
  assertThat(PrintfMessageParser.nextPrintfTerm("%X", 0)).isEqualTo(0);
  assertThat(PrintfMessageParser.nextPrintfTerm("Hello %X World %X", 0)).isEqualTo(6);
  assertThat(PrintfMessageParser.nextPrintfTerm("Hello %X World %X", 6)).isEqualTo(6);
  assertThat(PrintfMessageParser.nextPrintfTerm("Hello %X World %X", 7)).isEqualTo(15);
  assertThat(PrintfMessageParser.nextPrintfTerm("Hello %% World %X", 0)).isEqualTo(15);
  assertThat(PrintfMessageParser.nextPrintfTerm("Hello %X World %X", 16)).isEqualTo(-1);
}