Пример #1
0
  @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));
  }
Пример #2
0
 @Theory
 public void sumBinOp(Integer x, Integer y) {
   Integer actual = sumMonoid.multiply(x, y);
   assertThat(actual, is(x + y));
 }
Пример #3
-1
 @Test
 public void sumUnitIsZero() {
   assertThat(sumMonoid.unit(), is(0));
 }