### Question:
Functions { public static String resourceToJson(Resource resource) { IParser parser = CONTEXT.newJsonParser(); return parser.encodeResourceToString(resource); }  static Dataset<String> toJson(Dataset<Row> dataset, String resourceTypeUrl); static Bundle toBundle(Dataset<Row> dataset,
      String resourceTypeUrl); static String toJsonBundle(Dataset<Row> dataset, String resourceTypeUrl); static String resourceToXml(Resource resource); static String resourceToJson(Resource resource);  }### Answer:
@Test public void resourceToJson() { Dataset<String> jsonDs = Functions.toJson(conditions, "Condition"); String conditionJson = jsonDs.first(); Condition parsedCondition = (Condition) CONTEXT.newJsonParser() .parseResource(conditionJson); Assert.assertEquals(condition.getId(), parsedCondition.getId()); }