### Question:
RequireJsGenerator { public static String getWebjarVersionFromPom( InputStream inputStream ) throws Exception { try { byte[] bytes = IOUtils.toByteArray( inputStream ); Document pom = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse( new ByteArrayInputStream( bytes ) ); XPath xPath = XPathFactory.newInstance().newXPath(); final Element document = pom.getDocumentElement(); return (String) xPath.evaluate( "/project/version", document, XPathConstants.STRING ); } catch ( Exception e ) { throw new Exception( "Error reading JS script", e ); } } private  RequireJsGenerator( Document pom ); private  RequireJsGenerator( String moduleName, String moduleVersion, String jsScript ); private  RequireJsGenerator( Map<String, Object> json ); private  RequireJsGenerator( String moduleName, String moduleVersion ); static RequireJsGenerator parsePom( InputStream inputStream ); static RequireJsGenerator processJsScript( String moduleName, String moduleVersion, InputStream inputStream ); static RequireJsGenerator parseJsonPackage( InputStream inputStream ); static RequireJsGenerator emptyGenerator( String physicalPathNamePart, String physicalPathVersionPart ); static String getWebjarVersionFromPom( InputStream inputStream ); static Map<String, Object> getPackageOverrides( String group, String artifactId, String version ); static boolean findAmdDefine( InputStream is, ArrayList<String> exports ); ModuleInfo getModuleInfo(); ModuleInfo getConvertedConfig( ArtifactInfo artifactInfo, boolean isAmdPackage, String exports, Map<String, Object> overrides );  }### Answer:
@Test public void testWebjarVersionFromPom() throws Exception { String version = RequireJsGenerator.getWebjarVersionFromPom( getResourceAsStream( POM_WEBJAR_XML ) ); assertEquals( "3.1.1", version ); }