@VisibleForTesting
  static Set<Platform> getPlatformsSet(RawConfiguration rawConfiguration)
      throws InvalidPlatformException {
    Set<Platform> platforms = new LinkedHashSet<>();
    for (PlatformConfiguration platformConfiguration : rawConfiguration.getPlatforms()) {
      Optional<String> architecture = platformConfiguration.getArchitectureName();
      Optional<String> os = platformConfiguration.getOsName();
      String platformToString =
          "architecture=" + architecture.orElse("<missing>") + ", os=" + os.orElse("<missing>");

      if (!architecture.isPresent()) {
        throw new InvalidPlatformException(
            "platform configuration is missing an architecture value", platformToString);
      }
      if (!os.isPresent()) {
        throw new InvalidPlatformException(
            "platform configuration is missing an OS value", platformToString);
      }

      platforms.add(new Platform(architecture.get(), os.get()));
    }
    return platforms;
  }
@Test
  public void testGetPlatformsSet_osMissing() {
    TestPlatformConfiguration platform = new TestPlatformConfiguration("testArchitecture", null);
    Mockito.<List<?>>when(rawConfiguration.getPlatforms()).thenReturn(Arrays.asList(platform));

    InvalidPlatformException exception =
        assertThrows(
            InvalidPlatformException.class,
            () -> PluginConfigurationProcessor.getPlatformsSet(rawConfiguration));
    assertThat(exception)
        .hasMessageThat()
        .isEqualTo("platform configuration is missing an OS value");
    assertThat(exception.getInvalidPlatform())
        .isEqualTo("architecture=testArchitecture, os=<missing>");
  }