@Test public void testNullBoundObject_messages() { wrappedDispatcher.setBoundObject(null); behaviorDispatcher = new BehaviorDependentDispatcher(wrappedDispatcher, PropertyBehaviorProvider.with(PropertyBehavior.showValidationMessages(() -> false))); Assertions.assertThrows(NullPointerException.class, () -> { behaviorDispatcher.getMessages(new MessageList()); }); }
@Override public MessageList getMessages(MessageList messageList) { if (isConsensus(forBoundObjectAndProperty(PropertyBehavior::isShowValidationMessages))) { return super.getMessages(messageList); } else { return new MessageList(); } }
BehaviorDependentDispatcher extends AbstractPropertyDispatcherDecorator { @Override public MessageList getMessages(MessageList messageList) { if (isConsensus(forBoundObjectAndProperty(PropertyBehavior::isShowValidationMessages))) { return super.getMessages(messageList); } else { return new MessageList(); } } }
BehaviorDependentDispatcher extends AbstractPropertyDispatcherDecorator { @Override public MessageList getMessages(MessageList messageList) { if (isConsensus(forBoundObjectAndProperty(PropertyBehavior::isShowValidationMessages))) { return super.getMessages(messageList); } else { return new MessageList(); } } BehaviorDependentDispatcher(PropertyDispatcher wrappedDispatcher,
            PropertyBehaviorProvider provider); }
BehaviorDependentDispatcher extends AbstractPropertyDispatcherDecorator { @Override public MessageList getMessages(MessageList messageList) { if (isConsensus(forBoundObjectAndProperty(PropertyBehavior::isShowValidationMessages))) { return super.getMessages(messageList); } else { return new MessageList(); } } BehaviorDependentDispatcher(PropertyDispatcher wrappedDispatcher,
            PropertyBehaviorProvider provider); @Override MessageList getMessages(MessageList messageList); @SuppressWarnings("unchecked") @Override T pull(Aspect<T> aspect); @Override boolean isPushable(Aspect<T> aspect); }
BehaviorDependentDispatcher extends AbstractPropertyDispatcherDecorator { @Override public MessageList getMessages(MessageList messageList) { if (isConsensus(forBoundObjectAndProperty(PropertyBehavior::isShowValidationMessages))) { return super.getMessages(messageList); } else { return new MessageList(); } } BehaviorDependentDispatcher(PropertyDispatcher wrappedDispatcher,
            PropertyBehaviorProvider provider); @Override MessageList getMessages(MessageList messageList); @SuppressWarnings("unchecked") @Override T pull(Aspect<T> aspect); @Override boolean isPushable(Aspect<T> aspect);  }