@Test public void filterNewResourcesByID() throws Exception { final Map<String, Integer> uuidMap = new HashMap<>(); uuidMap.put("abc123", 42); final InputSource inputSource = IseReplyUtil.createInputSource(iseReplyAllSgts); final NodeList allSgtResourceNodes = IseReplyUtil.findAllSgtResourceNodes(xpath, inputSource); final Collection<Node> filteredNodes = IseReplyUtil.filterNewResourcesByID(uuidMap, xpath, allSgtResourceNodes); Assert.assertEquals(1, filteredNodes.size()); Assert.assertEquals("https: }
public static Collection<Node> filterNewResourcesByID(final Map<String, Integer> uuidToSgtMap, final XPath xpath, final NodeList sgtResources) throws XPathExpressionException { final Collection<Node> nodesToExplore = new ArrayList<>(); for (int i = 0; i < sgtResources.getLength(); i++) { final String uuid = ((Node) xpath.evaluate(EXPRESSION_SGT_UUID_ATTR, sgtResources.item(i), XPathConstants.NODE)).getNodeValue(); if (!uuidToSgtMap.containsKey(uuid)) { nodesToExplore.add( (Node) xpath.evaluate(EXPRESSION_SGT_DETAIL_LINK, sgtResources.item(i), XPathConstants.NODE) ); } } return nodesToExplore; }
IseReplyUtil { public static Collection<Node> filterNewResourcesByID(final Map<String, Integer> uuidToSgtMap, final XPath xpath, final NodeList sgtResources) throws XPathExpressionException { final Collection<Node> nodesToExplore = new ArrayList<>(); for (int i = 0; i < sgtResources.getLength(); i++) { final String uuid = ((Node) xpath.evaluate(EXPRESSION_SGT_UUID_ATTR, sgtResources.item(i), XPathConstants.NODE)).getNodeValue(); if (!uuidToSgtMap.containsKey(uuid)) { nodesToExplore.add( (Node) xpath.evaluate(EXPRESSION_SGT_DETAIL_LINK, sgtResources.item(i), XPathConstants.NODE) ); } } return nodesToExplore; } }
IseReplyUtil { public static Collection<Node> filterNewResourcesByID(final Map<String, Integer> uuidToSgtMap, final XPath xpath, final NodeList sgtResources) throws XPathExpressionException { final Collection<Node> nodesToExplore = new ArrayList<>(); for (int i = 0; i < sgtResources.getLength(); i++) { final String uuid = ((Node) xpath.evaluate(EXPRESSION_SGT_UUID_ATTR, sgtResources.item(i), XPathConstants.NODE)).getNodeValue(); if (!uuidToSgtMap.containsKey(uuid)) { nodesToExplore.add( (Node) xpath.evaluate(EXPRESSION_SGT_DETAIL_LINK, sgtResources.item(i), XPathConstants.NODE) ); } } return nodesToExplore; } private  IseReplyUtil(); }
IseReplyUtil { public static Collection<Node> filterNewResourcesByID(final Map<String, Integer> uuidToSgtMap, final XPath xpath, final NodeList sgtResources) throws XPathExpressionException { final Collection<Node> nodesToExplore = new ArrayList<>(); for (int i = 0; i < sgtResources.getLength(); i++) { final String uuid = ((Node) xpath.evaluate(EXPRESSION_SGT_UUID_ATTR, sgtResources.item(i), XPathConstants.NODE)).getNodeValue(); if (!uuidToSgtMap.containsKey(uuid)) { nodesToExplore.add( (Node) xpath.evaluate(EXPRESSION_SGT_DETAIL_LINK, sgtResources.item(i), XPathConstants.NODE) ); } } return nodesToExplore; } private  IseReplyUtil(); static String deliverResponse(final WebResource.Builder requestBuilder); static XPath setupXpath(); static InputSource createInputSource(final String rawSgtDetail); static Collection<Node> filterNewResourcesByID(final Map<String, Integer> uuidToSgtMap, final XPath xpath,
                                                          final NodeList sgtResources); static NodeList findAllSgtResourceNodes(final XPath xpath, final InputSource inputSource); static Node gainSgtValue(final XPath xpath, final Node sgtNode); static Node gainSgtUuid(final XPath xpath, final Node sgtNode); static Node gainSgtName(final XPath xpath, final Node sgtNode); static Node findSgtDetailNode(final XPath xpath, final String rawSgtDetail); }
IseReplyUtil { public static Collection<Node> filterNewResourcesByID(final Map<String, Integer> uuidToSgtMap, final XPath xpath, final NodeList sgtResources) throws XPathExpressionException { final Collection<Node> nodesToExplore = new ArrayList<>(); for (int i = 0; i < sgtResources.getLength(); i++) { final String uuid = ((Node) xpath.evaluate(EXPRESSION_SGT_UUID_ATTR, sgtResources.item(i), XPathConstants.NODE)).getNodeValue(); if (!uuidToSgtMap.containsKey(uuid)) { nodesToExplore.add( (Node) xpath.evaluate(EXPRESSION_SGT_DETAIL_LINK, sgtResources.item(i), XPathConstants.NODE) ); } } return nodesToExplore; } private  IseReplyUtil(); static String deliverResponse(final WebResource.Builder requestBuilder); static XPath setupXpath(); static InputSource createInputSource(final String rawSgtDetail); static Collection<Node> filterNewResourcesByID(final Map<String, Integer> uuidToSgtMap, final XPath xpath,
                                                          final NodeList sgtResources); static NodeList findAllSgtResourceNodes(final XPath xpath, final InputSource inputSource); static Node gainSgtValue(final XPath xpath, final Node sgtNode); static Node gainSgtUuid(final XPath xpath, final Node sgtNode); static Node gainSgtName(final XPath xpath, final Node sgtNode); static Node findSgtDetailNode(final XPath xpath, final String rawSgtDetail);  }