// Create an author
Author wolfe = new Author( "Tom Wolfe", "Green" );
try {
String name = (String) PropertyUtils.getSimpleProperty( wolfe, "name" );
String favoriteColor = (String) PropertyUtils.getSimpleProperty( wolfe, "favoriteColor" );
System.out.println( "The Author has some properties: " + name + ", " + favoriteColor );
} catch (IllegalAccessException e) {
System.out.println( "You are not allowed to access a property!" );
} catch (InvocationTargetException e) {
System.out.println( "There was a problem invoking the method." );
} catch (NoSuchMethodException e) {
System.out.println( "The is no method to get a property." );
}