@Override
  public ProtobufSystemInfo.Section toProtobuf() {
    return toProtobuf(ManagementFactory.getMemoryMXBean());
  }
@Test
  public void should_hide_attributes_without_values() {
    MemoryMXBean memoryBean = mock(MemoryMXBean.class, Mockito.RETURNS_DEEP_STUBS);
    when(memoryBean.getHeapMemoryUsage().getCommitted()).thenReturn(-1L);

    JvmStateSection underTest = new JvmStateSection(PROCESS_NAME);
    ProtobufSystemInfo.Section section = underTest.toProtobuf(memoryBean);

    assertThat(section.getAttributesList())
      .extracting("key")
      .isNotEmpty()
      .doesNotContain("Heap Committed (MB)");
  }