public static function entityClass(EntityTypeInterface $entity_type, $replacement_class) {
    if (get_parent_class($replacement_class) == $entity_type->getClass()) {
      $entity_type->setClass($replacement_class);
    }
  }