コード例 #1
0
 @Override
 public Void answer(InvocationOnMock invocation) throws Throwable {
   Consumer consumer = (Consumer) invocation.getArguments()[0];
   Iterator<EncodedImage> iterator = mResults.iterator();
   while (iterator.hasNext()) {
     EncodedImage result = iterator.next();
     consumer.onNewResult(result, !iterator.hasNext());
   }
   return null;
 }
コード例 #2
0
 @Override
 public Void answer(InvocationOnMock invocation) throws Throwable {
   Consumer consumer = (Consumer) invocation.getArguments()[0];
   consumer.onNewResult(mResult, true);
   return null;
 }