SopremoPlan implements Serializable { public void setSinks(final Sink... sinks) { this.setSinks(Arrays.asList(sinks)); } SopremoPlan(); Plan asPactPlan(); List<String> getRequiredPackages(); void setRequiredPackages(List<String> packageNames); void addRequiredPackage(String packageName); void setSinks(final Sink... sinks); void setSinks(final List<Sink> sinks); Schema getSchema(); Collection<Contract> assemblePact(); Iterable<? extends Operator<?>> getContainedOperators(); EvaluationContext getEvaluationContext(); void setContext(final EvaluationContext context); @Override String toString(); @Override int hashCode(); @Override boolean equals(final Object obj); List<Operator<?>> getUnmatchingOperators(final SopremoPlan other);  }
@Test public void shouldBeSerializable() throws IOException { final SopremoPlan plan = new SopremoPlan(); final Source input = new Source("input"); final Sink output = new Sink("output").withInputs(input); plan.setSinks(output); final ByteArrayOutputStream baos = new ByteArrayOutputStream(); SopremoUtil.serializeObject(new DataOutputStream(baos), plan); final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); final SopremoPlan deserializedPlan = SopremoUtil.deserializeObject(new DataInputStream(bais), SopremoPlan.class); Assert.assertEquals(plan, deserializedPlan); }