@Test
public void testBraceFormatNextTerm() throws ParseException {

  assertThat(BraceStyleMessageParser.nextBraceFormatTerm("", 0)).isEqualTo(-1);
  assertThat(BraceStyleMessageParser.nextBraceFormatTerm("{", 0)).isEqualTo(0);
  assertThat(BraceStyleMessageParser.nextBraceFormatTerm("Hello {0} World {1}", 0)).isEqualTo(6);
  assertThat(BraceStyleMessageParser.nextBraceFormatTerm("Hello {0} World {1}", 6)).isEqualTo(6);
  assertThat(BraceStyleMessageParser.nextBraceFormatTerm("Hello {0} World {1}", 7)).isEqualTo(16);
  assertThat(BraceStyleMessageParser.nextBraceFormatTerm("Hello ''{0}'' World", 0)).isEqualTo(8);
  assertThat(BraceStyleMessageParser.nextBraceFormatTerm("Hello {0} World {1}", 17))
      .isEqualTo(-1);
  assertThat(BraceStyleMessageParser.nextBraceFormatTerm("Hello '{'0} World", 0)).isEqualTo(-1);
  assertThat(BraceStyleMessageParser.nextBraceFormatTerm("Hello '{0}' World", 0)).isEqualTo(-1);
}