### Question:
RequireJsPackageConfigurationImpl implements IRequireJsPackageConfiguration { @Override public String getWebRootPath() { String webRootPath = this.requireJsPackage.getWebRootPath(); return webRootPath != null ? webRootPath.replaceAll( "^/+", "" ) : ""; } 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 getWebRootPath() { IRequireJsPackage mockRequireJsPackage = getRequireJsPackageMock(); RequireJsPackageConfigurationImpl packageConfiguration = new RequireJsPackageConfigurationImpl( mockRequireJsPackage ); doReturn( webRoot ).when( mockRequireJsPackage ).getWebRootPath(); assertEquals( "Should return RequireJsPackage web root path", webRoot, packageConfiguration.getWebRootPath() ); doReturn( "/" + webRoot ).when( mockRequireJsPackage ).getWebRootPath(); assertEquals( "Should remove leading slashes", webRoot, packageConfiguration.getWebRootPath() ); doReturn( " assertEquals( "Should remove leading slashes", webRoot, packageConfiguration.getWebRootPath() ); doReturn( " assertEquals( "Should remove leading slashes", webRoot, packageConfiguration.getWebRootPath() ); }