@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;
  }
Parses the list of platforms to a set of {@link Platform}.

@param rawConfiguration raw configuration data
@return the set of parsed platforms
@throws InvalidPlatformException if there exists a {@link PlatformConfiguration} in the
    specified platforms list that is missing required fields or has invalid values
jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/PluginConfigurationProcessor.java