Take this method
/**
* @return List of group IDs the person belongs to
*
*/
public List<String> getGroups() {
if (this.getId().equals("")) return null;
}
I would like to throw exception instead returning null, what's the exception to throw when an important parameter/dependency has not been set?