code: static int majorVersion(final String javaSpecVersion) {
          final String[] components = javaSpecVersion.split("\\.");
          final int[] version = new int[components.length];
          for (int i = 0; i < components.length; i++) {
              version[i] = Integer.parseInt(components[i]);
          }
  
          if (version[0] == 1) {
              assert version[1] >= 6;
              return version[1];
          } else {
              return version[0];
          }
      }
docs: Package-private for testing only