@Test
  public void testValidateBaseImageVersion_compilerPluginRelease() {
    when(mockMavenProject.getPlugin("org.apache.maven.plugins:maven-compiler-plugin"))
        .thenReturn(mockPlugin);
    when(mockPlugin.getConfiguration()).thenReturn(pluginConfiguration);
    Xpp3Dom compilerRelease = new Xpp3Dom("release");
    pluginConfiguration.addChild(compilerRelease);

    compilerRelease.setValue("1.8");
    assertThat(mavenProjectProperties.getMajorJavaVersion()).isEqualTo(8);

    compilerRelease.setValue("10");
    assertThat(mavenProjectProperties.getMajorJavaVersion()).isEqualTo(10);
  }
Helper for reading back layers in a {@link BuildContext}.
jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/MavenProjectPropertiesTest.java