Allow comparison through equals method if exists

Change-Id: I8c25ef274b557d58d8f82bfb52ff09265e222126