### Question:
DoubleVertexSamples extends Samples<DoubleTensor> { @Override public DoubleTensor asTensor() { return DoubleTensor.stack(0, samples.stream().toArray(DoubleTensor[]::new)); } DoubleVertexSamples(List<DoubleTensor> samples); DoubleTensor getAverages(); DoubleTensor getVariances(); DoubleTensor getAutocorrelation(long... index); @Override DoubleTensor asTensor();  }### Answer:
@Test public void canGetSamplesAsTensor() { List<DoubleTensor> samplesAsList = samples.asList(); DoubleTensor samplesAsTensor = samples.asTensor(); assertThat(samplesAsTensor.getShape(), equalTo(new long[]{4, 1, 3})); List<DoubleTensor> samplesAsTensorSliced = samplesAsTensor.sliceAlongDimension(0, 0, samplesAsTensor.getShape()[0]); for (int i = 0; i < samplesAsList.size(); i++) { DoubleTensor sampleFromList = samplesAsList.get(i); DoubleTensor sampleFromTensor = samplesAsTensorSliced.get(i); assertThat(sampleFromList, valuesAndShapesMatch(sampleFromTensor)); } }