if (numberOfNodes < 1)
throw new IllegalArgumentException("invalid size of network");
List<NetworkManager> nodes = new ArrayList<NetworkManager>(numberOfNodes);
// create the first node (initial)
INetworkConfiguration netConfig = NetworkConfiguration.create("Node A");
NetworkManager initial = new NetworkManager(netConfig);
initial.connect();
nodes.add(initial);
// create the other nodes and bootstrap them to the initial peer
char letter = 'A';
for (int i = 1; i < numberOfNodes; i++) {
try {
INetworkConfiguration otherNetConfig = NetworkConfiguration.create(String.format("Node %s", ++letter),
InetAddress.getLocalHost());
NetworkManager node = new NetworkManager(otherNetConfig);
node.connect();
nodes.add(node);
} catch (UnknownHostException e) {