private static Artifact newArtifact(Path sourceJar) {
    Artifact artifact = mock(Artifact.class);
    when(artifact.getFile()).thenReturn(sourceJar.toFile());
    return artifact;
  }
Helper for reading back layers in a {@link BuildContext}.
jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/MavenProjectPropertiesTest.java