public String toTypeString() {
    // needs a map instead of switch because for some reason switch creates an
    // internal class with no annotations that messes up EntityTest
    return Optional.ofNullable(TO_TYPE_STRING.getOrDefault(type, si -> si.type.name()))
        .orElseThrow(NullPointerException::new).apply(this);
  }
@Test
  public void shouldCorrectlyFormatDecimalsWithPrecisionAndScale() {

    final SchemaInfo schemaInfo= new SchemaInfo(
            SqlBaseType.DECIMAL,
            null,
            null,
            ImmutableMap.of("precision", 10, "scale", 9)
    );
    assertThat(schemaInfo.toTypeString(), equalTo("DECIMAL(10, 9)"));
  }