Использовать API-интерфейс Bean Runner API
Это автоматически проверит все геттеры и сеттеры, убедившись, что значения правильно установлены.
testBean
public void testBean(java.lang.Object bean)
throws java.lang.Exception
Test the properties that have both getters and setters. Exclude those who have been excluded by excludeProperty(String). If the object implements Serializable, do a check to ensure it really is.
Parameters:
bean - the object to test
Throws:
java.lang.Exception - on failure