private Node setLabels(Node node, Collection<String> labels) { if (labels==null || labels.isEmpty()) return node; for (String label : labels) { node.addLabel(DynamicLabel.label(label)); } return node; }
private Label[] toLabels(Collection<String> labels) { if (labels==null || labels.isEmpty()) return NO_LABELS; Label[] labelArray = new Label[labels.size()]; int i=0; for (String label : labels) { labelArray[i++]= DynamicLabel.label(label); } return labelArray; }