class PropertyBinding implements Binding<T> {

	@Override
	public void setValue(T value) {
		try {
			PropertyUtils.setSimpleProperty(boundObject, property, value);
		} catch (Exception e) {
			throw new IllegalStateException(String.format(
					"Binding error! Setting property '%s' on bound object of class %s failed!", property,
					boundObject.getClass()), e);
		}
	}

}

class PropertyBindingTest {

	@Test(expected = IllegalStateException.class)
	public void testWrongType() {

		Person person = new Person();
		Binding<String> nameBinding = new PropertyBinding<String>(person, "age");
		nameBinding.setValue("Tom");
	}

}