diff --git a/core/lib/Drupal/Core/Config/Entity/Query/QueryFactory.php b/core/lib/Drupal/Core/Config/Entity/Query/QueryFactory.php
index e970819..872a8a7 100644
--- a/core/lib/Drupal/Core/Config/Entity/Query/QueryFactory.php
+++ b/core/lib/Drupal/Core/Config/Entity/Query/QueryFactory.php
@@ -10,13 +10,13 @@
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Config\StorageInterface;
 use Drupal\Core\Entity\EntityManager;
-use Drupal\Core\Entity\Query\QueryAggregateInterface;
 use Drupal\Core\Entity\Query\QueryException;
+use Drupal\Core\Entity\Query\QueryFactoryInterface;
 
 /**
  * Provides a factory for creating entity query objects for the config backend.
  */
-class QueryFactory {
+class QueryFactory implements QueryFactoryInterface {
 
   /**
    * The config storage used by the config entity query.
@@ -32,41 +32,18 @@ class QueryFactory {
    *   The config storage used by the config entity query.
    */
   public function __construct(StorageInterface $config_storage) {
-    return $this->configStorage = $config_storage;
+    $this->configStorage = $config_storage;
   }
 
   /**
-   * Instantiates an entity query for a given entity type.
-   *
-   * @param string $entity_type
-   *   The entity type for the query.
-   * @param string $conjunction
-   *   The operator to use to combine conditions: 'AND' or 'OR'.
-   * @param \Drupal\Core\Entity\EntityManager $entity_manager
-   *   The entity manager that handles the entity type.
-   *
-   * @return \Drupal\Core\Config\Entity\Query\Query
-   *   An entity query for a specific configuration entity type.
+   * {@inheritdoc}
    */
   public function get($entity_type, $conjunction, EntityManager $entity_manager) {
     return new Query($entity_type, $conjunction, $entity_manager, $this->configStorage);
   }
 
   /**
-   * Returns a aggregation query object for a given entity type.
-   *
-   * @param string $entity_type
-   *   The entity type.
-   * @param string $conjunction
-   *   - AND: all of the conditions on the query need to match.
-   *   - OR: at least one of the conditions on the query need to match.
-   *
-   * @param \Drupal\Core\Entity\EntityManager $entity_manager
-   *  The entity manager.
-   *
-   * @throws \Drupal\Core\Entity\Query\QueryException
-   * @return \Drupal\Core\Entity\Query\QueryAggregateInterface
-   *   The query object that can query the given entity type.
+   * @inheritdoc
    */
    public function getAggregate($entity_type, $conjunction, EntityManager $entity_manager) {
       throw new QueryException('Aggregation over configuration entities is not supported');
diff --git a/core/lib/Drupal/Core/Entity/Query/QueryFactoryInterface.php b/core/lib/Drupal/Core/Entity/Query/QueryFactoryInterface.php
new file mode 100644
index 0000000..51b3c34
--- /dev/null
+++ b/core/lib/Drupal/Core/Entity/Query/QueryFactoryInterface.php
@@ -0,0 +1,51 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\Entity\Query\QueryFactoryInterface.
+ */
+
+namespace Drupal\Core\Entity\Query;
+
+use Drupal\Core\Entity\EntityManager;
+
+/**
+ * Defines an interface for QueryFactory classes.
+ */
+interface QueryFactoryInterface {
+
+  /**
+   * Instantiates an entity query for a given entity type.
+   *
+   * @param string $entity_type
+   *   The entity type for the query.
+   * @param string $conjunction
+   *   The operator to use to combine conditions: 'AND' or 'OR'.
+   * @param \Drupal\Core\Entity\EntityManager $entity_manager
+   *   The entity manager that handles the entity type.
+   * @param \Drupal\Core\Entity\EntityManager $entity_manager
+   *   The entity manager that handles the entity type.
+   *
+   * @return \Drupal\Core\Entity\Query\QueryInterface
+   *   An entity query for a specific configuration entity type.
+   */
+  public function get($entity_type, $conjunction, EntityManager $entity_manager);
+
+  /**
+   * Returns a aggregation query object for a given entity type.
+   *
+   * @param string $entity_type
+   *   The entity type.
+   * @param string $conjunction
+   *   - AND: all of the conditions on the query need to match.
+   *   - OR: at least one of the conditions on the query need to match.
+   * @param \Drupal\Core\Entity\EntityManager $entity_manager
+   *   The entity manager that handles the entity type.
+   *
+   * @throws \Drupal\Core\Entity\Query\QueryException
+   * @return \Drupal\Core\Entity\Query\QueryAggregateInterface
+   *   The query object that can query the given entity type.
+   */
+  public function getAggregate($entity_type, $conjunction, EntityManager $entity_manager);
+
+}
diff --git a/core/modules/field_sql_storage/lib/Drupal/field_sql_storage/Entity/QueryFactory.php b/core/modules/field_sql_storage/lib/Drupal/field_sql_storage/Entity/QueryFactory.php
index a48608d..48f8f30 100644
--- a/core/modules/field_sql_storage/lib/Drupal/field_sql_storage/Entity/QueryFactory.php
+++ b/core/modules/field_sql_storage/lib/Drupal/field_sql_storage/Entity/QueryFactory.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Database\Connection;
 use Drupal\Core\Entity\EntityManager;
+use Drupal\Core\Entity\Query\QueryFactoryInterface;
 
 /**
  * Factory class creating entity query objects for the SQL backend.
@@ -16,7 +17,14 @@
  * @see \Drupal\field_sql_storage\Entity\Query
  * @see \Drupal\field_sql_storage\Entity\QueryAggregate
  */
-class QueryFactory {
+class QueryFactory implements QueryFactoryInterface {
+
+  /**
+   * The database connection to use.
+   *
+   * @var \Drupal\Core\Database\Connection
+   */
+  protected $connection;
 
   /**
    * Constructs a QueryFactory object.
