@Test public void testVersions() { assertEquals(8, JavaVersionUtil.getMajorVersion("1.8.0_171")); assertEquals(9, JavaVersionUtil.getMajorVersion("9")); assertEquals(10, JavaVersionUtil.getMajorVersion("10")); assertEquals(11, JavaVersionUtil.getMajorVersion("11")); }
public static int getMajorVersion() { return getMajorVersion(System.getProperty("java.specification.version")); }
JavaVersionUtil { public static int getMajorVersion() { return getMajorVersion(System.getProperty("java.specification.version")); } }
JavaVersionUtil { public static int getMajorVersion() { return getMajorVersion(System.getProperty("java.specification.version")); }  }
JavaVersionUtil { public static int getMajorVersion() { return getMajorVersion(System.getProperty("java.specification.version")); }  static int getMajorVersion(); }
JavaVersionUtil { public static int getMajorVersion() { return getMajorVersion(System.getProperty("java.specification.version")); }  static int getMajorVersion();  }