Inventory holders can be used to register own types, handlers and data to a opened GUI for a player.
To start, we need to create our menu class that implemetns InventoryHolder and any other functions we may want. For this example, we are gonna fill the inventory and open it for player, then save the player for later ussage with our handler.
It will look something like this
import org.bukkit.Bukkit;
import org.bukkit.Material;