forEachChild(arrayCreatorRestContext, new Function<ParseTree, Void>() {
@Override
public Void apply(ParseTree input) {
if (input instanceof TerminalNode) {
if (((TerminalNode) input).getSymbol().getType() == JavaParser.LBRACK) {
ArrayCreationDimension arrayCreationDimension =
createNode(input, ArrayCreationDimension.class);
dimensions.add(arrayCreationDimension);
} else if (((TerminalNode) input).getSymbol().getType() == JavaParser.RBRACK) {
setNodeAttributes(dimensions.get(dimensions.size() - 1), null, input);
}