### Question:
DAGImpl implements org.apache.tez.dag.app.dag.DAG,
  EventHandler<DAGEvent> { @Override public int getTotalVertices() { readLock.lock(); try { return numVertices; } finally { readLock.unlock(); } } DAGImpl(TezDAGID dagId,
      Configuration conf,
      DAGPlan jobPlan,
      EventHandler eventHandler,
      TaskAttemptListener taskAttemptListener,
      Credentials dagCredentials,
      Clock clock,
      String appUserName,
      TaskHeartbeatHandler thh,
      AppContext appContext); @Override TezDAGID getID(); @Override Configuration getConf(); @Override DAGPlan getJobPlan(); @Override boolean checkAccess(UserGroupInformation callerUGI,
      ApplicationAccessType jobOperation); @Override Vertex getVertex(TezVertexID vertexID); @Override boolean isUber(); @Override Credentials getCredentials(); @Override UserGroupInformation getDagUGI(); @Override DAGState restoreFromEvent(HistoryEvent historyEvent); @Override TezCounters getAllCounters(); static TezCounters incrTaskCounters(
      TezCounters counters, Collection<Vertex> vertices); @Override List<String> getDiagnostics(); @Override DAGReport getReport(); @Override float getProgress(); @Override Map<TezVertexID, Vertex> getVertices(); @Override DAGState getState(); @Override DAGStatusBuilder getDAGStatus(Set<StatusGetOpts> statusOptions); @Override VertexStatusBuilder getVertexStatus(String vertexName,
      Set<StatusGetOpts> statusOptions); @Override /** * The only entry point to change the DAG. */ void handle(DAGEvent event); @Private DAGState getInternalState(); @Override String getUserName(); @Override String getName(); @Override int getTotalVertices(); @Override int getSuccessfulVertices(); @Override Map<ApplicationAccessType, String> getJobACLs(); DAGState initializeDAG(); @Override Vertex getVertex(String vertexName); @Private void constructFinalFullcounters(); @Override boolean isComplete(); final Configuration conf; }### Answer:
@Test(timeout = 5000) public void testDAGInit() { initDAG(dag); Assert.assertEquals(6, dag.getTotalVertices()); }