@Override
  public ProtobufSystemInfo.Section toProtobuf() {
    ProtobufSystemInfo.Section.Builder protobuf = ProtobufSystemInfo.Section.newBuilder();
    protobuf.setName(name);

    Map<Object, Object> sortedProperties = new TreeMap<>(System.getProperties());
    for (Map.Entry<Object, Object> systemProp : sortedProperties.entrySet()) {
      if (systemProp.getValue() != null) {
        setAttribute(protobuf, Objects.toString(systemProp.getKey()), Objects.toString(systemProp.getValue()));
      }
    }
    return protobuf.build();
  }
@Test
  public void system_properties_are_returned_in_alphabetical_order() {
    ProtobufSystemInfo.Section section = underTest.toProtobuf();

    List<String> keys = section.getAttributesList()
      .stream()
      .map(ProtobufSystemInfo.Attribute::getKey)
      .toList();
    assertThat(keys).contains("java.vm.vendor", "os.name");

    List<String> sortedKeys = new ArrayList<>(keys);
    Collections.sort(sortedKeys);
    assertThat(sortedKeys).isEqualTo(keys);
  }