package com.kryptnostic.rhizome.hazelcast.objects;

import java.util.*;
import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.function.UnaryOperator;
import java.util.stream.Stream;

import static com.google.common.base.Preconditions.checkNotNull;

/**
 * @author Matthew Tamayo-Rios &lt;matthew@kryptnostic.com&gt;
 */
public class DelegatedUUIDList implements List<UUID> {
    private final List<UUID> uuids;

    public DelegatedUUIDList( List<UUID> uuids ) {
        this.uuids = checkNotNull( uuids );
    }

    public static DelegatedUUIDList wrap( List<UUID> uuids ) {
        return new DelegatedUUIDList( uuids );
    }

    public List<UUID> unwrap() {
        return uuids;
    }

    @Override public int size() {
        return uuids.size();
    }

    @Override public boolean isEmpty() {
        return uuids.isEmpty();
    }

    @Override public boolean contains( Object o ) {
        return uuids.contains( o );
    }

    @Override public Iterator<UUID> iterator() {
        return uuids.iterator();
    }

    @Override public Object[] toArray() {
        return uuids.toArray();
    }

    @Override public <T> T[] toArray( T[] a ) {
        return uuids.toArray( a );
    }

    @Override public boolean add( UUID uuid ) {
        return uuids.add( uuid );
    }

    @Override public boolean remove( Object o ) {
        return uuids.remove( o );
    }

    @Override public boolean containsAll( Collection<?> c ) {
        return uuids.containsAll( c );
    }

    @Override public boolean addAll( Collection<? extends UUID> c ) {
        return uuids.addAll( c );
    }

    @Override public boolean addAll( int index, Collection<? extends UUID> c ) {
        return uuids.addAll( index, c );
    }

    @Override public boolean removeAll( Collection<?> c ) {
        return uuids.removeAll( c );
    }

    @Override public boolean retainAll( Collection<?> c ) {
        return uuids.retainAll( c );
    }

    @Override public void replaceAll( UnaryOperator<UUID> operator ) {
        uuids.replaceAll( operator );
    }

    @Override public void sort( Comparator<? super UUID> c ) {
        uuids.sort( c );
    }

    @Override public void clear() {
        uuids.clear();
    }

    @Override public boolean equals( Object o ) {
        return uuids.equals( o );
    }

    @Override public int hashCode() {
        return uuids.hashCode();
    }

    @Override public UUID get( int index ) {
        return uuids.get( index );
    }

    @Override public UUID set( int index, UUID element ) {
        return uuids.set( index, element );
    }

    @Override public void add( int index, UUID element ) {
        uuids.add( index, element );
    }

    @Override public UUID remove( int index ) {
        return uuids.remove( index );
    }

    @Override public int indexOf( Object o ) {
        return uuids.indexOf( o );
    }

    @Override public int lastIndexOf( Object o ) {
        return uuids.lastIndexOf( o );
    }

    @Override public ListIterator<UUID> listIterator() {
        return uuids.listIterator();
    }

    @Override public ListIterator<UUID> listIterator( int index ) {
        return uuids.listIterator( index );
    }

    @Override public List<UUID> subList( int fromIndex, int toIndex ) {
        return uuids.subList( fromIndex, toIndex );
    }

    @Override public Spliterator<UUID> spliterator() {
        return uuids.spliterator();
    }

    @Override public boolean removeIf( Predicate<? super UUID> filter ) {
        return uuids.removeIf( filter );
    }

    @Override public Stream<UUID> stream() {
        return uuids.stream();
    }

    @Override public Stream<UUID> parallelStream() {
        return uuids.parallelStream();
    }

    @Override public void forEach( Consumer<? super UUID> action ) {
        uuids.forEach( action );
    }
}

@@ -56,19 +56,282 @@
 ort 
-java.util.*
+static com.google.common.base.Preconditions.checkNotNull;%0A%0Aimport java.util.Arrays;%0Aimport java.util.Collection;%0Aimport java.util.Comparator;%0Aimport java.util.Iterator;%0Aimport java.util.List;%0Aimport java.util.ListIterator;%0Aimport java.util.Spliterator;%0Aimport java.util.UUID
 ;%0Aim
@@ -479,74 +479,8 @@
 m;%0A%0A
-import static com.google.common.base.Preconditions.checkNotNull;%0A%0A
 /**%0A
@@ -598,16 +598,17 @@
 st%3CUUID%3E
+ 
  %7B%0A    p
@@ -752,22 +752,16 @@
  public 
-static
  Delegat
@@ -774,25 +774,17 @@
 List
+(
  
-wrap( List%3C
 UUID
-%3E
+...
  uui
@@ -802,32 +802,23 @@
     
-return new DelegatedUUID
+this( Arrays.as
 List
@@ -820,24 +820,26 @@
 sList( uuids
+ )
  );%0A    %7D%0A%0A 
@@ -4025,11 +4025,128 @@
 );%0A    %7D
+%0A%0A    public static DelegatedUUIDList wrap( List%3CUUID%3E uuids ) %7B%0A        return new DelegatedUUIDList( uuids );%0A    %7D
 %0A%7D%0A

Add constructor