### Question:
AltNamesConverter implements Converter { @Override public JsonNode tinkerpopToJson(Object value) throws IOException { if (value instanceof String && !isBlank((String) value)) { JsonNode json = objectMapper.readTree((String) value); objectMapper.treeToValue(json, AltNames.class); return json.get("list"); } else { throw new IOException("must be a json value serialised as String"); } }  @Override String jsonToTinkerpop(JsonNode json); @Override JsonNode tinkerpopToJson(Object value); @Override String getGuiTypeId(); @Override String getUniqueTypeIdentifier();  }### Answer:
@Test public void tinkerpopToJsonReadsTheListOfTheAltNamesValues() throws Exception { AltNames altNames = new AltNames(); altNames.list = Lists.newArrayList(ALT_NAME_1, ALT_NAME_2); String dbValue = objectMapper.writeValueAsString(altNames); JsonNode jsonNode = instance.tinkerpopToJson(dbValue); List<AltName> altNameList = objectMapper.readValue(jsonNode.toString(), new TypeReference<List<AltName>>() { }); assertThat(altNameList, containsInAnyOrder(ALT_NAME_1, ALT_NAME_2)); }
@Test(expected = IOException.class) public void tinkerpopToJsonThrowsAnIoExceptionWhenTheValueCannotBeParsed() throws Exception { String dbValue = ""; instance.tinkerpopToJson(dbValue); }