public static OperatingSystem getCurrentPlatform() {
    String osName = System.getProperty("os.name").toLowerCase();

    for (OperatingSystem os : values()) {
      for (String alias : os.getAliases()) {
        if (osName.contains(alias)) return os;
      }
    }

    return UNKNOWN;
  }