### Question:
Invocation { public boolean fire() { return this.fire(null); } private  Invocation();  Invocation(Object target, String methodName);  Invocation(Object target, String methodName, Class parameterType);  Invocation(Object target, String methodName, Class[] parameterTypes); boolean fire(); boolean fire(Object argument); boolean fire(Object[] arguments); @Override boolean equals(Object obj); @Override int hashCode(); Method getMethod(); Object getTarget(); Class[] getParameterTypes();  }### Answer:
@Test public void testFireNoArgument() throws NoSuchMethodException { Invocation inv0 = new Invocation(this, _methodName); assertTrue(inv0.fire()); }
@Test public void testFireOneArgument() throws NoSuchMethodException { Invocation inv1 = new Invocation(this, _methodName, new Class[]{Object.class}); assertTrue(inv1.fire("foo")); }
@Test public void testFireWrongArgumentCount0() throws Exception { Invocation inv0 = new Invocation(this, _methodName); try { inv0.fire("foo"); fail(); } catch (IllegalArgumentException ex) { } }
@Test public void testFireWrongArgumentCount1() throws Exception { Invocation inv1 = new Invocation(this, _methodName, new Class[]{Object.class}); try { inv1.fire(); fail(); } catch (IllegalArgumentException ex) { } }
@Test public void testFireWrongArgumentCount2() throws Exception { Invocation inv1 = new Invocation(this, _methodName, new Class[]{Object.class}); try { inv1.fire(new Object[]{"foo", "bar"}); fail(); } catch (IllegalArgumentException ex) { } }
@Test public void testFireNullArgArray() throws Exception { Invocation inv1 = new Invocation(this, _methodName, new Class[]{Object.class}); try { inv1.fire(null); fail(); } catch (IllegalArgumentException ex) { } }
@Test public void testGarbageCollection() throws NoSuchMethodException { Invocation inv0 = new Invocation(new String(), "toString"); System.gc(); System.gc(); assertFalse(inv0.fire()); }