code: public static Set<Long> gatherLongPropertyFromJsonNodes(Iterable<JsonNode> jsonNodes, String propertyName) {
      Set<Long> result = new HashSet<Long>(); // Using a Set to filter out doubles
      for (JsonNode node : jsonNodes) {
        if (node.has(propertyName)) {
          Long propertyValue = node.get(propertyName).asLong();
          if (propertyValue > 0) { // Just to be safe
            result.add(propertyValue);
          }
        }
      }
      return result;
    }
docs: Loops through a list of {@link JsonNode} instances, and stores the given property with given type in the returned list.
  
  In Java 8, this probably could be done a lot cooler.