@Test public void test() { TreeMetaData meta = null; Tree condition = new IdentifierTreeImpl(meta, "x"); Tree negCondition = new UnaryExpressionTreeImpl(meta, UnaryExpressionTree.Operator.NEGATE, condition); Tree negConditionCopy = new UnaryExpressionTreeImpl(meta, UnaryExpressionTree.Operator.NEGATE, condition); Tree nativeTree = new NativeTreeImpl(meta, new TypeNativeKind(), Arrays.asList(condition)); Tree negNative = new UnaryExpressionTreeImpl(meta, UnaryExpressionTree.Operator.NEGATE, nativeTree); assertThat(negCondition.children()).containsExactly(condition); assertThat(areEquivalent(negCondition, negConditionCopy)).isTrue(); assertThat(areEquivalent(negNative, negCondition)).isFalse(); }
@Override public List<Tree> children() { return Collections.singletonList(operand); }
UnaryExpressionTreeImpl extends BaseTreeImpl implements UnaryExpressionTree { @Override public List<Tree> children() { return Collections.singletonList(operand); } }
UnaryExpressionTreeImpl extends BaseTreeImpl implements UnaryExpressionTree { @Override public List<Tree> children() { return Collections.singletonList(operand); } UnaryExpressionTreeImpl(TreeMetaData metaData, Operator operator, Tree operand); }
UnaryExpressionTreeImpl extends BaseTreeImpl implements UnaryExpressionTree { @Override public List<Tree> children() { return Collections.singletonList(operand); } UnaryExpressionTreeImpl(TreeMetaData metaData, Operator operator, Tree operand); @Override Operator operator(); @Override Tree operand(); @Override List<Tree> children(); }
UnaryExpressionTreeImpl extends BaseTreeImpl implements UnaryExpressionTree { @Override public List<Tree> children() { return Collections.singletonList(operand); } UnaryExpressionTreeImpl(TreeMetaData metaData, Operator operator, Tree operand); @Override Operator operator(); @Override Tree operand(); @Override List<Tree> children();  }