NumberNode extends Node { @Override public NumberNode expectNumberNode(String errorMessage) { return 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 expectNumberNodeReturnsNumberNode() { Node node = Node.from(0); assertThat(node.expectNumberNode(), instanceOf(NumberNode.class)); }
@Test public void expectNumberNodeAcceptsErrorMessage() { Node node = Node.from(0); assertSame(node, node.expectNumberNode("does not raise")); }