### Question:
BehaviorDependentDispatcher extends AbstractPropertyDispatcherDecorator { @Override public <T> boolean isPushable(Aspect<T> aspect) { if (aspect.getName().equals(LinkkiAspectDefinition.VALUE_ASPECT_NAME) && !isConsensus(forBoundObjectAndProperty(PropertyBehavior::isWritable))) { return false; } else { return super.isPushable(aspect); } } BehaviorDependentDispatcher(PropertyDispatcher wrappedDispatcher,
            PropertyBehaviorProvider provider); @Override MessageList getMessages(MessageList messageList); @SuppressWarnings("unchecked") @Override T pull(Aspect<T> aspect); @Override boolean isPushable(Aspect<T> aspect);  }### Answer:
@Test public void testNonConsensus_writable() { behaviorDispatcher = new BehaviorDependentDispatcher(wrappedDispatcher, PropertyBehaviorProvider.with(PropertyBehavior.writable(() -> false))); assertThat(behaviorDispatcher.isPushable(Aspect.of(StringUtils.EMPTY)), is(false)); }
@Test public void testIsPushable_IgnoreOtherAspect() { behaviorDispatcher = new BehaviorDependentDispatcher(new TestPropertyDispatcher(), PropertyBehaviorProvider.with(PropertyBehavior.readOnly())); boolean pushable = behaviorDispatcher.isPushable(Aspect.of("any")); assertThat(pushable, is(true)); }
@Test public void testIsPushable_ReadOnly() { behaviorDispatcher = new BehaviorDependentDispatcher(new TestPropertyDispatcher(), PropertyBehaviorProvider.with(PropertyBehavior.readOnly())); boolean pushable = behaviorDispatcher.isPushable(Aspect.of("")); assertThat(pushable, is(false)); }