class SharedUtilities {

  public static int calculateAge(Date birthDate) {
    if (birthDate == null) {
      throw new NullPointerException("birthDate cannot be null");
    }
    LocalDate localBirthDate = birthDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
    return Period.between(localBirthDate, LocalDate.now()).getYears();
  }

}