@Test public void shouldConvertToVector() { final Value<Integer> value = of(1, 2, 3); final Vector<Integer> vector = value.toVector(); if (value.isSingleValued()) { assertThat(vector).isEqualTo(Vector.of(1)); } else { assertThat(vector).isEqualTo(Vector.of(1, 2, 3)); } }
@Override protected Vector<Byte> ofAll(byte[] array) { return Vector.ofAll(array); }
@Override protected Vector<Boolean> ofAll(boolean[] array) { return Vector.ofAll(array); }
@Override protected Vector<Integer> range(int from, int toExclusive) { return Vector.range(from, toExclusive); }
@Override protected Vector<Character> range(char from, char toExclusive) { return Vector.range(from, toExclusive); }
@Override protected <T> Vector<T> tabulate(int n, Function<? super Integer, ? extends T> f) { return Vector.tabulate(n, f); }
@Override protected Vector<Long> ofAll(long[] array) { return Vector.ofAll(array); }
@Override protected Vector<Float> ofAll(float[] array) { return Vector.ofAll(array); }
@Override protected Vector<Long> rangeClosedBy(long from, long toInclusive, long step) { return Vector.rangeClosedBy(from, toInclusive, step); }
@Override protected Vector<Long> rangeClosed(long from, long toInclusive) { return Vector.rangeClosed(from, toInclusive); }
@Override protected Vector<Integer> rangeClosedBy(int from, int toInclusive, int step) { return Vector.rangeClosedBy(from, toInclusive, step); }
@Override protected Vector<Integer> rangeClosed(int from, int toInclusive) { return Vector.rangeClosed(from, toInclusive); }
@Override protected Vector<Double> rangeClosedBy(double from, double toInclusive, double step) { return Vector.rangeClosedBy(from, toInclusive, step); }
@Override protected Vector<Character> rangeClosed(char from, char toInclusive) { return Vector.rangeClosed(from, toInclusive); }
@Override protected Vector<Long> range(long from, long toExclusive) { return Vector.range(from, toExclusive); }
@Override protected Vector<Character> ofAll(char[] array) { return Vector.ofAll(array); }
@Override protected Vector<Double> ofAll(double[] array) { return Vector.ofAll(array); }
@Override protected <T> Collector<T, ArrayList<T>, Vector<T>> collector() { return Vector.collector(); }
@Override protected Vector<Integer> ofAll(int[] array) { return Vector.ofAll(array); }
@Override protected <T> Vector<T> empty() { return Vector.empty(); }
@Override protected Vector<Short> ofAll(short[] array) { return Vector.ofAll(array); }
@Override protected <T> Vector<T> of(T element) { return Vector.of(element); }
@Override protected <T> Vector<T> fill(int n, Supplier<? extends T> s) { return Vector.fill(n, s); }
@SuppressWarnings("varargs") @SafeVarargs @Override protected final <T> Vector<T> of(T... elements) { return Vector.of(elements); }
@Override protected Vector<Character> rangeBy(char from, char toExclusive, int step) { return Vector.rangeBy(from, toExclusive, step); }
@Override protected <T> Vector<T> ofAll(Iterable<? extends T> elements) { return Vector.ofAll(elements); }