diff --git a/core/lib/Drupal/Core/DependencyInjection/ContainerBuilder.php b/core/lib/Drupal/Core/DependencyInjection/ContainerBuilder.php
index d6b1cd6..574398a 100644
--- a/core/lib/Drupal/Core/DependencyInjection/ContainerBuilder.php
+++ b/core/lib/Drupal/Core/DependencyInjection/ContainerBuilder.php
@@ -9,6 +9,7 @@
 
 use Symfony\Component\DependencyInjection\ContainerBuilder as SymfonyContainerBuilder;
 use Symfony\Component\DependencyInjection\Container as SymfonyContainer;
+use Symfony\Component\DependencyInjection\Definition;
 use Symfony\Component\DependencyInjection\Reference;
 use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
 
@@ -41,9 +42,7 @@ public function __construct(ParameterBagInterface $parameterBag = NULL) {
    *   services in a frozen builder.
    */
   public function set($id, $service, $scope = self::SCOPE_CONTAINER) {
-    if (strtolower($id) !== $id) {
-      throw new \InvalidArgumentException("Service ID names must be lowercase: $id");
-    }
+    $this->validateId($id);
     SymfonyContainer::set($id, $service, $scope);
 
     // Ensure that the _serviceId property is set on synthetic services as well.
@@ -55,10 +54,16 @@ public function set($id, $service, $scope = self::SCOPE_CONTAINER) {
   /**
    * {@inheritdoc}
    */
+  public function setDefinition($id, Definition $definition) {
+    $this->validateId($id);
+    return parent::setDefinition($id, $definition); // TODO: Change the autogenerated stub
+  }
+
+  /**
+   * {@inheritdoc}
+   */
   public function register($id, $class = null) {
-    if (strtolower($id) !== $id) {
-      throw new \InvalidArgumentException("Service ID names must be lowercase: $id");
-    }
+    $this->validateId($id);
     return parent::register($id, $class);
   }
 
@@ -66,9 +71,7 @@ public function register($id, $class = null) {
    * {@inheritdoc}
    */
   public function setParameter($name, $value) {
-    if (strtolower($name) !== $name) {
-      throw new \InvalidArgumentException("Parameter names must be lowercase: $name");
-    }
+    $this->validateId($name, 'Parameter');
     parent::setParameter($name, $value);
   }
 
@@ -122,4 +125,18 @@ public function __sleep() {
     return array_keys(get_object_vars($this));
   }
 
+  /**
+   * Validate Service ID or Parameter.
+   *
+   * @param string $id
+   *   The Service ID or Parameter name.
+   * @param string $type
+   *   The type of string to validate.
+   */
+  private function validateId($id, $type = 'Service ID') {
+    if (strtolower($id) !== $id) {
+      throw new \InvalidArgumentException($type . " names must be lowercase: " . $id);
+    }
+  }
+
 }
diff --git a/core/tests/Drupal/Tests/Core/DependencyInjection/ContainerBuilderTest.php b/core/tests/Drupal/Tests/Core/DependencyInjection/ContainerBuilderTest.php
index 0df17c4..4deca3e 100644
--- a/core/tests/Drupal/Tests/Core/DependencyInjection/ContainerBuilderTest.php
+++ b/core/tests/Drupal/Tests/Core/DependencyInjection/ContainerBuilderTest.php
@@ -10,6 +10,7 @@
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Tests\UnitTestCase;
 use Drupal\Tests\Core\DependencyInjection\Fixture\BarClass;
+use Symfony\Component\DependencyInjection\Definition;
 
 /**
  * @coversDefaultClass \Drupal\Core\DependencyInjection\ContainerBuilder
@@ -51,6 +52,17 @@ public function testSetException() {
   }
 
   /**
+   * @covers ::setDefinition
+   * @expectedException \InvalidArgumentException
+   * @expectedExceptionMessage Service ID names must be lowercase: Bar
+   */
+  public function testSetDefinitionException() {
+    $container = new ContainerBuilder();
+    $definition = new Definition('Drupal\Tests\Core\DependencyInjection\Fixture\BarClass');
+    $container->setDefinition('Bar', $definition);
+  }
+
+  /**
    * @covers ::setParameter
    * @expectedException \InvalidArgumentException
    * @expectedExceptionMessage Parameter names must be lowercase: Buzz
