code: public IPv6AddressPool deAllocate(final IPv6Network toDeAllocate)
      {
          if (!contains(toDeAllocate))
          {
              throw new IllegalArgumentException(
                      "Network to de-allocate[" + toDeAllocate + "] is not contained in this allocatable range [" + this + "]");
          }
  
          // find ranges just in front or after the network to deallocate. These are the ranges to merge with to prevent fragmentation.
          final IPv6AddressRange freeRangeBeforeNetwork = findFreeRangeBefore(toDeAllocate);
          final IPv6AddressRange freeRangeAfterNetwork = findFreeRangeAfter(toDeAllocate);
  
          final TreeSet<IPv6AddressRange> newFreeRanges = new TreeSet<IPv6AddressRange>(this.freeRanges);
  
          if ((freeRangeBeforeNetwork == null) && (freeRangeAfterNetwork == null))
          {
              // nothing to "defragment"
              newFreeRanges.add(toDeAllocate);
          }
          else
          {
              if ((freeRangeBeforeNetwork != null) && (freeRangeAfterNetwork != null))
              {
                  // merge two existing ranges
                  newFreeRanges.remove(freeRangeBeforeNetwork);
                  newFreeRanges.remove(freeRangeAfterNetwork);
                  newFreeRanges.add(IPv6AddressRange
                          .fromFirstAndLast(freeRangeBeforeNetwork.getFirst(), freeRangeAfterNetwork.getLast()));
              }
              else if (freeRangeBeforeNetwork != null)
              {
                  // append
                  newFreeRanges.remove(freeRangeBeforeNetwork);
                  newFreeRanges.add(IPv6AddressRange.fromFirstAndLast(freeRangeBeforeNetwork.getFirst(), toDeAllocate.getLast()));
              }
              else /*if (freeRangeAfterNetwork != null)*/
              {
                  // prepend
                  newFreeRanges.remove(freeRangeAfterNetwork);
                  newFreeRanges.add(IPv6AddressRange.fromFirstAndLast(toDeAllocate.getFirst(), freeRangeAfterNetwork.getLast()));
              }
          }
  
          return new IPv6AddressPool(underlyingRange, allocationSubnetSize, newFreeRanges, getLastAllocated());
      }
docs: Give a network back to the pool (de-allocate).
  
  @param toDeAllocate network to de-allocate