@Test void testNoDecorators() { CompositeTaskDecorator underTest = new CompositeTaskDecorator(List.of()); Runnable runnable = () -> { }; Runnable decoratedRunnable = underTest.decorate(runnable); assertEquals(runnable, decoratedRunnable); }
@Override public Runnable decorate(Runnable runnable) { Runnable decoratedRunnable = requireNonNull(runnable, "runnable is null"); for (TaskDecorator decorator : decorators) { decoratedRunnable = decorator.decorate(decoratedRunnable); } return decoratedRunnable; }
CompositeTaskDecorator implements TaskDecorator { @Override public Runnable decorate(Runnable runnable) { Runnable decoratedRunnable = requireNonNull(runnable, "runnable is null"); for (TaskDecorator decorator : decorators) { decoratedRunnable = decorator.decorate(decoratedRunnable); } return decoratedRunnable; } }
CompositeTaskDecorator implements TaskDecorator { @Override public Runnable decorate(Runnable runnable) { Runnable decoratedRunnable = requireNonNull(runnable, "runnable is null"); for (TaskDecorator decorator : decorators) { decoratedRunnable = decorator.decorate(decoratedRunnable); } return decoratedRunnable; } CompositeTaskDecorator(List<TaskDecorator> decorators); }
CompositeTaskDecorator implements TaskDecorator { @Override public Runnable decorate(Runnable runnable) { Runnable decoratedRunnable = requireNonNull(runnable, "runnable is null"); for (TaskDecorator decorator : decorators) { decoratedRunnable = decorator.decorate(decoratedRunnable); } return decoratedRunnable; } CompositeTaskDecorator(List<TaskDecorator> decorators); @Override Runnable decorate(Runnable runnable); }
CompositeTaskDecorator implements TaskDecorator { @Override public Runnable decorate(Runnable runnable) { Runnable decoratedRunnable = requireNonNull(runnable, "runnable is null"); for (TaskDecorator decorator : decorators) { decoratedRunnable = decorator.decorate(decoratedRunnable); } return decoratedRunnable; } CompositeTaskDecorator(List<TaskDecorator> decorators); @Override Runnable decorate(Runnable runnable);  }