@Test
public void testThousandRandomConfigurations() {

  // Thousand random configurations (some duplicate configurations possible)
  final int thousandConfigs = 1000;
  for (int i = 0; i < thousandConfigs; i++) {
    //LOG.info("Doing {}", i);
    final int numOfTotalMethods = 13;
    final int methodIndex = random.nextInt(numOfTotalMethods);
    switch (methodIndex) {
      // Annotation methods
      // For simplicity, we test only the EPs for which all possible values are valid.
      case 0:
        selectRandomVertex().setProperty(randomCSP());
        break;
      case 1:
        selectRandomVertex().setProperty(randomRLP());
        break;
      case 2:
        selectRandomVertex().setProperty(randomRPP());
        break;
      case 3:
        selectRandomVertex().setProperty(randomRSP());
        break;
      case 4:
        selectRandomEdge().setProperty(randomDFP());
        break;
      case 5:
        selectRandomEdge().setProperty(randomDPP());
        break;
      case 6:
        selectRandomEdge().setProperty(randomDSP());
        break;
      // Reshaping methods
      case 7:
        final RelayVertex relayVertex = new RelayVertex();
        final IREdge edgeToStreamize = selectRandomEdge();
        if (!(edgeToStreamize.getPropertyValue(MessageIdEdgeProperty.class).isPresent()
          && !edgeToStreamize.getPropertyValue(MessageIdEdgeProperty.class).get().isEmpty())) {
          irdag.insert(relayVertex, edgeToStreamize);
        }
        break;
      case 8:
        insertNewTriggerVertex(irdag, selectRandomEdge());
        break;
      case 9:
        final IRVertex vertexToSample = selectRandomNonUtilityVertex();
        final SamplingVertex samplingVertex = new SamplingVertex(vertexToSample, 0.1f);
        irdag.insert(Sets.newHashSet(samplingVertex), Sets.newHashSet(vertexToSample));
        break;
      case 10:
        insertNewSignalVertex(irdag, selectRandomEdge());
        break;
      case 11:
        insertNewSplitterVertex(irdag, selectRandomEdge());
        break;
      case 12:
        // the last index must be (numOfTotalMethods - 1)
        selectRandomUtilityVertex().ifPresent(irdag::delete);
        break;
      default:
        throw new IllegalStateException(String.valueOf(methodIndex));
    }
    if (i % (thousandConfigs / 10) == 0) {
      // Uncomment to visualize 10 DAG snapshots
      // irdag.storeJSON("test_10_snapshots", String.valueOf(i), "test");
    }
    if (methodIndex >= 7) {
      // Uncomment to visualize DAG snapshots after reshaping (insert, delete)
      //irdag.storeJSON("test_reshaping_snapshots", i + "(methodIndex_" + methodIndex + ")", "test");
    }
    // Must always pass
    mustPass();
  }
}