### Question:
FedoraUtils { public static boolean isFedoraExternalStream(KConfiguration conf, Document profileDoc) throws XPathExpressionException { XPathFactory factory = XPathFactory.newInstance(); XPath xpath = factory.newXPath(); XPathExpression expr = xpath.compile("/datastreamProfile/dsLocationType/text()"); NodeList nodes = (NodeList) expr.evaluate(profileDoc, XPathConstants.NODESET); if (nodes.getLength() > 0) { Text text = (Text) nodes.item(0); String trimedString = text.getData().trim(); return trimedString.equals("URL"); } else { return false; } }  static ArrayList<String> getRdfPids(String pid, String relation); static String findFirstPagePid(String pid); static String getDjVuImage(KConfiguration configuration, String pid); static String getFedoraStreamPath(KConfiguration conf, String pid, String stream); static String getFedoraDescribe(KConfiguration conf); static boolean isFedoraExternalStream(KConfiguration conf, Document profileDoc); static String getLocation(KConfiguration conf, Document profileDoc); static String getThumbnailFromFedora(KConfiguration configuration, String pid); static String getFedoraDatastreamsList(KConfiguration configuration, String pid); static String getVersionCompatibilityPrefix(String fedoraVersion); static final java.util.logging.Logger LOGGER; static final String RELS_EXT_STREAM; static final String IMG_THUMB_STREAM; static final String IMG_FULL_STREAM; static final String IMG_PREVIEW_STREAM; static final String ALTO_STREAM; static final String DC_STREAM; static final String BIBLIO_MODS_STREAM; static final String TEXT_OCR_STREAM; static final String MP3_STREAM; static final String OGG_STREAM; static final String WAV_STREAM; static final String MIGRATION_STREAM; static final String POLICY_STREAM; static List<String> INTERNAL_STREAM; static List<String> AUDIO_STREAMS; static List<String> FEDORA_INTERNAL_STREAMS; static final int THUMBNAIL_HEIGHT; static final int PREVIEW_HEIGHT; static final DateFormat[] XSD_DATE_FORMATS; }### Answer:
@Test public void fedoraUtilsExternalStream() throws ParserConfigurationException, SAXException, IOException, XPathExpressionException { Document extDoc = XMLUtils.parseDocument(this.getClass().getResourceAsStream("dsProfileExternal.xml")); boolean extDocBool = FedoraUtils.isFedoraExternalStream(KConfiguration.getInstance(), extDoc); TestCase.assertTrue("expect external stream", extDocBool); Document intDoc = XMLUtils.parseDocument(this.getClass().getResourceAsStream("dsProfileInternal.xml")); boolean intDocBool = FedoraUtils.isFedoraExternalStream(KConfiguration.getInstance(), intDoc); TestCase.assertFalse("expect internal stream", intDocBool); }