### Question:
SaxElementUtils { public static boolean isJavaScript(final String elementName, final Attributes attrs) { final String type = attrs.getValue("", "type"); final String src = attrs.getValue("", "src"); if (StringUtils.equals("script", elementName) && StringUtils.equals(type, JS_TYPE) && StringUtils.startsWith(src, "/") && !StringUtils.startsWith(src, " && StringUtils.endsWith(src, LibraryType.JS.extension)) { return true; } return false; } private  SaxElementUtils(); static boolean isCss(final String elementName, final Attributes attrs); static boolean isJavaScript(final String elementName, final Attributes attrs); static final String CSS_TYPE; static final String JS_TYPE; }### Answer:
@Test public void testIsJavascript() throws Exception { assertTrue("JS Happy Path", SaxElementUtils.isJavaScript("script", makeAtts( "src", "/js.js", "type", SaxElementUtils.JS_TYPE))); assertFalse("JS - not a link", SaxElementUtils.isJavaScript("notscript", makeAtts( "src", "/js.js", "type", SaxElementUtils.JS_TYPE))); assertFalse("JS - not a path to js file", SaxElementUtils.isJavaScript("script", makeAtts( "src", "/js.notjs", "type", SaxElementUtils.JS_TYPE))); assertFalse("JS - relative path", SaxElementUtils.isJavaScript("script", makeAtts( "src", "js.js", "type", SaxElementUtils.JS_TYPE))); assertFalse("JS - external path", SaxElementUtils.isJavaScript("script", makeAtts( "src", "http: "type", SaxElementUtils.JS_TYPE))); assertFalse("JS - wrongtype", SaxElementUtils.isJavaScript("script", makeAtts( "src", "/js.js", "type", "not" + SaxElementUtils.JS_TYPE))); }