@Override protected FreezableMap<KEY, VALUE> getMap() { FreezableMap<KEY, VALUE> result = this.map; Ensure.that(result != null).orThrow("The result may not be null.", result); Ensure.that(result == null || !result.isFrozen()).orThrow("The result has to be null or may not be frozen.", result); return result; }
@Override public FreezableSet<E> toFreezableSet() { FreezableSet<E> result = super.toFreezableSet(); Ensure.that(result != null).orThrow("The result may not be null.", result); Ensure.that(result == null || !result.isFrozen()).orThrow("The result has to be null or may not be frozen.", result); return result; }
@Override public <EXCEPTION extends Exception> FiniteIterable<E> doForEach(FailableConsumer<? super E, ? extends EXCEPTION> arg0) throws EXCEPTION { FiniteIterable<E> result = super.doForEach(arg0); Ensure.that(result == this).orThrow("The result has to be <this> but was $.", result); return result; }
@Override public FreezableSet<E> toFreezableSet() { FreezableSet<E> result = super.toFreezableSet(); Ensure.that(result != null).orThrow("The result may not be null.", result); Ensure.that(result == null || !result.isFrozen()).orThrow("The result has to be null or may not be frozen.", result); return result; }
@Override public FreezableArray<E> toFreezableArray() { FreezableArray<E> result = super.toFreezableArray(); Ensure.that(result != null).orThrow("The result may not be null.", result); Ensure.that(result == null || !result.isFrozen()).orThrow("The result has to be null or may not be frozen.", result); return result; }