NumberNode extends Node { public Number getValue() { return value; } 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 zeroNodeIsEmpty() { NumberNode zero = Node.from(0); assertEquals(Integer.valueOf(0), zero.getValue()); assertEquals(SourceLocation.none(), zero.getSourceLocation()); }
@Test public void fromShort() { short number = 1; NumberNode node = Node.from(number); assertEquals(Short.valueOf(number), node.getValue()); }
@Test public void fromInteger() { int number = 1; NumberNode node = Node.from(number); assertEquals(Integer.valueOf(number), node.getValue()); }
@Test public void fromLong() { long number = 1; NumberNode node = Node.from(number); assertEquals(Long.valueOf(number), node.getValue()); }
@Test public void fromFloat() { float number = (float) 1.1; NumberNode node = Node.from(number); assertEquals(Float.valueOf(number), node.getValue()); }
@Test public void fromDouble() { double number = (float) 1.1; NumberNode node = Node.from(number); assertEquals(Double.valueOf(number), node.getValue()); }