public static function copyFrom(
        ServiceQueryBuilderDelegate $otherInstance,
        ServiceQueryBuilder $queryBuilder
    ) {
        $copyingInstance = new self();
        $copyingInstance->startIndex = $otherInstance->startIndex;
        $copyingInstance->pageSize = $otherInstance->pageSize;
        $copyingInstance->orderByFields = $otherInstance->orderByFields;
        $copyingInstance->selectFields = $otherInstance->selectFields;

        if (isset($otherInstance->whereBuilders)) {
            $copyingInstance->whereBuilders = [];
            foreach ($otherInstance->whereBuilders as $whereBuilder) {
                $copyingInstance->whereBuilders[] =
                    ServiceQueryWhereBuilder::copyFrom(
                        $whereBuilder,
                        $queryBuilder
                    );
            }
        }
        return $copyingInstance;
    }