ArrayNode extends Node implements Iterable<Node> { public List<Node> getElements() { return elements; } ArrayNode(List<Node> elements, SourceLocation sourceLocation);   ArrayNode(List<Node> elements, SourceLocation sourceLocation, boolean defensiveCopy); @Override Iterator<Node> iterator(); @Override NodeType getType(); @Override R accept(NodeVisitor<R> visitor); @Override ArrayNode expectArrayNode(String errorMessage); @Override Optional<ArrayNode> asArrayNode(); List<Node> getElements(); Optional<Node> get(int index); boolean isEmpty(); int size(); ArrayNode withValue(Node node); List<T> getElementsAs(Class<T> type); @SuppressWarnings("unchecked") List<T> getElementsAs(Function<K, T> f); ArrayNode merge(ArrayNode other); static Collector<T, List<Node>, ArrayNode> collect(); static Collector<T, List<Node>, ArrayNode> collect(SourceLocation sloc); @Override boolean equals(Object other); @Override int hashCode();  }
@Test public void hasElements() { List<Node> elements = Arrays.asList(Node.from("abc"), Node.from("xyz")); ArrayNode node = new ArrayNode(elements, SourceLocation.none()); assertEquals(elements, node.getElements()); }
@Test public void createFromVariadic() { ArrayNode node = Node.fromStrings("a", "b"); assertThat(node.getElements(), hasSize(2)); }