### Question:
NetworkSamples { public NetworkSamples downSample(final int downSampleInterval) { Preconditions.checkArgument(downSampleInterval > 0, "Down sample interval of %s is invalid. Sample interval must be positive.", downSampleInterval); final Map<VariableReference, List<?>> withSamplesDownSampled = samplesByVariable.entrySet().parallelStream() .collect(toMap( Map.Entry::getKey, e -> downSample((List<?>) e.getValue(), downSampleInterval) ) ); final List<Double> withLogProbsDownSampled = downSample(logOfMasterPForEachSample, downSampleInterval); return new NetworkSamples(withSamplesDownSampled, withLogProbsDownSampled, size / downSampleInterval); } NetworkSamples(Map<VariableReference, ? extends List> samplesByVariable, List<Double> logOfMasterPForEachSample, int size); static NetworkSamples from(List<NetworkSample> networkSamples); int size(); Samples<T> get(Variable<T, ?> variable); Samples<T> get(VariableReference variableReference); DoubleVertexSamples getDoubleTensorSamples(Variable<DoubleTensor, ?> variable); DoubleVertexSamples getDoubleTensorSamples(VariableReference variableReference); IntegerVertexSamples getIntegerTensorSamples(Variable<IntegerTensor, ?> variable); IntegerVertexSamples getIntegerTensorSamples(VariableReference variableReference); BooleanVertexSamples getBooleanTensorSamples(Variable<BooleanTensor, ?> variable); BooleanVertexSamples getBooleanTensorSamples(VariableReference variableReference); NetworkSamples drop(int dropCount); NetworkSamples downSample(final int downSampleInterval); double probability(Function<NetworkState, Boolean> predicate); NetworkState getNetworkState(int sample); double getLogOfMasterP(int sample); List<NetworkState> toNetworkStates(); NetworkState getMostProbableState();  }### Answer:
@Test(expected = IllegalArgumentException.class) public void doesCatchInvalidDownSampleInterval() { samples.downSample(0); }