docs: public void writeNotifications(OutputStream out, Notification[] value) throws IOException {
          final NotificationRecord[] records;
          if (value != null) {
              records = new NotificationRecord[value.length];
              for (int i = 0; i < value.length; ++i) {
                  Notification n = value[i];
                  if (n != null) {
                      Object source = n.getSource();
                      NotificationRecord nr;
                      if (source instanceof ObjectName) {
                          nr = new NotificationRecord(n, (ObjectName) source);
                      } else {
                          nr = new NotificationRecord(n, (source != null) ? source.toString() : null);
                      }
                      records[i] = nr;
                  }
              }
          } else {
              records = null;
          }
          writeNotificationRecords(out, records);
      }