Collision testing on Objects instead of Instances
<p>I am trying to customize a collider class, where you can pass two objects to a method, and if any of the two collide, perform some sort of action.</p>

<p>For example I am making a shooter game, and what I would like to do is say:</p>

<ul>
<li>If Any <code>Ship</code> Collides with any bullet <code>Bullet</code>
<ul>
<li>Destroy both the affected <code>Ship</code> and the affected <code>Bullet</code></li>
</ul></li>
<li>Else
<ul>
<li>Do nothing</li>
</ul></li>
</ul>

<p>What I would like to do is write this once, and not for every bullet and/or ship. So, I was thinking of doing something like this:</p>

<pre><code>ColliderEvent collide = new ColliderEvent();
collide.hit(Ship, Bullet, new Runnable(){
    @Override
    public void run(){
        // Destroy bullet and ship here
    }
});
</code></pre>

<p>Then in my main game thread, I would do something that would test if two objects that were provided in some sort of <code>hit</code> method collide at some point, and if so perform the third parameter passed into <code>hit</code></p>

<p>So, is there any way to do this without passing in an instance of Ship/Bullet to the <code>hit</code> method?</p>
