@Test
public void testCaching() throws ParseException {

  // The same instance is used for all types without options up to (at least) 10 indices.
  for (FormatChar c : FormatChar.values()) {
    for (int n = 0; n < 10; n++) {
      assertThat(SimpleParameter.of(n, c, FormatOptions.getDefault()))
          .isSameInstanceAs(SimpleParameter.of(n, c, FormatOptions.getDefault()));
    }
  }
  // Different indices do not return the same instances.
  assertThat(SimpleParameter.of(1, FormatChar.DECIMAL, FormatOptions.getDefault()))
      .isNotSameInstanceAs(SimpleParameter.of(0, FormatChar.DECIMAL, FormatOptions.getDefault()));
  // Different format chars do not return the same instances.
  assertThat(SimpleParameter.of(0, FormatChar.FLOAT, FormatOptions.getDefault()))
      .isNotSameInstanceAs(SimpleParameter.of(0, FormatChar.DECIMAL, FormatOptions.getDefault()));
  // Different formatting options do not return the same instances.
  assertThat(SimpleParameter.of(0, FormatChar.DECIMAL, FormatOptions.parse("-10", 0, 3, false)))
      .isNotSameInstanceAs(SimpleParameter.of(0, FormatChar.DECIMAL, FormatOptions.getDefault()));
}