### Question:
SwingListbox extends AbstractSwingContainer implements XulListbox, ListSelectionListener { public void setSelectedItem( Object item ) { listBox.setSelectedValue( item, true ); } SwingListbox( Element self, XulComponent parent, XulDomContainer container, String tagName ); Object getManagedObject(); boolean isDisabled(); void setDisabled( boolean disabled ); void setDisabled( String disabled ); int getRows(); void setRows( int rowsToDisplay ); String getSeltype(); void setSeltype( String selType ); Orient getOrientation(); void layout(); String getOnselect(); void setOnselect( String onchange ); void valueChanged( ListSelectionEvent e ); Object getSelectedItem(); Object[] getSelectedItems(); void setSelectedItem( Object item ); void setSelectedItems( Object[] items ); void setSelectedIndices( int[] indices ); void addItem( Object item ); void removeItems(); int getRowCount(); int getSelectedIndex(); int[] getSelectedIndices(); void setSelectedindex( String idx ); void setSelectedIndex( int index ); Collection<T> getElements(); void setElements( Collection<T> elements ); String getBinding(); void setBinding( String binding ); String getCommand(); void setCommand( final String command );  }### Answer:
@Test public void testSetSelectedItem() throws Exception { assertEquals( 1, list.getSelectedIndex() ); XulListitem item = (XulListitem) doc.getElementById( "listItem2" ); list.setSelectedItem( item ); assertEquals( 2, list.getSelectedIndex() ); }