title: How do I mock Object.getClass?
body: <p>I'm working on a Java project want to write a unit test for an .equals method I have in a DTO. In the .equals method, there is a .getClass() method called by both objects under test. I want to mock this, but I can't tell what type of object it wants. I tried, </p>
  
  <p><code>when(mockRoomInv.getClass()).thenReturn(RoomInv.class);</code></p>
  
  <p>but sure as heck didn't do anything. What is the return type of getClass, and how do I manipulate it?</p>