use of org.eclipse.collections.impl.list.mutable.primitive.FloatArrayList in project eclipse-collections by eclipse.
the class AbstractLazyIterableTestCase method collectFloatWithTarget.
@Test
public void collectFloatWithTarget() {
MutableFloatCollection target = new FloatArrayList();
MutableFloatCollection result = this.lazyIterable.collectFloat(PrimitiveFunctions.unboxIntegerToFloat(), target);
Assert.assertEquals(FloatArrayList.newListWith(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f), result.toList());
Assert.assertSame("Target list sent as parameter not returned", target, result);
}
use of org.eclipse.collections.impl.list.mutable.primitive.FloatArrayList in project eclipse-collections by eclipse.
the class ArrayListIterateTest method collectFloatWithTarget.
@Test
public void collectFloatWithTarget() {
ArrayList<Integer> list = this.createIntegerList();
MutableFloatList target = new FloatArrayList();
MutableFloatList actual = ArrayListIterate.collectFloat(list, PrimitiveFunctions.unboxIntegerToFloat(), target);
Assert.assertSame("Target list sent as parameter not returned", target, actual);
Assert.assertEquals(FloatArrayList.newListWith(-1.0f, 0.0f, 4.0f), actual);
}
use of org.eclipse.collections.impl.list.mutable.primitive.FloatArrayList in project eclipse-collections by eclipse.
the class RandomAccessListAdapter method collectFloat.
@Override
public MutableFloatList collectFloat(FloatFunction<? super T> floatFunction) {
FloatArrayList result = new FloatArrayList(this.size());
this.forEach(new CollectFloatProcedure<>(floatFunction, result));
return result;
}
use of org.eclipse.collections.impl.list.mutable.primitive.FloatArrayList in project eclipse-collections by eclipse.
the class ImmutableEmptySortedBagTest method collectFloat.
@Override
@Test
public void collectFloat() {
ImmutableSortedBag<Integer> bag = this.classUnderTest();
Assert.assertEquals(new FloatArrayList(), bag.collectFloat(PrimitiveFunctions.unboxIntegerToFloat()));
}
Aggregations