title: comparing the instance of a class
body: <p>I create 2 objects from a class. </p>
  
  <pre><code>maDrive = new MaxonDrive(maDriveConnection);
  liftDrive = new MaxonDrive(liftDriveConnection);
  </code></pre>
  
  <p>In this class I have a method, which I want to use for both instances but with different (sub)functionality. How can I solve this problem?</p>
  
  <p>Following a made up "solution" I could think of, but doesn't seem useful or possible.</p>
  
  <pre><code>    public MaxonDrive(MaxonDriveConnectionIfc maxonIfc)
      {
          public void updateMotorState()
          {
              doSomething();
              if(objectOf(MaxonDrive) == maDrive){}
              else if(objectOf(MaxonDrive) == liftDrive){}
          }
      }
  </code></pre>
  
  <p>Is there a possibility to check which object is using this method to react accordingly. </p>