{@link Mockito#doThrow(Throwable)}
{@link Mockito#doAnswer(Answer)}
{@link Mockito#doNothing()}
{@link Mockito#doReturn(Object)}
See examples in javadoc for {@link Mockito} @param mock @return select method for stubbing
301302303304305306307308309310
stub.doAnswer(answer); } } assert stub != null; stub.when(fetchStarter).createAndStart((String[]) any(), (BlockFetchingListener) anyObject()); String[] blockIdArray = blockIds.toArray(new String[blockIds.size()]); new RetryingBlockFetcher(conf, fetchStarter, blockIdArray, listener).start(); } }