### Question:
RequireJsPackageConfigurationImpl implements IRequireJsPackageConfiguration { @Override public Map<String, String> getDependencies() { Map<String, String> dependencies = this.requireJsPackage.getDependencies(); return dependencies != null ? Collections.unmodifiableMap( dependencies ) : Collections.EMPTY_MAP; } 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 public void getDependencies() { IRequireJsPackage mockRequireJsPackage = getRequireJsPackageMock(); RequireJsPackageConfigurationImpl packageConfiguration = new RequireJsPackageConfigurationImpl( mockRequireJsPackage ); doReturn( dependencies ).when( mockRequireJsPackage ).getDependencies(); Map<String, String> packageConfigurationDependencies = packageConfiguration.getDependencies(); assertEquals( "Should return RequireJsPackage version", dependencies, packageConfigurationDependencies ); doReturn( null ).when( mockRequireJsPackage ).getDependencies(); packageConfigurationDependencies = packageConfiguration.getDependencies(); assertTrue( "Should return empty map if RequireJsPackage dependencies is null", packageConfigurationDependencies.isEmpty() ); }
@Test(expected = UnsupportedOperationException.class) public void getDependenciesReturnsUnmodifiableMap() { IRequireJsPackage mockRequireJsPackage = getRequireJsPackageMock(); RequireJsPackageConfigurationImpl packageConfiguration = new RequireJsPackageConfigurationImpl( mockRequireJsPackage ); doReturn( dependencies ).when( mockRequireJsPackage ).getDependencies(); Map<String, String> packageConfigurationDependencies = packageConfiguration.getDependencies(); packageConfigurationDependencies.put( "moduleC", "7.8" ); }