class IpAddressUtil {

  public static List<String> ipRange(String ipStr) throws IpAddressException {
    if (ipStr.contains("-")) {
      String[] indivIp = ipStr.split("-");
      if (indivIp.length != 2) {
        throw new IpAddressException(String.format("Ip range format is invalid '%s'", ipStr));
      }
      return ipRange(indivIp[0], indivIp[1]);
    } else {
      validateFormat(ipStr);
      ArrayList<String> ips = new ArrayList<>();
      ips.add(ipStr.trim());
      return ips;
    }
  }

}