public static <E>boolean addAllJson(Collection<JsonNode> nodes,Function<JsonNode,E> parser,Collection<E> output){
  boolean success=true;
  for (  JsonNode node : nodes) {
    E parsed=parser.apply(node);
    success&=(parsed != null);
    if (success) {
      output.add(parsed);
    }
  }
  return success;
}

public static < E > boolean addAllJson ( Collection < JsonNode > nodes , Function < JsonNode , E > parser , Collection < E > output ) { boolean success = true ; for ( JsonNode node : nodes ) { E parsed = parser . apply ( node ) ; success &= ( parsed != null ) ; if ( success ) { output . add ( parsed ) ; } } return success ; }
attempt to parse json from a list , then add all results to an output collection . this does not add nodes that cannot be parsed ( returning null )
