DatasetWrapper implements Dataset<C, D> { @Override public <R> R compute(IgniteBiFunction<D, LearningEnvironment, R> map, IgniteBinaryOperator<R> reduce, R identity) { return delegate.compute(map, reduce, identity); } DatasetWrapper(Dataset<C, D> delegate); @Override R computeWithCtx(IgniteTriFunction<C, D, LearningEnvironment, R> map, IgniteBinaryOperator<R> reduce,
        R identity); @Override R compute(IgniteBiFunction<D, LearningEnvironment, R> map, IgniteBinaryOperator<R> reduce, R identity); @Override void close();  }
@Test @SuppressWarnings("unchecked") public void testCompute() { doReturn(42).when(dataset).compute(any(IgniteBiFunction.class), any(), any()); Integer res = (Integer) wrapper.compute(mock(IgniteBiFunction.class), mock(IgniteBinaryOperator.class), null); assertEquals(42, res.intValue()); verify(dataset, times(1)).compute(any(IgniteBiFunction.class), any(), any()); }
@Test @SuppressWarnings("unchecked") public void testCompute2() { doReturn(42).when(dataset).compute(any(IgniteBiFunction.class), any(IgniteBinaryOperator.class), any()); Integer res = (Integer) wrapper.compute(mock(IgniteFunction.class), mock(IgniteBinaryOperator.class), null); assertEquals(42, res.intValue()); verify(dataset, times(1)).compute(any(IgniteBiFunction.class), any(IgniteBinaryOperator.class), any()); }