class JavaVersions {
  private JavaVersions() {
  }

  public static int getMajorVersion() {<FILL_FUNCTION_BODY>}
}

    String version = System.getProperty("java.version");
    if(version.startsWith("1.")) {
      version = version.substring(2, 3);
    } else {
      int dot = version.indexOf(".");
      if (dot != -1) {
        version = version.substring(0, dot);
      }
    }
    return Integer.parseInt(version);
  
<no_super_class>