BooleanNode extends Node { @Override public BooleanNode expectBooleanNode(String errorMessage) { return this; } BooleanNode(boolean value, SourceLocation sourceLocation); boolean getValue(); @Override NodeType getType(); @Override R accept(NodeVisitor<R> visitor); @Override BooleanNode expectBooleanNode(String errorMessage); @Override Optional<BooleanNode> asBooleanNode(); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString();  }
@Test public void expectBooleanNodeReturnsBooleanNode() { Node trueNode = Node.from(true); Node falseNode = Node.from(false); assertThat(trueNode.expectBooleanNode(), instanceOf(BooleanNode.class)); assertThat(falseNode.expectBooleanNode(), instanceOf(BooleanNode.class)); }
@Test public void expectBooleanNodeAcceptsString() { Node node = Node.from(true); assertSame(node, node.expectBooleanNode("does not raise")); }