protected function validatePartAgainstList($value, $key)
{
if ((string) $key === (string) $this->getKeyName()) {
if ((int) $value === (int) $this->getKey()) {
$message = 'The inserted part exists inside the assembly tree. An item cannot be an assembly of itself.';
throw new InvalidPartException($message);
}
}
}