public static function entityHandler(EntityTypeInterface $entity_type, $handler_type, $replacement_class) {
    if (get_parent_class($replacement_class) == $entity_type->getHandlerClass($handler_type)) {
      $entity_type->setHandlerClass($handler_type, $replacement_class);
    }
  }