public static function isLastElement(array $array, $element, $firstLevelOnly = true)
    {
        $lastElement = self::getLastElement($array, $firstLevelOnly);

        return $element === $lastElement;
    }