### Question:
BayesianNetwork { public void save(NetworkSaver networkSaver) { if (isAllSavable()) { for (Vertex vertex : TopologicalSort.sort(vertices)) { networkSaver.save(unwrapIfNeeded(vertex)); } } else { throw new IllegalArgumentException("Trying to save a BayesianNetwork that isn't Saveable"); } } BayesianNetwork(Set<? extends Vertex> vertices);  BayesianNetwork(Collection<? extends Vertex> vertices); Vertex getVertexByLabel(VertexLabel label); List<Vertex> getVerticesInNamespace(String... namespace); List<Vertex> getVerticesIgnoringNamespace(String innerNamespace); int getVertexCount(); double getAverageVertexDegree(); void setState(NetworkState state); List<Vertex> getAllVertices(); List<? extends Vertex> getVertices(); List<Vertex> getLatentOrObservedVertices(); List<Vertex> getTopLevelLatentOrObservedVertices(); List<Vertex> getLatentVertices(); List<Vertex> getTopLevelLatentVertices(); List<Vertex> getObservedVertices(); List<Vertex> getTopLevelObservedVertices(); double getLogOfMasterP(); void cascadeObservations(); void probeForNonZeroProbability(int attempts); void probeForNonZeroProbability(int attempts, KeanuRandom random); boolean isInImpossibleState(); static void setFromSampleAndCascade(List<? extends Vertex> vertices); static void setFromSampleAndCascade(List<? extends Vertex> vertices, KeanuRandom random); List<DoubleVertex> getContinuousLatentVertices(); List<Vertex> getDiscreteLatentVertices(); int getIndentation(); void incrementIndentation(); void save(NetworkSaver networkSaver); void saveValues(NetworkSaver networkSaver); Set<Vertex> getSubgraph(Vertex vertex, int degree);  }### Answer:
@Test(expected = IllegalArgumentException.class) public void networkWithNonSaveableVerticesThrowsExceptionOnSave() throws IOException { DoubleVertex testVertex = new TestNonSaveableVertex(); BayesianNetwork net = new BayesianNetwork(testVertex.getConnectedGraph()); NetworkSaver netSaver = mock(NetworkSaver.class); net.save(netSaver); }