https://tickets.openmrs.org/browse/TRUNK-3959?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
TRUNK-3955 - Unrelated types in equals call
Comparison of strings using != instead of .equals - TRUNK-3959

Made some minor changes as per review comments