@Test
public void dontConnectToAllNodesTest() {

	RadixNode connectedPeer = mock(RadixNode.class);
	Map<RadixNode, RadixNodeState> networkStateMap = IntStream.range(0, 100).boxed().collect(Collectors.toMap(
		i -> {
			if (i == 0) {
				return connectedPeer;
			}
			RadixNode peer = mock(RadixNode.class);
			return peer;
		},
		i -> mockedNodeState(i == 0 ? WebSocketStatus.CONNECTED : WebSocketStatus.DISCONNECTED)
	));
	FindANodeRequestAction request = mock(FindANodeRequestAction.class);
	FindANodeEpic findANodeFunction = new FindANodeEpic(new GetFirstSelector());
	TestObserver<RadixNodeAction> testObserver = TestObserver.create();
	findANodeFunction.epic(
		Observable.<RadixNodeAction>just(request).concatWith(Observable.never()),
		Observable.just(new RadixNetworkState(networkStateMap)).concatWith(Observable.never())
	)
	.subscribe(testObserver);
	testObserver.assertValue(u -> u.getNode().equals(connectedPeer));
	testObserver.assertValue(u -> ((FindANodeResultAction) u).getRequest().equals(request));
}