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