@Theory
  public void unitLaw(Integer x) {
    Integer left = sumMonoid.multiply(0, x);
    Integer right = sumMonoid.multiply(x, 0);

    assertThat(left, is(x));
    assertThat(right, is(x));
  }
 @Theory
 public void sumBinOp(Integer x, Integer y) {
   Integer actual = sumMonoid.multiply(x, y);
   assertThat(actual, is(x + y));
 }
Esempio n. 3
-1
 @Test
 public void sumUnitIsZero() {
   assertThat(sumMonoid.unit(), is(0));
 }