Uses reflection to compare two objects