code: protected AbstractButton findButton(AbstractCommand attachedCommand, List buttons) {
  
          if (buttons == null) {
              return null;
          }
  
          for (Iterator it = buttons.iterator(); it.hasNext();) {
              AbstractButton button = (AbstractButton)it.next();
              if (!(button instanceof JMenuItem) && attachedCommand.isAttached(button)) {
                  it.remove();
                  return button;
              }
          }
          return null;
      }
docs: Searches the given list of {@link AbstractButton}s for one that is not an instance of a
  {@link JMenuItem} and has the given command attached to it. If found, the button will be
  removed from the list.
  
  @param attachedCommand The command that we are checking to see if it attached to any item in the list.
  @param abstractButtons The collection of {@link AbstractButton}s that will be checked to
  see if they have the given command attached to them. May be null or empty.
  
  @return The element from the list that the given command is attached to, or null if no
  such element could be found.