@Test
public void open() {

  Binary binary = mock(Binary.class);
  when(binary.open(any(DRes.class), any(int.class)))
      .then(
          invocationOnMock -> {
            firstArgument = invocationOnMock.getArgument(0);
            secondArgument = invocationOnMock.getArgument(1);
            return null;
          });
  BinaryLoggingDecorator decorator = new BinaryLoggingDecorator(binary);
  DRes<SBool> toOpen = mock(DRes.class);
  decorator.open(toOpen, 2);
  Assert.assertEquals(toOpen, firstArgument);
  Assert.assertEquals(2, secondArgument);
}