// Create an author
Author wolfe = new Author( "Tom Wolfe", "Green" );
Book theRightStuff = new Book( "The Right Stuff", wolfe );
try {
String bookName = (String) PropertyUtils.getSimpleProperty( theRightStuff, "name" );
String authorName = (String) PropertyUtils.getNestedProperty( theRightStuff, "author.name" );
System.out.println( "The book is " + bookName );
System.out.println( "The author is " + authorName );
} catch (Exception e) {
System.out.println( "There was a problem getting a bean property." );
e.printStackTrace();
}