docs: static void checkDefaultValueIsLegal(Field field,
                                                                List<Message> messages,
                                                                String name) {
          if(field == null) {
              throw new IllegalArgumentException("Field must be non-null. Name=" + name);
          }
  
          if(field.defaultValue() != null) {
              // Get the type schema. If this is a UNION, the default must be of
              // the leading type
              Schema fieldSchema = field.schema();
              if(fieldSchema.getType() == Schema.Type.UNION) {
                  fieldSchema = fieldSchema.getTypes().get(0);
              }
  
              // Get the default value
              JsonNode defaultJson = field.defaultValue();
  
              String expectedVal = checkDefaultJson(defaultJson, field.schema());
  
              if(expectedVal != null) {
                  messages.add(new Message(Level.ERROR, "Illegal default value for field " + name
                                                        + ". The default must be of type "
                                                        + expectedVal + "."));
              }
          }
      }