protected static String getReverseZoneNetworkAddress(String baseIp, int range,
      int index) throws UnknownHostException {
    if (index < 0) {
      throw new IllegalArgumentException(
          String.format("Invalid index provided, must be positive: %d", index));
    }
    if (range < 0) {
      throw new IllegalArgumentException(
          String.format("Invalid range provided, cannot be negative: %d",
              range));
    }
    return calculateIp(baseIp, range, index);
  }
@Test
  public void testVariousRangeAndIndexValues() throws Exception {
    // Given the base address of 172.17.4.0, step 256 IP addresses, 5 times.
    assertEquals("172.17.9.0",
        ReverseZoneUtils.getReverseZoneNetworkAddress(NET, 256, 5));
    assertEquals("172.17.4.128",
        ReverseZoneUtils.getReverseZoneNetworkAddress(NET, 128, 1));
    assertEquals("172.18.0.0",
        ReverseZoneUtils.getReverseZoneNetworkAddress(NET, 256, 252));
    assertEquals("172.17.12.0",
        ReverseZoneUtils.getReverseZoneNetworkAddress(NET, 1024, 2));
    assertEquals("172.17.4.0",
        ReverseZoneUtils.getReverseZoneNetworkAddress(NET, 0, 1));
    assertEquals("172.17.4.0",
        ReverseZoneUtils.getReverseZoneNetworkAddress(NET, 1, 0));
    assertEquals("172.17.4.1",
        ReverseZoneUtils.getReverseZoneNetworkAddress(NET, 1, 1));
  }