protected int calcAllArgConstructorParameterUnits(Schema record) {

    if (record.getType() != Schema.Type.RECORD)
      throw new RuntimeException("This method must only be called for record schemas.");

    return record.getFields().size();
  }
@Test
  void calcAllArgConstructorParameterUnitsFailure() {
    assertThrows(RuntimeException.class, () -> {
      Schema nonRecordSchema = SchemaBuilder.array().items().booleanType();
      new SpecificCompiler().calcAllArgConstructorParameterUnits(nonRecordSchema);
    });
  }