public static <N extends IMNode<N>> Iterator<N> getChildren(
      Template template, IMNodeFactory<N> nodeFactor) {
    return new Iterator<N>() {
      private final Iterator<IMeasurementSchema> schemas =
          template.getSchemaMap().values().iterator();

      @Override
      public boolean hasNext() {
        return schemas.hasNext();
      }

      @Override
      public N next() {
        IMeasurementSchema schema = schemas.next();
        return nodeFactor
            .createMeasurementMNode(null, schema.getMeasurementName(), schema, null)
            .getAsMNode();
      }
    };
  }
When there's no measurement, represented by template or MeasurementMNode, is under this
entityMNode, it should not act as entity anymore. Before invoking this method, lock related
MTree structure first.

@param entityMNode node to be transformed
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/utils/MNodeUtils.java