/**
   * Tests VisibilityPropertyPanel#refreshPanel() for accuracy.
   *
   * <p>It verifies VisibilityPropertyPanel#refreshPanel() is correct.
   */
  public void testRefreshPanel() {
    AssociationEnd element = new AssociationEndImpl();
    element.setVisibility(VisibilityKind.PROTECTED);

    panel.configurePanel(element);

    assertTrue(
        "Failed to refresh panel correctly.",
        ((JRadioButton) panel.retrievePanel().getComponent(1)).isSelected());
  }
  /**
   * Tests VisibilityPropertyPanel#execute() for accuracy.
   *
   * <p>It verifies VisibilityPropertyPanel#execute() is correct.
   */
  public void testExecute() {
    panel.configurePanel(new AssociationEndImpl());

    MockModelElementChangeListener listener = new MockModelElementChangeListener();
    propertiesPanel.addModelElementChangeListener(listener);

    panel.execute();

    assertTrue("Failed to execute correctly.", listener.getIsExecuted());
  }
  /**
   * Tests VisibilityPropertyPanel#execute() for accuracy.
   *
   * <p>It verifies VisibilityPropertyPanel#execute() is correct.
   */
  public void testExecute_Package() {
    AssociationEnd element = new AssociationEndImpl();
    element.setVisibility(VisibilityKind.PACKAGE);

    panel.configurePanel(element);

    MockModelElementChangeListener listener = new MockModelElementChangeListener();
    propertiesPanel.addModelElementChangeListener(listener);

    panel.execute();

    assertTrue("Failed to execute correctly.", listener.getIsExecuted());
  }
  /**
   * Tests VisibilityPropertyPanel#refreshPanel() for accuracy.
   *
   * <p>It verifies VisibilityPropertyPanel#refreshPanel() is correct.
   */
  public void testRefreshPanel_NoVisible() {
    panel.refreshPanel();

    assertFalse(
        "Failed to refresh panel correctly.",
        ((JRadioButton) panel.retrievePanel().getComponent(0)).isSelected());
    assertFalse(
        "Failed to refresh panel correctly.",
        ((JRadioButton) panel.retrievePanel().getComponent(1)).isSelected());
    assertFalse(
        "Failed to refresh panel correctly.",
        ((JRadioButton) panel.retrievePanel().getComponent(2)).isSelected());
    assertFalse(
        "Failed to refresh panel correctly.",
        ((JRadioButton) panel.retrievePanel().getComponent(3)).isSelected());
  }
  /**
   * Tests VisibilityPropertyPanel#refreshPanel() for accuracy.
   *
   * <p>It verifies VisibilityPropertyPanel#refreshPanel() is correct.
   */
  public void testRefreshPanel_NoButtonSelected() {
    List<ModelElement> elements = new ArrayList<ModelElement>();
    AssociationEnd element1 = new AssociationEndImpl();
    element1.setVisibility(VisibilityKind.PROTECTED);
    AssociationEnd element2 = new AssociationEndImpl();

    elements.add(element1);
    elements.add(element2);
    panel.configurePanel(elements);

    assertFalse(
        "Failed to refresh panel correctly.",
        ((JRadioButton) panel.retrievePanel().getComponent(0)).isSelected());
    assertFalse(
        "Failed to refresh panel correctly.",
        ((JRadioButton) panel.retrievePanel().getComponent(1)).isSelected());
    assertFalse(
        "Failed to refresh panel correctly.",
        ((JRadioButton) panel.retrievePanel().getComponent(2)).isSelected());
    assertFalse(
        "Failed to refresh panel correctly.",
        ((JRadioButton) panel.retrievePanel().getComponent(3)).isSelected());
  }