Source:
<code>public NeutronAgentModel() { getPluginType().getSelectedItemChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { String displayString = getPluginType().getSelectedItem(); isPluginConfigurationAvailable().setEntity(!NeutronPluginTranslator.isDisplayStringCustom(displayString)); if (!NeutronPluginTranslator.isDisplayStringCustom(displayString)) { switch(NeutronPluginTranslator.getPluginTypeForDisplayString(displayString)) { case OPEN_VSWITCH: getInterfaceMappingsLabel().setEntity(ConstantsManager.getInstance() .getConstants() .bridgeMappings()); getInterfaceMappingsExplanation().setEntity(ConstantsManager.getInstance() .getConstants() .bridgeMappingsExplanation()); break; case LINUX_BRIDGE: default: getInterfaceMappingsLabel().setEntity(ConstantsManager.getInstance() .getConstants() .interfaceMappings()); getInterfaceMappingsExplanation().setEntity(ConstantsManager.getInstance() .getConstants() .interfaceMappingsExplanation()); } } } }); getPropertyChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { if ("IsAvailable".equals(((PropertyChangedEventArgs) args).propertyName)) { boolean value = getIsAvailable(); getPluginType().setIsAvailable(value); isPluginConfigurationAvailable().setEntity(value && !NeutronPluginTranslator.isDisplayStringCustom(getPluginType().getSelectedItem())); } } }); getPluginType().setItems(NeutronPluginTranslator.getPresetDisplayStrings()); <START> getPluginType().setSelectedItem(EnumTranslator.getInstance().get(OpenstackNetworkPluginType.OPEN_VSWITCH)); END> getInterfaceMappingsLabel().setEntity(ConstantsManager.getInstance().getConstants().interfaceMappings()); getInterfaceMappingsExplanation().setEntity(ConstantsManager.getInstance() .getConstants() .interfaceMappingsExplanation()); getBrokerType().setItems(Arrays.asList(BrokerType.values())); getBrokerType().setSelectedItem(BrokerType.RABBIT_MQ); }</code><technical_language>code is duplicated in line 148, extract this a private method getDefaultPluginString() instead</technical_language>

Target:
public NeutronAgentModel() { getPluginType().getSelectedItemChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { String displayString = getPluginType().getSelectedItem(); isPluginConfigurationAvailable().setEntity(!NeutronPluginTranslator.isDisplayStringCustom(displayString)); if (!NeutronPluginTranslator.isDisplayStringCustom(displayString)) { switch(NeutronPluginTranslator.getPluginTypeForDisplayString(displayString)) { case OPEN_VSWITCH: getInterfaceMappingsLabel().setEntity(ConstantsManager.getInstance() .getConstants() .bridgeMappings()); getInterfaceMappingsExplanation().setEntity(ConstantsManager.getInstance() .getConstants() .bridgeMappingsExplanation()); break; case LINUX_BRIDGE: default: getInterfaceMappingsLabel().setEntity(ConstantsManager.getInstance() .getConstants() .interfaceMappings()); getInterfaceMappingsExplanation().setEntity(ConstantsManager.getInstance() .getConstants() .interfaceMappingsExplanation()); } } } }); getPropertyChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { if ("IsAvailable".equals(((PropertyChangedEventArgs) args).propertyName)) { boolean value = getIsAvailable(); getPluginType().setIsAvailable(value); isPluginConfigurationAvailable().setEntity(value && !NeutronPluginTranslator.isDisplayStringCustom(getPluginType().getSelectedItem())); } } }); getPluginType().setItems(NeutronPluginTranslator.getPresetDisplayStrings()); getPluginType().setSelectedItem(getDefaultPluginTypeString()); getInterfaceMappingsLabel().setEntity(ConstantsManager.getInstance().getConstants().interfaceMappings()); getInterfaceMappingsExplanation().setEntity(ConstantsManager.getInstance() .getConstants() .interfaceMappingsExplanation()); getBrokerType().setItems(Arrays.asList(BrokerType.values())); getBrokerType().setSelectedItem(BrokerType.RABBIT_MQ); }