TRUNK-3903

[https://tickets.openmrs.org/browse/TRUNK-3903] added some javadocs and unit tests to my previous commits