private void validateOutputStreams() {
    outputStreams.forEach(edge -> {
      if (!edge.getTargetNodes().isEmpty()) {
        throw new IllegalArgumentException(
            String.format("Sink stream %s should not have consumers", edge.getName()));
      }
      if (edge.getSourceNodes().isEmpty()) {
        throw new IllegalArgumentException(
            String.format("Sink stream %s should have producers", edge.getName()));
      }
    });
  }
Validate the output streams should have outdegree being 0 and indegree greater than 0
samza-core/src/main/java/org/apache/samza/execution/JobGraph.java