diff --git a/core/modules/system/tests/modules/condition_test/src/Plugin/Condition/ConditionTestDualUser.php b/core/modules/system/tests/modules/condition_test/src/Plugin/Condition/ConditionTestDualUser.php
new file mode 100644
index 0000000..0311b0e
--- /dev/null
+++ b/core/modules/system/tests/modules/condition_test/src/Plugin/Condition/ConditionTestDualUser.php
@@ -0,0 +1,42 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\condition_test\Plugin\Condition\ConditionTestDualUser.
+ */
+
+namespace Drupal\condition_test\Plugin\Condition;
+
+use Drupal\Core\Condition\ConditionPluginBase;
+
+/**
+ * Provides a condition that requires two users.
+ *
+ * @Condition(
+ *   id = "condition_test_dual_user",
+ *   label = @Translation("Dual user"),
+ *   context = {
+ *     "user1" = @ContextDefinition("entity:user", label = @Translation("User 1")),
+ *     "user2" = @ContextDefinition("entity:user", label = @Translation("User 2"))
+ *   }
+ * )
+ */
+class ConditionTestDualUser extends ConditionPluginBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function evaluate() {
+    $user1 = $this->getContextValue('user1');
+    $user2 = $this->getContextValue('user2');
+    return $user1->id() === $user2->id();
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function summary() {
+    return $this->t('This condition has two users.');
+  }
+
+}
diff --git a/core/modules/system/tests/modules/condition_test/src/Tests/ConditionTestDualUserTest.php b/core/modules/system/tests/modules/condition_test/src/Tests/ConditionTestDualUserTest.php
new file mode 100644
index 0000000..fd8d86c
--- /dev/null
+++ b/core/modules/system/tests/modules/condition_test/src/Tests/ConditionTestDualUserTest.php
@@ -0,0 +1,117 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\condition_test\Tests\ConditionTestDualUserTest.
+ */
+
+namespace Drupal\condition_test\Tests;
+
+use Drupal\Core\Plugin\Context\Context;
+use Drupal\Core\Plugin\Context\ContextDefinition;
+use Drupal\simpletest\KernelTestBase;
+use Drupal\user\Entity\User;
+
+/**
+ * Tests a condition that requires two users.
+ *
+ * @group condition_test
+ */
+class ConditionTestDualUserTest extends KernelTestBase {
+
+  /**
+   * The condition plugin manager.
+   *
+   * @var \Drupal\Core\Condition\ConditionManager
+   */
+  protected $manager;
+
+  /**
+   * An anonymous user for testing purposes.
+   *
+   * @var \Drupal\user\Entity\User
+   */
+  protected $anonymous;
+
+  /**
+   * An authenticated user for testing purposes.
+   *
+   * @var \Drupal\user\Entity\User
+   */
+  protected $authenticated;
+
+  /**
+   * {@inheritdoc}
+   */
+  public static $modules = array('system', 'user', 'field', 'condition_test');
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+
+    $this->installSchema('system', 'sequences');
+    $this->installEntitySchema('user');
+
+    $this->manager = $this->container->get('plugin.manager.condition');
+
+    // Setup an anonymous user for our tests.
+    $this->anonymous = User::create(array(
+      'uid' => 0,
+    ));
+    $this->anonymous->save();
+    $this->anonymous = User::load($this->anonymous->id());
+    // Setup an authenticated user for our tests.
+    $this->authenticated = User::create(array(
+      'name' => $this->randomMachineName(),
+    ));
+    $this->authenticated->save();
+    $this->authenticated = User::load($this->authenticated->id());
+  }
+
+  /**
+   * Tests the dual user condition.
+   */
+  public function testConditions() {
+    $this->testIdenticalUser();
+    $this->testDifferentUser();
+  }
+
+  /**
+   * Tests with both contexts mapped to the same user.
+   */
+  protected function testIdenticalUser() {
+    /** @var \Drupal\Core\Condition\ConditionPluginBase $condition */
+    $condition = $this->manager
+      ->createInstance('condition_test_dual_user')
+      // Map the anonymous user to both contexts.
+      ->setContextMapping([
+        'user1' => 'anonymous',
+        'user2' => 'anonymous',
+      ]);
+    $definition = new ContextDefinition('entity:user');
+    $contexts['anonymous'] = (new Context($definition))->setContextValue($this->anonymous);
+    \Drupal::service('context.handler')->applyContextMapping($condition, $contexts);
+    $this->assertTrue($condition->execute());
+  }
+
+  /**
+   * Tests with each context mapped to different users.
+   */
+  protected function testDifferentUser() {
+    /** @var \Drupal\Core\Condition\ConditionPluginBase $condition */
+    $condition = $this->manager
+      ->createInstance('condition_test_dual_user')
+      ->setContextMapping([
+        'user1' => 'anonymous',
+        'user2' => 'authenticated',
+      ]);
+    $definition = new ContextDefinition('entity:user');
+    $contexts['anonymous'] = (new Context($definition))->setContextValue($this->anonymous);
+    $contexts['authenticated'] = (new Context($definition))->setContextValue($this->authenticated);
+    \Drupal::service('context.handler')->applyContextMapping($condition, $contexts);
+    $this->assertFalse($condition->execute());
+  }
+
+}
