### Question:
YAMLConverter implements Converter { public <T> T convertFrom(String inYAMLString) throws ConversionException { try { return (T) YAMLConverter.YAML.load(inYAMLString); } catch (final Exception e) { final String strErrorMessage = "Conversion of YAML input :\n" + inYAMLString + "\nfailed !\n" + e.getMessage(); YAMLConverter.LOGGER.error(strErrorMessage, e); throw new ConversionException(e, strErrorMessage); } }  String getFormatName(); T convertFrom(String inYAMLString); T convertFrom(Reader inReader); String convertTo(Object inPojo); void convertTo(Object inPojo, Writer file_name); String convertTo(Object inPojo, boolean inOption); static final String YAML_FORMAT; }### Answer:
@Test public void testconvertFromYAML() { final Date testDate = CCalendar.parseISODate("2002-02-02T22:22:22 UTC").getTime(); final Map<String, Object> map; try { map = ConverterFactory.YAML.convertFrom(YAMLConverterTest.strYAMLTest); } catch (final ConversionException e) { Assert.fail(e.getMessage()); return; } if (map != null) { Assert.assertTrue(map.containsKey("date")); Assert.assertEquals(testDate, map.get("date")); Assert.assertTrue(map.containsKey("actors")); final List actors = (List) map.get("actors"); Assert.assertEquals(3, actors.size()); Assert.assertEquals("laurel", actors.get(0)); Assert.assertEquals(StringShop.EMPTY_STRING, map.get("empty")); Assert.assertNull(map.get("null")); Assert.assertEquals(new Integer(1), map.get("version")); final byte[] chars = (byte[]) map.get("bdata"); System.out.println(YAMLConverterTest.CRYPTIC_MESSAGE_AS_BASE64 + " Decoded base64 chars :" + new String(chars)); Assert.assertEquals(YAMLConverterTest.CRYPTIC_MESSAGE, new String(chars)); } }
@Test public void testconvertFromYAMLList() throws ConversionException { final Object parsed = ConverterFactory.YAML.convertFrom(YAMLConverterTest.YAML_ACTORS_LIST); Assert.assertNotNull(parsed); Assert.assertTrue(parsed instanceof List); }