// Path: src/main/java/org/terasology/launcher/model/Build.java
// public enum Build {
//     STABLE,
//     NIGHTLY
// }
// 
// Path: src/main/java/org/terasology/launcher/model/GameIdentifier.java
// public class GameIdentifier {
// 
//     private static final Logger logger = LoggerFactory.getLogger(GameIdentifier.class);
// 
//     final String displayVersion;
//     final Build build;
//     final Profile profile;
// 
//     public GameIdentifier(String displayVersion, Build build, Profile profile) {
//         this.displayVersion = displayVersion;
//         this.build = build;
//         this.profile = profile;
//     }
// 
//     public String getDisplayVersion() {
//         return displayVersion;
//     }
// 
//     public Build getBuild() {
//         return build;
//     }
// 
//     public Profile getProfile() {
//         return profile;
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) {
//             return true;
//         }
//         if (o == null || getClass() != o.getClass()) {
//             return false;
//         }
//         GameIdentifier that = (GameIdentifier) o;
//         return displayVersion.equals(that.displayVersion)
//                 && build == that.build
//                 && profile == that.profile;
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(displayVersion, build, profile);
//     }
// 
//     @Override
//     public String toString() {
//         return MoreObjects.toStringHelper(this)
//                 .add("version", displayVersion)
//                 .add("build", build)
//                 .add("profile", profile)
//                 .toString();
//     }
// }
// 
// Path: src/main/java/org/terasology/launcher/model/GameRelease.java
// public class GameRelease {
//     final GameIdentifier id;
//     final ReleaseMetadata releaseMetadata;
//     final URL url;
// 
//     public GameRelease(GameIdentifier id, URL url, ReleaseMetadata releaseMetadata) {
//         this.id = id;
//         this.url = url;
//         this.releaseMetadata = releaseMetadata;
//     }
// 
//     public GameIdentifier getId() {
//         return id;
//     }
// 
//     public URL getUrl() {
//         return url;
//     }
// 
//     /**
//      * The changelog associated with the game release
//      */
//     public String getChangelog() {
//         return releaseMetadata.getChangelog();
//     }
// 
//     public Date getTimestamp() {
//         return releaseMetadata.getTimestamp();
//     }
// 
//     @Override
//     public String toString() {
//         return id.getDisplayVersion();
//     }
// }
// 
// Path: src/main/java/org/terasology/launcher/model/Profile.java
// public enum Profile {
//     OMEGA,
//     ENGINE
// }
// 
// Path: src/main/java/org/terasology/launcher/model/ReleaseMetadata.java
// public class ReleaseMetadata {
//     private final String changelog;
//     private final Date timestamp;
// 
//     public ReleaseMetadata(String changelog, Date timestamp) {
//         this.changelog = changelog;
//         this.timestamp = timestamp;
//     }
// 
//     /**
//      * The change log of this release as a single markdown string.
//      */
//     public String getChangelog() {
//         return changelog;
//     }
// 
//     /**
//      * The timestamp of the CI run that built this release.
//      */
//     public Date getTimestamp() {
//         return timestamp;
//     }
// }


import com.vdurmont.semver4j.Semver;
import com.vdurmont.semver4j.SemverException;
import org.kohsuke.github.GHAsset;
import org.kohsuke.github.GHRelease;
import org.kohsuke.github.GHRepository;
import org.kohsuke.github.GitHub;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.terasology.launcher.model.Build;
import org.terasology.launcher.model.GameIdentifier;
import org.terasology.launcher.model.GameRelease;
import org.terasology.launcher.model.Profile;
import org.terasology.launcher.model.ReleaseMetadata;
import java.io.IOException;
import java.net.URL;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0

package org.terasology.launcher.repositories;



public class GithubRepositoryAdapter implements ReleaseRepository {

    private static final Logger logger = LoggerFactory.getLogger(GithubRepositoryAdapter.class);

    private GitHub github;

    public GithubRepositoryAdapter() {
// Path: src/main/java/org/terasology/launcher/model/Build.java
// public enum Build {
//     STABLE,
//     NIGHTLY
// }
// 
// Path: src/main/java/org/terasology/launcher/model/GameIdentifier.java
// public class GameIdentifier {
// 
//     private static final Logger logger = LoggerFactory.getLogger(GameIdentifier.class);
// 
//     final String displayVersion;
//     final Build build;
//     final Profile profile;
// 
//     public GameIdentifier(String displayVersion, Build build, Profile profile) {
//         this.displayVersion = displayVersion;
//         this.build = build;
//         this.profile = profile;
//     }
// 
//     public String getDisplayVersion() {
//         return displayVersion;
//     }
// 
//     public Build getBuild() {
//         return build;
//     }
// 
//     public Profile getProfile() {
//         return profile;
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) {
//             return true;
//         }
//         if (o == null || getClass() != o.getClass()) {
//             return false;
//         }
//         GameIdentifier that = (GameIdentifier) o;
//         return displayVersion.equals(that.displayVersion)
//                 && build == that.build
//                 && profile == that.profile;
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(displayVersion, build, profile);
//     }
// 
//     @Override
//     public String toString() {
//         return MoreObjects.toStringHelper(this)
//                 .add("version", displayVersion)
//                 .add("build", build)
//                 .add("profile", profile)
//                 .toString();
//     }
// }
// 
// Path: src/main/java/org/terasology/launcher/model/GameRelease.java
// public class GameRelease {
//     final GameIdentifier id;
//     final ReleaseMetadata releaseMetadata;
//     final URL url;
// 
//     public GameRelease(GameIdentifier id, URL url, ReleaseMetadata releaseMetadata) {
//         this.id = id;
//         this.url = url;
//         this.releaseMetadata = releaseMetadata;
//     }
// 
//     public GameIdentifier getId() {
//         return id;
//     }
// 
//     public URL getUrl() {
//         return url;
//     }
// 
//     /**
//      * The changelog associated with the game release
//      */
//     public String getChangelog() {
//         return releaseMetadata.getChangelog();
//     }
// 
//     public Date getTimestamp() {
//         return releaseMetadata.getTimestamp();
//     }
// 
//     @Override
//     public String toString() {
//         return id.getDisplayVersion();
//     }
// }
// 
// Path: src/main/java/org/terasology/launcher/model/Profile.java
// public enum Profile {
//     OMEGA,
//     ENGINE
// }
// 
// Path: src/main/java/org/terasology/launcher/model/ReleaseMetadata.java
// public class ReleaseMetadata {
//     private final String changelog;
//     private final Date timestamp;
// 
//     public ReleaseMetadata(String changelog, Date timestamp) {
//         this.changelog = changelog;
//         this.timestamp = timestamp;
//     }
// 
//     /**
//      * The change log of this release as a single markdown string.
//      */
//     public String getChangelog() {
//         return changelog;
//     }
// 
//     /**
//      * The timestamp of the CI run that built this release.
//      */
//     public Date getTimestamp() {
//         return timestamp;
//     }
// }


// Path: src/main/java/org/terasology/launcher/repositories/GithubRepositoryAdapter.java
import com.vdurmont.semver4j.Semver;
import com.vdurmont.semver4j.SemverException;
import org.kohsuke.github.GHAsset;
import org.kohsuke.github.GHRelease;
import org.kohsuke.github.GHRepository;
import org.kohsuke.github.GitHub;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.terasology.launcher.model.Build;
import org.terasology.launcher.model.GameIdentifier;
import org.terasology.launcher.model.GameRelease;
import org.terasology.launcher.model.Profile;
import org.terasology.launcher.model.ReleaseMetadata;
import java.io.IOException;
import java.net.URL;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;

// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0

package org.terasology.launcher.repositories;



public class GithubRepositoryAdapter implements ReleaseRepository {

    private static final Logger logger = LoggerFactory.getLogger(GithubRepositoryAdapter.class);

    private GitHub github;

    public GithubRepositoryAdapter() {
        try {