### Question:
Potion { public void apply(ItemStack to) { Validate.notNull(to, "itemstack cannot be null"); Validate.isTrue(to.getType() == Material.POTION, "given itemstack is not a potion"); to.setDurability(toDamageValue()); } Potion(PotionType type); @SuppressWarnings("javadoc") @Deprecated  Potion(PotionType type, Tier tier); @SuppressWarnings("javadoc") @Deprecated  Potion(PotionType type, Tier tier, boolean splash); @SuppressWarnings("javadoc") @Deprecated  Potion(PotionType type, Tier tier, boolean splash, boolean extended);  Potion(PotionType type, int level); @Deprecated  Potion(PotionType type, int level, boolean splash); @Deprecated  Potion(PotionType type, int level, boolean splash, boolean extended);  Potion(int name); Potion splash(); Potion extend(); void apply(ItemStack to); void apply(LivingEntity to); @Override boolean equals(Object obj); Collection<PotionEffect> getEffects(); int getLevel(); @Deprecated Tier getTier(); PotionType getType(); boolean hasExtendedDuration(); @Override int hashCode(); boolean isSplash(); void setHasExtendedDuration(boolean isExtended); void setSplash(boolean isSplash); @Deprecated void setTier(Tier tier); void setType(PotionType type); void setLevel(int level); @Deprecated short toDamageValue(); ItemStack toItemStack(int amount); @Deprecated static Potion fromDamage(int damage); static Potion fromItemStack(ItemStack item); static PotionBrewer getBrewer(); static void setPotionBrewer(PotionBrewer other); @Deprecated int getNameId();  }### Answer:
@Test(expected = IllegalArgumentException.class) public void illegalApplyToItemStack() { Potion potion = new Potion(PotionType.POISON); potion.apply(new ItemStack(Material.AIR, 1)); }
@Test(expected=IllegalArgumentException.class) public void nullStack() { Potion potion = new Potion(PotionType.POISON); potion.apply((ItemStack) null); }
@Test(expected=IllegalArgumentException.class) public void nullEntity() { Potion potion = new Potion(PotionType.POISON); potion.apply((LivingEntity) null); }