1.16.4 inventory listener

Hey there, Im trying to check if the players click on a player skull. Therefor Im using this method:

@EventHandler
    public void onCLick(InventoryClickEvent event)  {
        Player player = (Player) event.getWhoClicked();
        if(event.getView().getTitle().equals("Inventory")) {
            event.setCancelled(true);
            if(!(event.getCurrentItem().getItemMeta().getDisplayName() == player.getDisplayName())) {
                player.sendMessage("other player");
            }else{
                player.sendMessage("yourself");
            }
        }

But if I click on my own skull, I get the other “player output” and I dont know why…

This is how I create the skull item:

private ItemStack createSkull(Player player, String... lore) {
        ItemStack skull = new ItemStack(Material.PLAYER_HEAD);
        SkullMeta meta = (SkullMeta) skull.getItemMeta();
        meta.setDisplayName(player.getDisplayName());
        meta.setOwningPlayer(player);
        meta.setLore(Arrays.asList(lore));
        skull.setItemMeta(meta);
        return skull;
    }

Instead of this:

if(!(event.getCurrentItem().getItemMeta().getDisplayName() == player.getDisplayName())) {

Use this:

if(!(event.getCurrentItem().getItemMeta().getDisplayName().equals(player.getDisplayName()))) {