SetupP2PConnectionTask implements Callable<Object> { @Override public P2PConfig call() throws Exception { peer.joinOrUpdateP2PSwarm( p2PConfig ); return p2PConfig; } SetupP2PConnectionTask( final Peer peer, final P2PConfig config ); @Override P2PConfig call();  }
@Test public void testCall() throws Exception { task.call(); verify( peer ).joinOrUpdateP2PSwarm( p2PConfig ); }