diff --git a/core/lib/Drupal/Core/Cache/Cache.php b/core/lib/Drupal/Core/Cache/Cache.php
index d149592..8879f6b 100644
--- a/core/lib/Drupal/Core/Cache/Cache.php
+++ b/core/lib/Drupal/Core/Cache/Cache.php
@@ -30,13 +30,8 @@ class Cache {
    * @return string[]
    *   The merged array of cache contexts.
    */
-  public static function mergeContexts() {
-    $cache_context_arrays = func_get_args();
-    $cache_contexts = [];
-    foreach ($cache_context_arrays as $contexts) {
-      $cache_contexts = array_merge($cache_contexts, $contexts);
-    }
-    $cache_contexts = array_unique($cache_contexts);
+  public static function mergeContexts($a = array(), $b = array()) {
+    $cache_contexts = array_unique(array_merge($a, $b));
     \Drupal::service('cache_contexts_manager')->validateTokens($cache_contexts);
     sort($cache_contexts);
     return $cache_contexts;
@@ -59,13 +54,8 @@ public static function mergeContexts() {
    * @return string[]
    *   The merged array of cache tags.
    */
-  public static function mergeTags() {
-    $cache_tag_arrays = func_get_args();
-    $cache_tags = [];
-    foreach ($cache_tag_arrays as $tags) {
-      $cache_tags = array_merge($cache_tags, $tags);
-    }
-    $cache_tags = array_unique($cache_tags);
+  public static function mergeTags($a = array(), $b = array()) {
+    $cache_tags = array_unique(array_merge($a, $b));
     static::validateTags($cache_tags);
     sort($cache_tags);
     return $cache_tags;
@@ -82,23 +72,17 @@ public static function mergeTags() {
    * @return int
    *   The minimum max-age value.
    */
-  public static function mergeMaxAges() {
-    $max_ages = func_get_args();
-
-    // Filter out all max-age values set to cache permanently.
-    if (in_array(Cache::PERMANENT, $max_ages)) {
-      $max_ages = array_filter($max_ages, function ($max_age) {
-        return $max_age !== Cache::PERMANENT;
-      });
-
-      // If nothing is left, then all max-age values were set to cache
-      // permanently, and then that is the result.
-      if (empty($max_ages)) {
-        return Cache::PERMANENT;
-      }
+  public static function mergeMaxAges($a = Cache::PERMANENT, $b = Cache::PERMANENT) {
+    // If one of the values is Cache::PERMANENT, return the other value.
+    if ($a == Cache::PERMANENT){
+      return $b;
+    }
+    if ($b == Cache::PERMANENT){
+      return $a;
     }
 
-    return min($max_ages);
+    // If none or the values are Cache::PERMANENT, return the minimum value.
+    return min($a, $b);
   }
 
   /**
