AddIdentity implements Scalar<T> { @Override public T value(final Field<T> field) { return field.addition().neutral(); }  @Override T value(final Field<T> field);  }
@Test public void addIdentityDelegatesToFieldAddition() { final MkAddition<Object> add = new MkAddition<>(new Object()); final SpyField<Object> field = new SpyField<>( new MkField<Object>(new Object(), add) ); new AddIdentity<>().value(field); MatcherAssert.assertThat( field.calls().additioned(), Matchers.is(true) ); MatcherAssert.assertThat( add.neutraled(), Matchers.is(true) ); }