### Question:
Handles { public static int getOpcode(Handle handle) { int tag = handle.getTag(); switch (tag) { case H_INVOKEVIRTUAL: return INVOKEVIRTUAL; case H_INVOKESTATIC: return INVOKESTATIC; case H_INVOKESPECIAL: return INVOKESPECIAL; case H_NEWINVOKESPECIAL: return INVOKESPECIAL; case H_INVOKEINTERFACE: return INVOKEINTERFACE; default: throw new IllegalArgumentException("Unsupported tag " + tag + " in " + handle); } }  static int getOpcode(Handle handle); static int opcodeToTag(int opcode); static int accessToTag(int access, boolean itf);  }### Answer:
@Test public void testGetOpcode() { assertThat(getOpcode(handle(H_INVOKEVIRTUAL)), is(INVOKEVIRTUAL)); assertThat(getOpcode(handle(H_INVOKESTATIC)), is(INVOKESTATIC)); assertThat(getOpcode(handle(H_INVOKESPECIAL)), is(INVOKESPECIAL)); assertThat(getOpcode(handle(H_NEWINVOKESPECIAL)), is(INVOKESPECIAL)); assertThat(getOpcode(handle(H_INVOKEINTERFACE)), is(INVOKEINTERFACE)); }
@Test(expected = IllegalArgumentException.class) public void testGetOpcodeNegative() { getOpcode(handle(0)); }