title: Kotlin class instance assertEqual
body: <p>I'm new to java / kotlin. I would like to assert equality on the following class:</p>
  
  <pre><code>class PlaceCommand(vararg args: String) : ICommand {
      var direction: Direction = Direction.valueOf(args[1].toUpperCase())
      var x: Int               = args[2].toInt()
      var y: Int               = args[3].toInt()
  
      // ...
  }
  </code></pre>
  
  <p>What change is required to turn:</p>
  
  <pre><code>class FactoryTest {
      @Test
      fun testFactorySuccess() {
          val args = arrayOf("place", "WEST", "1", "1")
          val a    = PlaceCommand(*args)
          val b    = Factory(args) as PlaceCommand
  
          Assert.assertTrue(a.x.equals(b.x))
          Assert.assertTrue(a.y.equals(b.y))
          Assert.assertTrue(a.direction.equals(b.direction))
      }
  
      // ...
  }
  </code></pre>
  
  <p>Into something like:</p>
  
  <pre><code>class FactoryTest {
      @Test
      fun testFactorySuccess() {
          val args = arrayOf("place", "WEST", "1", "1")
  
          Assert.assertEqual(PlaceCommand(*args), Factory(args) as PlaceCommand)
          # or
          Assert.assertTrue(PlaceCommand(*args).equal(Factory(args) as PlaceCommand))
      }
  
      // ...
  }
  </code></pre>
  
  <p>Thanks.</p>