@Test public void testIsNotSameParentNull() { Node parent = new NodeImpl<>("parentUUID"); Node child1 = new NodeImpl<>("child1"); setAsChild(parent, child1); Node child2 = new NodeImpl<>("child2"); setAsChild(parent, child2); Node[] children = {child1, child2}; boolean isSameParent = ContainmentAcceptorControlImpl.areInSameParent(null, children); assertFalse(isSameParent); }
static boolean areInSameParent(final Element parent, final Node[] children) { return Stream.of(children) .map(GraphUtils::getParent) .noneMatch(childParent -> !Objects.equals(parent, childParent)); }
ContainmentAcceptorControlImpl extends AbstractAcceptorControl implements ContainmentAcceptorControl<AbstractCanvasHandler> { static boolean areInSameParent(final Element parent, final Node[] children) { return Stream.of(children) .map(GraphUtils::getParent) .noneMatch(childParent -> !Objects.equals(parent, childParent)); } }
ContainmentAcceptorControlImpl extends AbstractAcceptorControl implements ContainmentAcceptorControl<AbstractCanvasHandler> { static boolean areInSameParent(final Element parent, final Node[] children) { return Stream.of(children) .map(GraphUtils::getParent) .noneMatch(childParent -> !Objects.equals(parent, childParent)); } @Inject  ContainmentAcceptorControlImpl(final CanvasCommandFactory<AbstractCanvasHandler> canvasCommandFactory,
                                          final CanvasHighlight canvasHighlight); }
ContainmentAcceptorControlImpl extends AbstractAcceptorControl implements ContainmentAcceptorControl<AbstractCanvasHandler> { static boolean areInSameParent(final Element parent, final Node[] children) { return Stream.of(children) .map(GraphUtils::getParent) .noneMatch(childParent -> !Objects.equals(parent, childParent)); } @Inject  ContainmentAcceptorControlImpl(final CanvasCommandFactory<AbstractCanvasHandler> canvasCommandFactory,
                                          final CanvasHighlight canvasHighlight); @Override boolean allow(final Element parent,
                         final Node[] children); @Override boolean accept(final Element parent,
                          final Node[] children); }
ContainmentAcceptorControlImpl extends AbstractAcceptorControl implements ContainmentAcceptorControl<AbstractCanvasHandler> { static boolean areInSameParent(final Element parent, final Node[] children) { return Stream.of(children) .map(GraphUtils::getParent) .noneMatch(childParent -> !Objects.equals(parent, childParent)); } @Inject  ContainmentAcceptorControlImpl(final CanvasCommandFactory<AbstractCanvasHandler> canvasCommandFactory,
                                          final CanvasHighlight canvasHighlight); @Override boolean allow(final Element parent,
                         final Node[] children); @Override boolean accept(final Element parent,
                          final Node[] children);  }