private static void removeOldParty(Hero hero, HeroParty newParty) { HeroParty party = hero.getParty(); if (party == null || (newParty != null && newParty == party)) return; party.removeMember(hero); hero.setParty(null); }