/** * Create a new {@code MSeq} from the values of the given {@code Seq}. * * @param <T> the element type * @param values the array values. * @return an new {@code MSeq} with the given values * @throws NullPointerException if the {@code values} array is {@code null}. */ @SuppressWarnings("unchecked") public static <T> MSeq<T> of(final Seq<? extends T> values) { final MSeq<T> result; if (values instanceof MSeq) { result = ((MSeq<T>)values).copy(); } else if (values instanceof ISeq) { result = ((ISeq<T>)values).copy(); } else { result = MSeq.<T>ofLength(values.length()).setAll(values); } return result; }
@Test public void copyEmptyMSeq() { Assert.assertSame(MSeq.empty().copy(), MSeq.empty()); }
return front.subSeq(0, n).copy().toISeq();