void writeTo(DataOutput out) throws IOException {
    if (optionalFields.isEmpty()) {
      DataSerializer.writeObject(null, out);
    } else {
      DataSerializer.writeObject(optionalFields, out);
    }
  }
Writes all optional fields to the DataOutput or null for minimal wire footprint.
geode-core/src/main/java/org/apache/geode/distributed/internal/StartupMessageData.java