### Question:
MetaInfRequireJson implements IRequireJsPackage { @Override public String getName() { return this.name; } MetaInfRequireJson( Map<String, Object> requireJsonObject ); @Override String getName(); @Override String getVersion(); @Override String getWebRootPath(); @Override boolean preferGlobal(); @Override Map<String, String> getModules(); @Override String getModuleMainFile( String moduleId ); @Override Map<String, String> getDependencies(); @Override boolean hasScript( String name ); URL getScriptResource( String name ); @Override Map<String, Map<String, ?>> getConfig(); @Override Map<String, Map<String, String>> getMap(); @Override Map<String, Map<String, ?>> getShim(); boolean isAmdPackage(); String getExports();  }### Answer:
@Test public void getName() { MetaInfRequireJson requireJson = new MetaInfRequireJson( requireMeta ); assertEquals( "Get name from only module of first version of first artifact info", "angular", requireJson.getName() ); }
@Test public void getNameMultipleModules() { ( (Map<String, Map<String, Map<String, Map<String, Object>>>>) requireMeta.get( "requirejs-osgi-meta" ) ).get( "artifacts" ).get( "org.webjars/angularjs" ).get( "1.3.0-SNAPSHOT" ).put( "5.6", new HashMap<>() ); MetaInfRequireJson requireJson = new MetaInfRequireJson( requireMeta ); assertEquals( "Get name from first artifact info", "angularjs", requireJson.getName() ); }
@Test public void getNameNoArtifactInfo() { ( (Map<String, Map<String, Map<String, Map<String, Object>>>>) requireMeta.get( "requirejs-osgi-meta" ) ).remove( "artifacts" ); MetaInfRequireJson requireJson = new MetaInfRequireJson( requireMeta ); assertEquals( "Get name from first module info", "angular", requireJson.getName() ); }
@Test public void getNameNoArtifactAndModuleInfo() { final Map<String, Map<String, Map<String, Map<String, Object>>>> meta = (Map<String, Map<String, Map<String, Map<String, Object>>>>) requireMeta.get( "requirejs-osgi-meta" ); meta.remove( "artifacts" ); meta.remove( "modules" ); MetaInfRequireJson requireJson = new MetaInfRequireJson( requireMeta ); assertEquals( "", requireJson.getName() ); }