@Test public void when_node_map_from_network_state_is_modified__then_exception_is_thrown() { RadixNetworkState state = new RadixNetworkState(new HashMap<>()); Map<RadixNode, RadixNodeState> nodeMap = state.getNodeStates(); assertThatThrownBy(() -> nodeMap.put(mock(RadixNode.class), mock(RadixNodeState.class))) .isInstanceOf(UnsupportedOperationException.class); }
public Map<RadixNode, RadixNodeState> getNodeStates() { return nodes; }
RadixNetworkState { public Map<RadixNode, RadixNodeState> getNodeStates() { return nodes; } }
RadixNetworkState { public Map<RadixNode, RadixNodeState> getNodeStates() { return nodes; } RadixNetworkState(Map<RadixNode, RadixNodeState> nodes); }
RadixNetworkState { public Map<RadixNode, RadixNodeState> getNodeStates() { return nodes; } RadixNetworkState(Map<RadixNode, RadixNodeState> nodes); static RadixNetworkState of(RadixNode node, RadixNodeState state); Map<RadixNode, RadixNodeState> getNodeStates(); Set<RadixNode> getNodes(); @Override String toString(); }
RadixNetworkState { public Map<RadixNode, RadixNodeState> getNodeStates() { return nodes; } RadixNetworkState(Map<RadixNode, RadixNodeState> nodes); static RadixNetworkState of(RadixNode node, RadixNodeState state); Map<RadixNode, RadixNodeState> getNodeStates(); Set<RadixNode> getNodes(); @Override String toString();  }