Personally, I do not think that the most difficult part of testing. This can be done using reflection, but this is not what makes testing useful.
The hard part calculates all possible inputs, for a “happy journey” and error situations, making sure that exceptions are thrown when they were, etc.
Your Java Bean should implement equals and hashCode. I would be more worried about tests to verify an equal contract: zero equivalent, reflective, symmetric, transitive, not equal. This is not trivial.
Getters and setters are the least of your problems. When people talk about code coverage standards of 70% or better, they often say that getters and setters can be omitted.
source share