public static List<Section> order(Collection<Section> sections, String... orderedNames) {
    Map<String, Section> alphabeticalOrderedMap = new TreeMap<>();
    sections.forEach(section -> alphabeticalOrderedMap.put(section.getName(), section));

    List<Section> result = new ArrayList<>(sections.size());
    stream(orderedNames).forEach(name -> {
      Section section = alphabeticalOrderedMap.remove(name);
      if (section != null) {
        result.add(section);
      }
    });
    result.addAll(alphabeticalOrderedMap.values());
    return result;
  }
@Test
  public void test_order() {
    Collection<Section> sections = asList(
      newSection("end2"),
      newSection("bar"),
      newSection("end1"),
      newSection("foo"));

    List<String> ordered = SystemInfoUtils.order(sections, "foo", "bar").stream()
      .map(Section::getName)
      .toList();
    assertThat(ordered).isEqualTo(asList("foo", "bar", "end1", "end2"));
  }