@Test
  public void testValidateBaseImageVersion_releaseProperty() {
    when(mockMavenProperties.getProperty("maven.compiler.release")).thenReturn("1.8");
    assertThat(mavenProjectProperties.getMajorJavaVersion()).isEqualTo(8);

    when(mockMavenProperties.getProperty("maven.compiler.release")).thenReturn("1.7");
    assertThat(mavenProjectProperties.getMajorJavaVersion()).isEqualTo(7);

    when(mockMavenProperties.getProperty("maven.compiler.release")).thenReturn("9");
    assertThat(mavenProjectProperties.getMajorJavaVersion()).isEqualTo(9);
  }
Helper for reading back layers in a {@link BuildContext}.
jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/MavenProjectPropertiesTest.java