@Test
public void testDiagnosticBinding_2() throws Exception {

	final String result = "{\"path\":\"/vm\",\"dependencies\":[{\"name\":\"mysql\",\"optional\":\"true\",\"resolved\":\"false\"},"
	+ "{\"name\":\"mongo\",\"optional\":\"false\",\"resolved\":\"true\"}]}";
	ObjectMapper mapper = JSonBindingUtils.createObjectMapper();
	Diagnostic diag = new Diagnostic( "/vm" );
	diag.getDependenciesInformation().add( new DependencyInformation( "mysql", true, false ));
	diag.getDependenciesInformation().add( new DependencyInformation( "mongo", false, true ));
	StringWriter writer = new StringWriter();
	mapper.writeValue( writer, diag );
	String s = writer.toString();
	Assert.assertEquals( result, s );
	Diagnostic readDiag = mapper.readValue( result, Diagnostic.class );
	Assert.assertEquals( diag.getInstancePath(), readDiag.getInstancePath());
	Assert.assertEquals( diag.getDependenciesInformation().size(), readDiag.getDependenciesInformation().size());
	for( int i=0; i<diag.getDependenciesInformation().size(); i++ ) {
		DependencyInformation original = diag.getDependenciesInformation().get( i );
		DependencyInformation read = readDiag.getDependenciesInformation().get( i );
		Assert.assertEquals( original.getDependencyName(), read.getDependencyName());
		Assert.assertEquals( original.isOptional(), read.isOptional());
		Assert.assertEquals( original.isResolved(), read.isResolved());
	}
}