NumberNode extends Node { @Override public Optional<NumberNode> asNumberNode() { return Optional.of(this); } NumberNode(Number value, SourceLocation sourceLocation); Number getValue(); boolean isNaturalNumber(); boolean isFloatingPointNumber(); @Override NodeType getType(); @Override R accept(NodeVisitor<R> visitor); @Override NumberNode expectNumberNode(String errorMessage); @Override Optional<NumberNode> asNumberNode(); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString();  }
@Test public void convertsToNumberNode() { assertTrue(Node.from(10).asNumberNode().isPresent()); }