@Test
public void when_live_peers_result_is_observed__add_node_events_should_be_emitted() {

	RadixNode node = mock(RadixNode.class);
	when(node.getPort()).thenReturn(12345);
	Observable<RadixNode> seeds = Observable.just(node);
	RadixUniverseConfig universe = mock(RadixUniverseConfig.class);
	ReplaySubject<RadixNodeAction> actions = ReplaySubject.create();
	RadixNetworkState networkState = mock(RadixNetworkState.class);
	when(networkState.getNodeStates()).thenReturn(Collections.emptyMap());
	Observable<RadixNetworkState> observableNetworkState = Observable.concat(Observable.just(networkState), Observable.never());
	DiscoverNodesEpic discoverNodesEpic = new DiscoverNodesEpic(seeds, universe);
	Observable<RadixNodeAction> output = discoverNodesEpic.epic(actions, observableNetworkState);
	TestObserver<RadixNodeAction> testObserver = TestObserver.create();
	output.subscribe(testObserver);
	NodeRunnerData data0 = mock(NodeRunnerData.class);
	when(data0.getIp()).thenReturn("1.2.3.4");
	NodeRunnerData data1 = mock(NodeRunnerData.class);
	when(data1.getIp()).thenReturn("2.3.4.5");
	List<NodeRunnerData> nodeRunnerData = Arrays.asList(data0, data1);
	actions.onNext(GetLivePeersResultAction.of(node, nodeRunnerData));
	testObserver.awaitCount(2);
	testObserver.assertValueAt(0, a -> a instanceof AddNodeAction);
	testObserver.assertValueAt(1, a -> a instanceof AddNodeAction);
}