### Question:
ResourceAttributeUtil { public String toJSON(ResourceAttribute attribute) throws EntitlementException { try { String className = attribute.getClass().getName(); return className + SEP + mapper.writeValueAsString(attribute); } catch (IOException e) { throw new EntitlementException(JSON_PARSE_ERROR, e); } } ResourceAttributeUtil();   ResourceAttributeUtil(ObjectMapper mapper); String toJSON(ResourceAttribute attribute); ResourceAttribute fromJSON(String json); static final int JSON_PARSE_ERROR; static final String SEP; }### Answer:
@Test public void shouldSerialiseMockResourceAttribute() throws EntitlementException { util = new ResourceAttributeUtil(); ResourceAttribute attribute = new MockResourceAttribute(); String result = util.toJSON(attribute); assertThat(result).isNotNull(); }