### Question:
JavaPackage extends Package { public JavaPackage( String id, Path metadataPath ) { super( id ); metadata.setUuid( UUID.randomUUID().toString() ); File metadataFile = new RegularFile( metadataPath, ( ) -> getMetadataContents() ); addFile( metadataFile ); } JavaPackage( String id, Path metadataPath ); PackageMetadata getMetadata(); @Override void install( Path installRoot );  }### Answer:
@Test public void testJavaPackage() throws Exception { JavaPackage pkg = new JavaPackage( "my-id", Paths.get( "usr/share/maven-metadata/my-id.xml" ) ); assertEquals( "my-id", pkg.getId() ); pkg.install( installRoot ); assertDirectoryStructure( "D /usr", "D /usr/share", "D /usr/share/maven-metadata", "F /usr/share/maven-metadata/my-id.xml" ); assertDescriptorEquals( pkg, "%attr(0644,root,root) /usr/share/maven-metadata/my-id.xml" ); }