protected void writeSections(Collection<ProtobufSystemInfo.Section> sections, JsonWriter json) { SystemInfoUtils .order(sections, ORDERED_SECTION_NAMES) .forEach(section -> writeSection(section, json)); }
@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) .collect(Collectors.toList()); assertThat(ordered).isEqualTo(asList("foo", "bar", "end1", "end2")); }
protected void writeSections(Collection<ProtobufSystemInfo.Section> sections, JsonWriter json) { SystemInfoUtils .order(sections, ORDERED_SECTION_NAMES) .forEach(section -> writeSection(section, json)); }