@Override
  public void execute(Context context) {
    try (StreamWriter<ProjectDump.Plugin> writer = dumpWriter.newStreamWriter(DumpElement.PLUGINS)) {

      Collection<PluginInfo> plugins = pluginRepository.getPluginInfos();
      for (PluginInfo plugin : plugins) {
        ProjectDump.Plugin.Builder builder = ProjectDump.Plugin.newBuilder();
        writer.write(convert(plugin, builder));
      }
      LoggerFactory.getLogger(getClass()).debug("{} plugins exported", plugins.size());
    }
  }
@Test
  public void test_nullable_exported_fields() {
    when(pluginRepository.getPluginInfos()).thenReturn(singletonList(
      new PluginInfo("java")));

    underTest.execute(new TestComputationStepContext());

    ProjectDump.Plugin exportedPlugin = dumpWriter.getWrittenMessagesOf(DumpElement.PLUGINS).get(0);
    assertThat(exportedPlugin.getKey()).isEqualTo("java");
    // if name is not set, then value is the same as key
    assertThat(exportedPlugin.getName()).isEqualTo("java");
    assertThat(exportedPlugin.getVersion()).isEmpty();
  }