### Question:
StepProgression extends AbstractReport { @Override public void print(PrintStream out, StringBuilder ret , int level, boolean first) { ret.setLength(0); out.print(addLevel(ret, level).append('{')); out.print(toJsonString(ret, level+1, "step", step, true)); out.print(toJsonString(ret, level+1, "total", total, false)); out.print(toJsonString(ret, level+1, "realized", realized, false)); ret.setLength(0); out.print(addLevel(ret.append('\n'), level).append('}')); }  JSONObject toJson(); @Override void print(PrintStream out, StringBuilder ret , int level, boolean first);  }### Answer:
@Test(groups = { "JsonGeneration" }, description = "Json generated" ,priority=105 ) public void verifyJsonGeneration() throws Exception { StepProgression stepProgression = new StepProgression(STEP.INITIALISATION, 1, 0); ByteArrayOutputStream oStream = new ByteArrayOutputStream(); PrintStream stream = new PrintStream(oStream); stepProgression.print(stream, new StringBuilder(), 1, true); String text = oStream.toString(); JSONObject res = new JSONObject(text); Assert.assertEquals(res.getString("step"), "INITIALISATION", "step must be INITIALISATION"); Assert.assertEquals(res.getInt("total"), 1, "total step number must be 1"); Assert.assertEquals(res.getInt("realized"), 0, "no step has been realized yet"); }