### Question:
RequireJsPackageConfigurationImpl implements IRequireJsPackageConfiguration { @Override public Map<String, String> getModuleIdsMapping() { if ( this.baseModuleIdsMappingsWithDependencies == null ) { throw new IllegalStateException( "Configuration wasn't yet initialized with processDependencies" ); } return Collections.unmodifiableMap( this.baseModuleIdsMappingsWithDependencies ); } RequireJsPackageConfigurationImpl( IRequireJsPackage requireJsPackage ); @Override void processRequireJsPackage(); @Override void processDependencies( BiFunction<String, String, IRequireJsPackageConfiguration> dependencyResolver ); @Override Map<String, Object> getRequireConfig( List<IRequireJsPackageConfigurationPlugin> plugins ); @Override Map<String, String> getBaseModuleIdsMapping(); @Override Map<String, String> getModuleIdsMapping(); @Override IRequireJsPackage getRequireJsPackage(); @Override String getName(); @Override String getVersion(); @Override Map<String, String> getDependencies(); @Override boolean hasScript( final String name ); @Override URL getScriptResource( final String name ); @Override String getWebRootPath();  }### Answer:
@Test(expected = IllegalStateException.class) public void getModuleIdsMappingBeforeProcessDependencies() { IRequireJsPackage mockRequireJsPackage = getRequireJsPackageMock( name, version, webRoot, modules, dependencies ); RequireJsPackageConfigurationImpl packageConfiguration = new RequireJsPackageConfigurationImpl( mockRequireJsPackage ); packageConfiguration.getModuleIdsMapping(); }
@Test public void getModuleIdsMapping() { IRequireJsPackage mockRequireJsPackage = getRequireJsPackageMock( name, version, webRoot, modules, dependencies ); RequireJsPackageConfigurationImpl packageConfiguration = new RequireJsPackageConfigurationImpl( mockRequireJsPackage ); packageConfiguration.processDependencies( getMockDependencyResolverFunction() ); Map<String, String> moduleIdsMapping = packageConfiguration.getModuleIdsMapping(); assertEquals( "Should return mappings with its own base moduleIds and of its resolved dependencies (all but @dep/B)", modules.size() + dependencyABaseModuleIdsMapping.size() + dependencyCBaseModuleIdsMapping.size(), moduleIdsMapping.size() ); modules.forEach( ( moduleId, path ) -> { assertTrue( "Maps a versioned ID to each module", moduleIdsMapping.containsKey( moduleId ) ); } ); dependencyABaseModuleIdsMapping.forEach( ( moduleId, mappedModuleId ) -> { assertTrue( "Maps a versioned ID to each dependency module", moduleIdsMapping.containsKey( moduleId ) ); assertEquals( "Maps a versioned ID to each dependency module", moduleIdsMapping.get( moduleId ), mappedModuleId ); } ); dependencyCBaseModuleIdsMapping.forEach( ( moduleId, mappedModuleId ) -> { assertTrue( "Maps a versioned ID to each dependency module", moduleIdsMapping.containsKey( moduleId ) ); assertEquals( "Maps a versioned ID to each dependency module", moduleIdsMapping.get( moduleId ), mappedModuleId ); } ); }