### Question:
DefaultValueOnErrorDecorator extends AbstractDecoratorCommand<R> implements CanonCommand<R> { @Override public R get() { try { return getDelegate().get(); } catch (Exception e) { return defaultValue; } } DefaultValueOnErrorDecorator(final CanonCommand<R> delegate);  DefaultValueOnErrorDecorator(final CanonCommand<R> delegate, final R defaultValue);  DefaultValueOnErrorDecorator(final FakeClassArgument fake, final DefaultValueOnErrorDecorator<R> toCopy); @Override R get(); @Override Optional<R> getOpt();  }### Answer:
@Test void get() { final DefaultValueOnErrorDecorator<String> decorator = new DefaultValueOnErrorDecorator<>(command); decorator.run(); Assertions.assertNotNull(decorator.get()); Assertions.assertEquals("value", decorator.get()); }
@Test void getDefaultOnError() { final DefaultValueOnErrorDecorator<String> decorator = new DefaultValueOnErrorDecorator<>(commandThrows, "default"); decorator.run(); Assertions.assertNotNull(decorator.get()); Assertions.assertEquals("default", decorator.get()); }