How do I validate an entity before programmatically saving it?
Looking the api it should be simple:
$violations = $entity-&gt;validate();
  if ($violations-&gt;count() &gt; 0) {
    // Validation failed.
  }