code: @SuppressWarnings("unchecked")
    public <E> List<E> insert(List<E> entities) {
      if (entities == null || entities.isEmpty()) {
        return new ArrayList<>();
      }
      try {
        entityManager.executeEntityListeners(CallbackType.PRE_INSERT, entities);
        FullEntity<?>[] nativeEntities = toNativeFullEntities(entities, entityManager, Intent.INSERT);
        Class<?> entityClass = entities.get(0).getClass();
        List<Entity> insertedNativeEntities = nativeWriter.add(nativeEntities);
        List<E> insertedEntities = (List<E>) toEntities(entityClass, insertedNativeEntities);
        entityManager.executeEntityListeners(CallbackType.POST_INSERT, insertedEntities);
        return insertedEntities;
      } catch (DatastoreException exp) {
        throw DatastoreUtils.wrap(exp);
      }
    }
docs: Inserts the given list of entities into the Cloud Datastore.
  
  @param entities
  the entities to insert.
  @return the inserted entities. The inserted entities will not be same as the passed in
  entities. For example, the inserted entities may contain generated ID, key, parent key,
  etc.
  @throws EntityManagerException
  if any error occurs while inserting.