/* * Copyright 2015 Goldman Sachs. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.gs.collections.test.list; import com.gs.collections.api.list.ListIterable; import com.gs.collections.api.list.MutableList; import com.gs.collections.api.list.primitive.MutableBooleanList; import com.gs.collections.api.list.primitive.MutableByteList; import com.gs.collections.api.list.primitive.MutableCharList; import com.gs.collections.api.list.primitive.MutableDoubleList; import com.gs.collections.api.list.primitive.MutableFloatList; import com.gs.collections.api.list.primitive.MutableIntList; import com.gs.collections.api.list.primitive.MutableLongList; import com.gs.collections.api.list.primitive.MutableShortList; import com.gs.collections.impl.factory.Lists; import com.gs.collections.impl.list.mutable.primitive.BooleanArrayList; import com.gs.collections.impl.list.mutable.primitive.ByteArrayList; import com.gs.collections.impl.list.mutable.primitive.CharArrayList; import com.gs.collections.impl.list.mutable.primitive.DoubleArrayList; import com.gs.collections.impl.list.mutable.primitive.FloatArrayList; import com.gs.collections.impl.list.mutable.primitive.IntArrayList; import com.gs.collections.impl.list.mutable.primitive.LongArrayList; import com.gs.collections.impl.list.mutable.primitive.ShortArrayList; import com.gs.collections.test.RichIterableTestCase; public interface TransformsToListTrait extends RichIterableTestCase { @Override default <T> ListIterable<T> getExpectedTransformed(T... elements) { return Lists.immutable.with(elements); } @Override default <T> MutableList<T> newMutableForTransform(T... elements) { return Lists.mutable.with(elements); } @Override default MutableBooleanList newBooleanForTransform(boolean... elements) { return new BooleanArrayList(elements); } @Override default MutableByteList newByteForTransform(byte... elements) { return new ByteArrayList(elements); } @Override default MutableCharList newCharForTransform(char... elements) { return new CharArrayList(elements); } @Override default MutableDoubleList newDoubleForTransform(double... elements) { return new DoubleArrayList(elements); } @Override default MutableFloatList newFloatForTransform(float... elements) { return new FloatArrayList(elements); } @Override default MutableIntList newIntForTransform(int... elements) { return new IntArrayList(elements); } @Override default MutableLongList newLongForTransform(long... elements) { return new LongArrayList(elements); } @Override default MutableShortList newShortForTransform(short... elements) { return new ShortArrayList(elements); } }