public String javaType(Schema schema) {
    return javaType(schema, true);
  }
@Test
  void javaTypeWithDateTimeTypes() throws Exception {
    SpecificCompiler compiler = createCompiler();

    Schema dateSchema = LogicalTypes.date().addToSchema(Schema.create(Schema.Type.INT));
    Schema timeSchema = LogicalTypes.timeMillis().addToSchema(Schema.create(Schema.Type.INT));
    Schema timeMicrosSchema = LogicalTypes.timeMicros().addToSchema(Schema.create(Schema.Type.LONG));
    Schema timestampSchema = LogicalTypes.timestampMillis().addToSchema(Schema.create(Schema.Type.LONG));
    Schema timestampMicrosSchema = LogicalTypes.timestampMicros().addToSchema(Schema.create(Schema.Type.LONG));
    Schema timestampNanosSchema = LogicalTypes.timestampNanos().addToSchema(Schema.create(Schema.Type.LONG));

    // Date/time types should always use upper level java classes
    assertEquals("java.time.LocalDate", compiler.javaType(dateSchema), "Should use java.time.LocalDate for date type");
    assertEquals("java.time.LocalTime", compiler.javaType(timeSchema),
        "Should use java.time.LocalTime for time-millis type");
    assertEquals("java.time.Instant", compiler.javaType(timestampSchema),
        "Should use java.time.Instant for timestamp-millis type");
    assertEquals("java.time.LocalTime", compiler.javaType(timeMicrosSchema),
        "Should use java.time.LocalTime for time-micros type");
    assertEquals("java.time.Instant", compiler.javaType(timestampMicrosSchema),
        "Should use java.time.Instant for timestamp-micros type");
    assertEquals("java.time.Instant", compiler.javaType(timestampNanosSchema),
        "Should use java.time.Instant for timestamp-nanos type");
  }