public void checkForZeroNeighbors() { if (Configuration.getNeighbors().size() == 0) { if (Configuration.getBackUpNeighbors().size() > 0) { List<Neighbor> neighbors = Configuration.getBackUpNeighbors(); Configuration.setNeighbor( neighbors.get(0).getIpAddress(), neighbors.get(0).getPortNumber()); } else { System.out.println("This node has no connections."); } } }