Builder { public ItemStack build() { meta.setLore(lore); item.setItemMeta(meta); return item; } Builder(Material material);   Builder(Builder<ItemMeta, ?> source); Self amount(int amount); Self damage(int damage); Self display(@Nullable String name); Self localised(@Nullable String name); Self attribute(Attribute attribute, AttributeModifier modifier); Self model(@Nullable Integer data); Self enchantment(Enchantment enchantment, int level); Self flags(Collection<ItemFlag> flags); Self flags(ItemFlag... flags); Self lore(Collection<String> lines); Self lore(String... lines); Self unbreakable(boolean unbreakable); ItemStack build();  }
@Test void build() { var item = builder.amount(10).model(3).damage(20) .display("display name").localised("localised name") .enchantment(CHANNELING, 1).flags(Set.of(HIDE_DESTROYS)) .unbreakable(true).build(); assertEquals(item.getAmount(), 10); assertEquals(item.getItemMeta(), meta); verify((Damageable) meta).setDamage(20); verify(meta).setDisplayName("display name"); verify(meta).setLocalizedName("localised name"); verify(meta).addEnchant(CHANNELING, 1, true); verify(meta).addItemFlags(HIDE_DESTROYS); verify(meta).setCustomModelData(3); verify(meta).setUnbreakable(true); verify(meta).setLore(null); }