PossibleState implements Serializable { public String toString() { return "<" + nextState.getId() + ";" + variables.toString() + ">"; } PossibleState(final TransitionTarget nextState, final Map<String, String> variables); String toString();  }
@Test public void toStringTest() { TransitionTarget dummyState = new TransitionTarget() { }; dummyState.setId("Dummy State"); Map<String, String> variables = new HashMap<>(); PossibleState testState = new PossibleState(dummyState, variables); Assert.assertEquals("<Dummy State;{}>", testState.toString()); }