public void testActionPerformed() throws Exception {
    Fixture.fakePhase(PhaseId.PROCESS_ACTION);
    Display display = new Display();
    Shell shell = new Shell(display);
    Button button = new Button(shell, SWT.PUSH);
    IEventAdapter eventAdapter = (IEventAdapter) button.getAdapter(IEventAdapter.class);
    assertNotNull(eventAdapter);
    assertSame(eventAdapter, button.getAdapter(IEventAdapter.class));
    assertFalse(eventAdapter.hasListener(SelectionListener.class));
    try {
      eventAdapter.hasListener(Object.class);
      fail();
    } catch (final IllegalArgumentException iae) {
    }

    Object[] listener = eventAdapter.getListener(SelectionListener.class);
    assertEquals(0, listener.length);
    SelectionListener actionListener = new SelectionAdapter() {};
    eventAdapter.addListener(SelectionListener.class, actionListener);
    assertTrue(eventAdapter.hasListener(SelectionListener.class));
    listener = eventAdapter.getListener(SelectionListener.class);
    assertEquals(1, listener.length);
    assertSame(actionListener, listener[0]);
    eventAdapter.removeListener(SelectionListener.class, actionListener);
    assertFalse(eventAdapter.hasListener(SelectionListener.class));
  }