public static Set<NodeDetails> generateNodes(int numNodes,
      int numRacks){
    Set<NodeDetails> nodeSet = new HashSet<>();
    if (numRacks < 1) {
      numRacks = 1;
    }

    if (numRacks > numNodes) {
      numRacks = numNodes;
    }

    for (int i = 0; i < numNodes; i++) {
      nodeSet.add(new NodeDetails(
          "/rack" + i % numRacks + "/node" + i));
    }
    return nodeSet;
  }
@Test
  public void testGenerateNodes() {
    Set<NodeDetails> nodes = SLSUtils.generateNodes(3, 3);
    Assert.assertEquals("Number of nodes is wrong.", 3, nodes.size());
    Assert.assertEquals("Number of racks is wrong.", 3, getNumRack(nodes));

    nodes = SLSUtils.generateNodes(3, 1);
    Assert.assertEquals("Number of nodes is wrong.", 3, nodes.size());
    Assert.assertEquals("Number of racks is wrong.", 1, getNumRack(nodes));

    nodes = SLSUtils.generateNodes(3, 4);
    Assert.assertEquals("Number of nodes is wrong.", 3, nodes.size());
    Assert.assertEquals("Number of racks is wrong.", 3, getNumRack(nodes));

    nodes = SLSUtils.generateNodes(3, 0);
    Assert.assertEquals("Number of nodes is wrong.", 3, nodes.size());
    Assert.assertEquals("Number of racks is wrong.", 1, getNumRack(nodes));
  }