@Test
public void testApplicationBindingsBinding() throws Exception {

	ObjectMapper mapper = JSonBindingUtils.createObjectMapper();
	// Empty object
	ApplicationBindings bindings = new ApplicationBindings();
	StringWriter writer = new StringWriter();
	mapper.writeValue( writer, bindings );
	Assert.assertEquals( "{}", writer.toString());
	// Single key
	List<ApplicationBindingItem> list = new ArrayList<> ();
	list.add( new ApplicationBindingItem( "app1", true ));
	bindings.prefixToItems.put( "prefix1", list );
	writer = new StringWriter();
	mapper.writeValue( writer, bindings );
	Assert.assertEquals( "{\"prefix1\":[{\"name\":\"app1\",\"bound\":true}]}", writer.toString());
	// Complex object
	list = new ArrayList<> ();
	list.add( new ApplicationBindingItem( "app2", false ));
	list.add( new ApplicationBindingItem( "app3", true ));
	bindings.prefixToItems.put( "prefix2", list );
	list = new ArrayList<> ();
	list.add( new ApplicationBindingItem( "app4", false ));
	bindings.prefixToItems.put( "prefix0", list );
	writer = new StringWriter();
	mapper.writeValue( writer, bindings );
	Assert.assertEquals(
			"{\"prefix0\":[{\"name\":\"app4\",\"bound\":false}],"
			+ "\"prefix1\":[{\"name\":\"app1\",\"bound\":true}],\"prefix2\":[{\"name\":\"app2\",\"bound\":false},"
			+ "{\"name\":\"app3\",\"bound\":true}]}",
			writer.toString());
}