code: private IPv6AddressRange findFreeRangeAfter(IPv6Network network)
      {
          for (IPv6AddressRange freeRange : freeRanges)
          {
              if (freeRange.getFirst().subtract(1).equals(network.getLast()))
              {
                  return freeRange;
              }
          }
  
          // not found
          return null;
      }
docs: Private helper method to find the free range just after the given address.