@Override
  public int getMajorJavaVersion() {
    JavaVersion version = JavaVersion.current();
    JavaPluginExtension javaPluginExtension =
        project.getExtensions().findByType(JavaPluginExtension.class);
    if (javaPluginExtension != null) {
      version = javaPluginExtension.getTargetCompatibility();
    }
    return Integer.valueOf(version.getMajorVersion());
  }
@Test
  public void testGetMajorJavaVersion_jvm11() {
    Assume.assumeThat(JavaVersion.current(), CoreMatchers.is(JavaVersion.VERSION_11));

    assertThat(gradleProjectProperties.getMajorJavaVersion()).isEqualTo(11);
  }