[Demonstration 1]

[Buggy Method]
public static void main(String[] args) {
    final JFrame mapFrame = new JFrame();
    mapFrame.getContentPane().setLayout(new BorderLayout());
    QoSTransportSettings settings = new QoSTransportSettings();
    settings.setHosts(new String[] { "239.255.0.1:4150" });
    settings.setType(TransportType.MULTICAST_TRANSPORT);
    ProxyServerInt proxyServer = Engine.getInstance().getProxyServer();
    KnowledgeBase knowledge = null;
    if (proxyServer instanceof CrwProxyServer) {
        knowledge = ((CrwProxyServer) proxyServer).getKnowledgeBase();
    } else {
        LOGGER.severe("ProxyServer is not a CrwProxyServer");
        System.exit(-1);
    }
    // Add map
    WorldWindPanel wwPanel = new WorldWindPanel();
    wwPanel.createMap();
    mapFrame.getContentPane().add(wwPanel.component, BorderLayout.CENTER);
    // Add widgets
    SensorDataWidget data = new SensorDataWidget(wwPanel);
    wwPanel.addWidget(data);
    ArrayList<ControlMode> controlModes = new ArrayList<ControlMode>();
    controlModes.add(ControlMode.TELEOP);
    controlModes.add(ControlMode.POINT);
    controlModes.add(ControlMode.PATH);
    controlModes.add(ControlMode.NONE);
    RobotWidget robot = new RobotWidget(wwPanel, controlModes);
    wwPanel.addWidget(robot);
    RobotTrackWidget robotTrack = new RobotTrackWidget(wwPanel);
    wwPanel.addWidget(robotTrack);
    mapFrame.pack();
    mapFrame.setVisible(true);
    int numRobots = 1;
    int portCounter = 0;
    String name = "Boat";
    Color color = Color.YELLOW;
    ArrayList<String> proxyNames = new ArrayList<String>();
    ArrayList<ProxyInt> proxyList = Engine.getInstance().getProxyServer().getProxyListClone();
    for (ProxyInt proxy : proxyList) {
        proxyNames.add(proxy.getProxyName());
    }
    for (int i = 0; i < numRobots; i++) {
        // Create a simulated boat and run a ROS server around it
        VehicleServer server = new FastSimpleBoatSimulator();
        UdpVehicleService rosServer = new UdpVehicleService(11411 + portCounter, server);
        name = CoreHelper.getUniqueName(name, proxyNames);
        proxyNames.add(name);
        InetSocketAddress socketAddress = new InetSocketAddress("localhost", 11411 + portCounter);
        ProxyInt proxy = Engine.getInstance().getProxyServer().createProxy(name, color, socketAddress);
        portCounter++;
        String ipAddress = socketAddress.toString().substring(socketAddress.toString().indexOf("/") + 1);
        BoatProxy boatProxy = null;
        if (proxy instanceof BoatProxy) {
            boatProxy = (BoatProxy) proxy;
            // Set initial pose
            UTMCoordinate utmc = new UTMCoordinate(25.3543021007, 51.5283080718);
            UtmPose p1 = new UtmPose(new Pose3D(utmc.getEasting(), utmc.getNorthing(), 0.0, 0.0, 0.0, 0.0), new Utm(utmc.getZoneNumber(), utmc.getHemisphere().equals(UTMCoordinate.Hemisphere.NORTH)));
            boatProxy.getServer().setPose(p1, null);
            new Thread(new LutraGamsServer(((BoatProxy) proxy).getServer(), boatProxy.getIpAddress(), i)).start();
        }
    }
}

[Buggy Hunk]
new Thread(new LutraGamsServer(((BoatProxy) proxy).getServer(), boatProxy.getIpAddress(), i)).start();

[Patch]
new Thread(new LutraGamsServer(((BoatProxy) proxy).getServer(), boatProxy.getIpAddress(), i, BoatProxy.DEFAULT_TEAM_SIZE)).start();

[Demonstration 2]

[Buggy Method]
public void getAllConversations() {
    clientContext.conversation.updateAllConversations(false);
    convDisplayList.clear();
    for (final ConversationSummary conv : clientContext.conversation.getConversationSummaries()) {
        Conversation c = clientContext.conversation.getConversation(conv.id);
        if (clientContext.user.getCurrent() != null) {
            Uuid userID = clientContext.user.getCurrent().id;
            if (c.users.contains(userID)) {
                convDisplayList.addElement(conv.title);
            }
        }
    }
}

[Buggy Hunk]
if(c.users.contains(userID)) {

[Patch]
if( c.owner.equals(userID) || c.users.contains(userID)) {

[Demonstration 3]

[Buggy Method]
private void addUser(String name) {
    clientContext.user.addUser(name);
}

[Buggy Hunk]
clientContext.user.addUser(name);

[Patch]
clientContext.user.addUser(name,"password");