diff --git a/core/lib/Drupal/Core/Cache/MemoryCache/MemoryCache.php b/core/lib/Drupal/Core/Cache/MemoryCache/MemoryCache.php
index b0d2ff502a..0a743d8896 100644
--- a/core/lib/Drupal/Core/Cache/MemoryCache/MemoryCache.php
+++ b/core/lib/Drupal/Core/Cache/MemoryCache/MemoryCache.php
@@ -49,7 +49,7 @@ protected function prepareItem($cache, $allow_invalid) {
    */
   public function set($cid, $data, $expire = Cache::PERMANENT, array $tags = []) {
     assert('\Drupal\Component\Assertion\Inspector::assertAllStrings($tags)', 'Cache Tags must be strings.');
-   $tags = array_unique($tags);
+    $tags = array_unique($tags);
 
     $this->cache[$cid] = (object) [
       'cid' => $cid,
diff --git a/core/lib/Drupal/Core/Entity/EntityStorageBase.php b/core/lib/Drupal/Core/Entity/EntityStorageBase.php
index b3888b744c..94ea8f7224 100644
--- a/core/lib/Drupal/Core/Entity/EntityStorageBase.php
+++ b/core/lib/Drupal/Core/Entity/EntityStorageBase.php
@@ -95,7 +95,12 @@ public function __construct(EntityTypeInterface $entity_type, MemoryCacheInterfa
     $this->uuidKey = $this->entityType->getKey('uuid');
     $this->langcodeKey = $this->entityType->getKey('langcode');
     $this->entityClass = $this->entityType->getClass();
-    // @todo Remove this line in Drupal 9.0.x and make $memory_cache required.
+
+    if (!isset($memory_cache)) {
+      @trigger_error('The $memory_cache parameter was added in Drupal 8.6.x and will be required in 9.0.0.', E_USER_DEPRECATED);
+      $memory_cache = \Drupal::service('entity.memory_cache');
+    }
+    $this->memoryCache = $memory_cache;
     $this->memoryCache = isset($memory_cache) ? $memory_cache : \Drupal::service('entity.memory_cache');
     $this->cacheTag = 'entity.memory_cache:' . $this->entityTypeId;
   }
@@ -115,7 +120,7 @@ public function getEntityType() {
   }
 
   /**
-   * Build a cache ID for an entity.
+   * Builds a cache ID for an entity.
    */
   protected function getCacheId($id) {
     return 'entity_storage_cache:' . $this->entityTypeId . ':' . $id;
diff --git a/core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php b/core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php
index 56d89e5d38..32d043da9e 100644
--- a/core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php
@@ -2,7 +2,7 @@
 
 namespace Drupal\Tests\Core\Entity\KeyValueStore;
 
-use Drupal\Core\Cache\StaticCache\StaticCache;
+use Drupal\Core\Cache\MemoryCache\MemoryCache;
 use Drupal\Core\Config\Entity\ConfigEntityInterface;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\Entity\EntityFieldManagerInterface;
@@ -144,7 +144,7 @@ protected function setUpKeyValueEntityStorage($uuid_key = 'uuid') {
       ->method('getCurrentLanguage')
       ->will($this->returnValue($language));
 
-    $this->entityStorage = new KeyValueEntityStorage($this->entityType, $this->keyValueStore, $this->uuidService, $this->languageManager, new StaticCache());
+    $this->entityStorage = new KeyValueEntityStorage($this->entityType, $this->keyValueStore, $this->uuidService, $this->languageManager, new MemoryCache());
     $this->entityStorage->setModuleHandler($this->moduleHandler);
 
     $container = new ContainerBuilder();
