Input:
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String action = req.getParameter(SUBMIT_ACTION);
        String id = req.getParameter(ID);
        String sbChannelName = req.getParameter(SB_ID);
        String youSeeName = req.getParameter(UC_ID);
        String displayName = req.getParameter(DISPLAY_NAME);
        Date fromDate;
        Date toDate;
        String fromDateS = req.getParameter(FROM_DATE);
        if (fromDateS != null || "".equals(fromDateS)) {
            fromDateS = "2012-05-01 00:00";
        }
        try {
            fromDate = JAVA_DATE_FORMAT.parse(fromDateS);
            fromDate.setSeconds(0);
        } catch (ParseException e) {
            throw new RuntimeException("Could not parse '" +
                    fromDateS + "'");
        }
        String toDateS = req.getParameter(TO_DATE);
        if (toDateS != null || "".equals(toDateS)) {
            toDateS = "3000-01-01 00:00";
        }
        try {
            toDate = JAVA_DATE_FORMAT.parse(toDateS);
            toDate.setSeconds(0);
        } catch (ParseException e) {
            throw new RuntimeException("Could not parse '" +
                    toDateS + "'");
        }
        YouSeeChannelMapping mapping = new YouSeeChannelMapping();
        if (id != null && !"".equals(id)) {
            mapping.setId(Long.parseLong(id));
        }
        mapping.setDisplayName(displayName);
        mapping.setFromDate(fromDate);
        mapping.setToDate(toDate);
        mapping.setSbChannelId(sbChannelName);
        mapping.setYouSeeChannelId(youSeeName);
        if (CREATE.equals(action)) {
            try {
                service.create(mapping);
            } catch (ServiceException e) {
                req.setAttribute("error", e);
            }
        } else if (UPDATE.equals(action)) {
              try {
                service.update(mapping);
            } catch (ServiceException e) {
                req.setAttribute("error", e);
            }
        } else if (DELETE.equals(action)) {
              try {
                service.delete(mapping);
            } catch (ServiceException e) {
                req.setAttribute("error", e);
            }
        }
        req.setAttribute("page_attribute", "you_see_channel_mapping.jsp");
        req.getSession().getServletContext().getRequestDispatcher("/index.jsp").forward(req, resp);
    }

Output:
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String action = req.getParameter(SUBMIT_ACTION);
        String id = req.getParameter(ID);
        String sbChannelName = req.getParameter(SB_ID);
        String youSeeName = req.getParameter(UC_ID);
        String displayName = req.getParameter(DISPLAY_NAME);
        Date fromDate;
        Date toDate;
        String fromDateS = req.getParameter(FROM_DATE);
        if (fromDateS == null || "".equals(fromDateS)) {
            fromDateS = "2012-05-01 00:00";
        }
        try {
            fromDate = JAVA_DATE_FORMAT.parse(fromDateS);
            fromDate.setSeconds(0);
        } catch (ParseException e) {
            throw new RuntimeException("Could not parse '" +
                    fromDateS + "'");
        }
        String toDateS = req.getParameter(TO_DATE);
        if (toDateS == null || "".equals(toDateS)) {
            toDateS = "3000-01-01 00:00";
        }
        try {
            toDate = JAVA_DATE_FORMAT.parse(toDateS);
            toDate.setSeconds(0);
        } catch (ParseException e) {
            throw new RuntimeException("Could not parse '" +
                    toDateS + "'");
        }
        YouSeeChannelMapping mapping = new YouSeeChannelMapping();
        if (id != null && !"".equals(id)) {
            mapping.setId(Long.parseLong(id));
        }
        mapping.setDisplayName(displayName);
        mapping.setFromDate(fromDate);
        mapping.setToDate(toDate);
        mapping.setSbChannelId(sbChannelName);
        mapping.setYouSeeChannelId(youSeeName);
        if (CREATE.equals(action)) {
            try {
                service.create(mapping);
            } catch (ServiceException e) {
                req.setAttribute("error", e);
            }
        } else if (UPDATE.equals(action)) {
              try {
                service.update(mapping);
            } catch (ServiceException e) {
                req.setAttribute("error", e);
            }
        } else if (DELETE.equals(action)) {
              try {
                service.delete(mapping);
            } catch (ServiceException e) {
                req.setAttribute("error", e);
            }
        }
        req.setAttribute("page_attribute", "you_see_channel_mapping.jsp");
        req.getSession().getServletContext().getRequestDispatcher("/index.jsp").forward(req, resp);
    }


Input:
    public void testBasicAlignment() {
        String md5 = "c6d95d8ae707e78fefdaa7375f130995";
        WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
                "-R /humgen/gsa-scr1/GATK_Data/bwa/human_b36_both.fasta" +
                        " -T Align" +
                        " -I " + validationDataLocation + "NA12878_Pilot1_20.trimmed.unmapped.bam" +
                        " -ob %s",
                1,
                Arrays.asList(md5));
        executeTest("testBasicAlignment", spec);
    }

Output:
    public void testBasicAlignment() {
        String md5 = "c6d95d8ae707e78fefdaa7375f130995";
        WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
                        "-R " + b36KGReference +
                        " -T Align" +
                        " -I " + validationDataLocation + "NA12878_Pilot1_20.trimmed.unmapped.bam" +
                        " -ob %s",
                1,
                Arrays.asList(md5));
        executeTest("testBasicAlignment", spec);
    }


Input:
    public static SameController create(int port) {
        ConnectionManagerImpl connections = new ConnectionManagerImpl(
                timeout, timeout);
        State state = new State("Default");
        Broadcaster broadcaster = BroadcasterImpl.getDefaultBroadcastRunner();
        MasterServiceImpl master = new MasterServiceImpl(state, connections,
                broadcaster);
        JsonRpcServer jsonMaster = new JsonRpcServer(master, MasterService.class);
        ClientServiceImpl client = new ClientServiceImpl(state, connections);
        JsonRpcServer jsonClient = new JsonRpcServer(client, ClientService.class);
        PaxosServiceImpl paxos = new PaxosServiceImpl("");
        JsonRpcServer jsonPaxos = new JsonRpcServer(paxos, PaxosService.class);
        Server server = new Server(port);
        SameController controller = new SameController(port, server, master, client,
                paxos);
        RpcHandler rpcHandler = new RpcHandler(null);
        rpcHandler.addRpcServer("/MasterService.json", jsonMaster);
        rpcHandler.addRpcServer("/ClientService.json", jsonClient);
        rpcHandler.addRpcServer("/PaxosService.json", jsonPaxos);
        server.setHandler(rpcHandler);
        return controller;
    }

Output:
    public static SameController create(int port) {
        ConnectionManagerImpl connections = new ConnectionManagerImpl(
                timeout, timeout);
        State state = new State("Default");
        Broadcaster broadcaster = BroadcasterImpl.getDefaultBroadcastRunner();
        MasterServiceImpl master = new MasterServiceImpl(state, connections,
                broadcaster);
        JsonRpcServer jsonMaster = new JsonRpcServer(master, MasterService.class);
        ClientServiceImpl client = new ClientServiceImpl(state, connections);
        JsonRpcServer jsonClient = new JsonRpcServer(client.getService(),
                ClientService.class);
        PaxosServiceImpl paxos = new PaxosServiceImpl("");
        JsonRpcServer jsonPaxos = new JsonRpcServer(paxos, PaxosService.class);
        Server server = new Server(port);
        SameController controller = new SameController(port, server, master, client,
                paxos);
        RpcHandler rpcHandler = new RpcHandler(null);
        rpcHandler.addRpcServer("/MasterService.json", jsonMaster);
        rpcHandler.addRpcServer("/ClientService.json", jsonClient);
        rpcHandler.addRpcServer("/PaxosService.json", jsonPaxos);
        server.setHandler(rpcHandler);
        return controller;
    }


Input:
  public static int save (String tableName, Map < String, Object > hashmap)
    {
      Connection connection = null;
      Statement stmt = null;
      ResultSet rs = null;
      String columns = "";
      String values = "";
      int id = 0;
      try
      {
        connection = Connector.getConnection();
        Map<String, String> SQLHashmap = convertJavaToSQL(hashmap);
        DatabaseMetaData md = connection.getMetaData();
        if (md.getColumns(null, null, tableName, "creation_date").next())
        {
          SQLHashmap.put("creation_date", "NOW()");
          SQLHashmap.put("last_modified_date", "NOW()");
        }
        for (String key : SQLHashmap.keySet())
        {
          columns += key + ",";
          values += SQLHashmap.get(key) + ",";
        }
        columns = columns.replaceAll(",$", "");
        values = values.replaceAll(",$", "");
        stmt = connection.createStatement();
        if (!hashmap.containsKey("id"))
        {
          stmt.executeUpdate("INSERT INTO " + tableName + " (" + columns + ") VALUES (" + values + ")",
              Statement.RETURN_GENERATED_KEYS);
          rs = stmt.getGeneratedKeys();
          if (rs.next())
          {
            id = rs.getInt(1);
          }
        }
        else
        {
          id = stmt.executeUpdate("INSERT INTO " + tableName + " (" + columns + ") VALUES (" + values + ")") != 0 ? (int) hashmap
              .get("id") : 0;
        }
      }
      catch (SQLException e)
      {
        e.printStackTrace();
      }
      StringBuffer sb = new StringBuffer();
      Map<String, Object> row = Manager.find(id, tableName);
      for (String key : row.keySet())
        sb.append(row.get(key).hashCode());
      String sha256 = DigestHash.getShaHash(sb.toString());
      return id;
    }

Output:
  public static int save (String tableName, Map < String, Object > hashmap)
    {
      Connection connection = null;
      Statement stmt = null;
      ResultSet rs = null;
      String columns = "";
      String values = "";
      int id = 0;
      try
      {
        connection = Connector.getConnection();
        Map<String, String> SQLHashmap = convertJavaToSQL(hashmap);
        DatabaseMetaData md = connection.getMetaData();
        if (md.getColumns(null, null, tableName, "creation_date").next())
        {
          SQLHashmap.put("creation_date", "NOW()");
          SQLHashmap.put("last_modified_date", "NOW()");
        }
        for (String key : SQLHashmap.keySet())
        {
          columns += key + ",";
          values += SQLHashmap.get(key) + ",";
        }
        columns = columns.replaceAll(",$", "");
        values = values.replaceAll(",$", "");
        stmt = connection.createStatement();
        if (!hashmap.containsKey("id"))
        {
          stmt.executeUpdate("INSERT INTO " + tableName + " (" + columns + ") VALUES (" + values + ")",
              Statement.RETURN_GENERATED_KEYS);
          rs = stmt.getGeneratedKeys();
          if (rs.next())
          {
            id = rs.getInt(1);
          }
        }
        else
        {
          id = stmt.executeUpdate("INSERT INTO " + tableName + " (" + columns + ") VALUES (" + values + ")") != 0 ? (int) hashmap
              .get("id") : 0;
        }
      }
      catch (SQLException e)
      {
        e.printStackTrace();
      }
      StringBuffer sb = new StringBuffer();
      Map<String, Object> row = Manager.find(id, tableName);
      System.out.println("aoidjaoidjsoaisj"+row);
      for (String key : row.keySet()){
         String value = row.get(key) == null ? "" : row.get(key).toString();
         sb.append(value.hashCode());
      }
      String sha256 = DigestHash.getShaHash(sb.toString());
      return id;
    }


Input:
    public Economy_iConomy6(JavaPlugin plugin) {
        this.plugin = plugin;
        Bukkit.getServer().getPluginManager().registerEvents(new EconomyServerListener(this), plugin);
        if (economy == null) {
            Plugin ec = plugin.getServer().getPluginManager().getPlugin("iConomy");
            if (ec != null && ec.isEnabled() && ec.getClass().getName().equals("com.iCo6.iConomy")) {
                economy = (iConomy) ec;
                accounts = new Accounts();
                log.info(String.format("[%s][Economy] %s hooked.", plugin.getDescription().getName(), name));
            }
        }
    }

Output:
    public Economy_iConomy6(JavaPlugin plugin) {
        this.plugin = plugin;
        Bukkit.getServer().getPluginManager().registerEvents(new EconomyServerListener(this), plugin);
        log.severe("iConomy6 - If you are using Flatfile storage be aware that iCo6 has a CRITICAL bug which can wipe ALL iconomy data.");
        log.severe("if you're using Votifier, or any other plugin which handles economy data in a threaded manner your server is at risk!");
        log.severe("it is highly suggested to use SQL with iCo6 or to use an alternative economy plugin!");
        if (economy == null) {
            Plugin ec = plugin.getServer().getPluginManager().getPlugin("iConomy");
            if (ec != null && ec.isEnabled() && ec.getClass().getName().equals("com.iCo6.iConomy")) {
                economy = (iConomy) ec;
                accounts = new Accounts();
                log.info(String.format("[%s][Economy] %s hooked.", plugin.getDescription().getName(), name));
            }
        }
    }


Input:
    public static ArrayList<Integer> getInedexesWithMaxRating(MCTNode node,
            int whiteRankingMethod, int blackRankingMethod)
            throws MCTUtilsException {
        ArrayList<Integer> rez = new ArrayList<Integer>();
        if (node.nextMoves == null) { throw new MCTUtilsException(
                "node nima razvitih naslednikov"); }
        if (node.nextMoves.size() == 0) { return rez; }
        double maxRating = Double.MIN_VALUE;
        double currRating = Double.MIN_VALUE;
        for (int x = 0; x < node.nextMoves.size(); x++) {
            if (node.isWhitesMove) {
                currRating = MCTUtils.computeNodeRating(node.nextMoves.get(x),
                        whiteRankingMethod);
            }
            else {
                currRating = MCTUtils.computeNodeRating(node.nextMoves.get(x),
                        blackRankingMethod);
            }
            if (currRating > maxRating) {
                maxRating = currRating;
                rez = new ArrayList<Integer>();
            }
            if (currRating == maxRating) {
                rez.add(x);
            }
        }
        if (Constants.SELECTION_ALSO_USES_VISIT_COUNT_FOR_NODE_CHOOSING) {
            int maxVisitCount = Integer.MIN_VALUE;
            ArrayList<Integer> filteredRez = new ArrayList<Integer>();
            for (Integer x : rez) {
                MCTNode currNode = node.nextMoves.get(x);
                if (currNode.visitCount > maxVisitCount) {
                    maxVisitCount = currNode.visitCount;
                    filteredRez = new ArrayList<Integer>();
                }
                if (currNode.visitCount == maxVisitCount) {
                    filteredRez.add(x);
                }
            }
            return filteredRez;
        }
        return rez;
    }

Output:
    public static ArrayList<Integer> getInedexesWithMaxRating(MCTNode node,
            int whiteRankingMethod, int blackRankingMethod)
            throws MCTUtilsException {
        ArrayList<Integer> rez = new ArrayList<Integer>();
        if (node.nextMoves == null) { throw new MCTUtilsException(
                "node nima razvitih naslednikov"); }
        if (node.nextMoves.size() == 0) { return rez; }
        double maxRating = -Double.MAX_VALUE;
        double currRating = -Double.MAX_VALUE;
        for (int x = 0; x < node.nextMoves.size(); x++) {
            if (node.isWhitesMove) {
                currRating = MCTUtils.computeNodeRating(node.nextMoves.get(x),
                        whiteRankingMethod);
            }
            else {
                currRating = MCTUtils.computeNodeRating(node.nextMoves.get(x),
                        blackRankingMethod);
            }
            if (currRating > maxRating) {
                maxRating = currRating;
                rez = new ArrayList<Integer>();
            }
            if (currRating == maxRating) {
                rez.add(x);
            }
        }
        if (Constants.SELECTION_ALSO_USES_VISIT_COUNT_FOR_NODE_CHOOSING) {
            int maxVisitCount = Integer.MIN_VALUE;
            ArrayList<Integer> filteredRez = new ArrayList<Integer>();
            for (Integer x : rez) {
                MCTNode currNode = node.nextMoves.get(x);
                if (currNode.visitCount > maxVisitCount) {
                    maxVisitCount = currNode.visitCount;
                    filteredRez = new ArrayList<Integer>();
                }
                if (currNode.visitCount == maxVisitCount) {
                    filteredRez.add(x);
                }
            }
            return filteredRez;
        }
        return rez;
    }


Input:
    private boolean handleKey0(KeyStroke key) {
        if (currentMode != null) {
            KeyMap map = currentMode.resolveKeyMap(keyMapProvider);
            if (map != null) {
                boolean inMapping = keyStrokeTranslator.processKeyStroke(map, key);
                if (inMapping) {
                    Queue<RemappedKeyStroke> resultingKeyStrokes =
                        keyStrokeTranslator.resultingKeyStrokes();
                    if(currentMode.getName() == InsertMode.NAME) {
                    	if(resultingKeyStrokes.isEmpty()) {
                    		return currentMode.handleKey(key);
                    	}
                    	else if(keyStrokeTranslator.numUnconsumedKeys() > 0) {
                    		for(int i=0; i < keyStrokeTranslator.numUnconsumedKeys(); i++) {
	                    		currentMode.handleKey(new RemappedKeyStroke(new SimpleKeyStroke(SpecialKey.BACKSPACE), false));
                    		}
                    	}
                    	else {
                    		return currentMode.handleKey(key);
                    	}
                    }
                    while (!resultingKeyStrokes.isEmpty()) {
                        RemappedKeyStroke next = resultingKeyStrokes.poll();
                        if (next.isRecursive()) {
                            handleKey(next);
                        } else {
                            currentMode.handleKey(next);
                        }
                    }
                    return true;
                }
            }
            return currentMode.handleKey(key);
        }
        return false;
    }

Output:
    private boolean handleKey0(KeyStroke key) {
        if (currentMode != null) {
            KeyMap map = currentMode.resolveKeyMap(keyMapProvider);
            if (map != null) {
                boolean inMapping = keyStrokeTranslator.processKeyStroke(map, key);
                if (inMapping) {
                    Queue<RemappedKeyStroke> resultingKeyStrokes =
                        keyStrokeTranslator.resultingKeyStrokes();
                    if(currentMode.getName() == InsertMode.NAME) {
                    	if(resultingKeyStrokes.isEmpty()) {
                    		return currentMode.handleKey(key);
                    	}
                    	else if(keyStrokeTranslator.numUnconsumedKeys() > 0) {
                    		for(int i=0; i < keyStrokeTranslator.numUnconsumedKeys(); i++) {
	                    		currentMode.handleKey(new RemappedKeyStroke(new SimpleKeyStroke(SpecialKey.BACKSPACE), false));
                    		}
                    	}
                    	else {
                    		while(resultingKeyStrokes.size() > 1) {
                    			resultingKeyStrokes.remove();
                    		}
                    	}
                    }
                    while (!resultingKeyStrokes.isEmpty()) {
                        RemappedKeyStroke next = resultingKeyStrokes.poll();
                        if (next.isRecursive()) {
                            handleKey(next);
                        } else {
                            currentMode.handleKey(next);
                        }
                    }
                    return true;
                }
            }
            return currentMode.handleKey(key);
        }
        return false;
    }


Input:
	private void convertDocument(InputStream inputStream, OutputStream outputStream,
			DataType fromDataType, DataType toDataType, Map<String, String> properties) throws IOException,
			SaxonApiException, ConfigurationException, ConverterException {
		String toMimeType = toDataType.getMimeType();
		String profile = properties.get(ConverterConfiguration.PROFILE_KEY);
		if (ConverterConfiguration.XML_MIME.equals(toMimeType)
				&& toDataType.getFormat().equals(ConverterConfiguration.TEI)
				&& fromDataType.getFormat().equals(Format.DOCX.getId())) {
			if (!ConverterConfiguration.checkProfile(profile, Format.DOCX
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			transformFromDocX(inputStream, outputStream, profile, properties);
		}
		else if (Format.DOCX.getMimeType().equals(toMimeType)) {
			if (!ConverterConfiguration.checkProfile(profile, Format.DOCX
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			Processor proc = SaxonProcFactory.getProcessor();
			XsltCompiler comp = proc.newXsltCompiler();
			transformToDocX(inputStream, outputStream, proc, comp, profile, properties);
		}
		else if (ConverterConfiguration.XML_MIME.equals(toMimeType)
				&& toDataType.getFormat().equals(ConverterConfiguration.TEI)
				&& fromDataType.getFormat().equals(Format.ODT.getId())) {
			if (!ConverterConfiguration.checkProfile(profile, Format.ODT
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			transformFromOdt(inputStream, outputStream, profile, properties);
		}
		else if (Format.ODT.getMimeType().equals(toMimeType)) {
			if (!ConverterConfiguration.checkProfile(profile, Format.ODT
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			Processor proc = SaxonProcFactory.getProcessor();
			XsltCompiler comp = proc.newXsltCompiler();
			transformToOdt(inputStream, outputStream, proc, comp, profile, properties);
		}
		else if (Format.ODDHTML.getMimeType().equals(toMimeType)
			 && fromDataType.getFormat().equals(Format.ODDHTML.getFormatName())) {
			if (!ConverterConfiguration.checkProfile(profile, Format.ODDHTML
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			properties.put("extension", "html");
			performXsltTransformation(inputStream, outputStream, Format.ODDHTML
					.getProfile(), profile, properties);
		}
		else if (Format.XHTML.getMimeType().equals(toMimeType)) {
			if (!ConverterConfiguration.checkProfile(profile, Format.XHTML
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			properties.put("extension", "html");
			performXsltTransformation(inputStream, outputStream, Format.XHTML
					.getProfile(), profile, properties);
		}
		else if (Format.RELAXNG.getMimeType().equals(toMimeType)) {
			if (!ConverterConfiguration.checkProfile(profile, Format.RELAXNG
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			properties.put("extension", "rng");
			performXsltTransformation(inputStream, outputStream, Format.RELAXNG
					.getProfile(), profile, properties);
		}
		else if (Format.RNC.getMimeType().equals(toMimeType)
			 && fromDataType.getFormat().equals(Format.RNC.getFormatName())) {
			if (!ConverterConfiguration.checkProfile(profile, Format.RELAXNG
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			properties.put("extension", "rnc");
			try {
			    generateRngThenTrang(inputStream, outputStream, Format.RELAXNG
							       .getProfile(), profile, properties);
			}
			catch (Exception e) {
				throw new IOException("to RNG then Trang failed: " + e.toString());
			}
		}
		else if (Format.XSD.getMimeType().equals(toMimeType)
			 && fromDataType.getFormat().equals(Format.XSD.getFormatName())) {
			if (!ConverterConfiguration.checkProfile(profile, Format.RELAXNG
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			properties.put("extension", "xsd");
			try {
			    generateRngThenTrang(inputStream, outputStream, Format.RELAXNG
							       .getProfile(), profile, properties);
			}
			catch (Exception e) {
				throw new IOException("to RNG then Trang failed: " + e.toString());
			}
		}
		else if (Format.DTD.getMimeType().equals(toMimeType)) {
			if (!ConverterConfiguration.checkProfile(profile, Format.DTD
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			properties.put("extension", "dtd");
			performXsltTransformation(inputStream, outputStream, Format.DTD
					.getProfile(), profile, properties);
		}
		else if (Format.LITE.getMimeType().equals(toMimeType)
			 && fromDataType.getFormat().equals(Format.LITE.getFormatName())) {
			if (!ConverterConfiguration.checkProfile(profile, Format.LITE
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			properties.put("extension", "xml");
			performXsltTransformation(inputStream, outputStream, Format.LITE
					.getProfile(), profile, properties);
		}
		else if (Format.LATEX.getMimeType().equals(toMimeType)) {
			if (!ConverterConfiguration.checkProfile(profile, Format.LATEX
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			properties.put("extension", "tex");
			performXsltTransformation(inputStream, outputStream, Format.LATEX
					.getProfile(), profile, properties);
		}
		else if (Format.ODDJSON.getMimeType().equals(toMimeType)) {
			if (!ConverterConfiguration.checkProfile(profile, Format.ODDJSON
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			properties.put("extension", "json");
			performXsltTransformation(inputStream, outputStream, Format.ODDJSON
					.getProfile(), profile, properties);
		}
		else if (Format.FO.getMimeType().equals(toMimeType)) {
			if (!ConverterConfiguration.checkProfile(profile, Format.FO
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			properties.put("extension", "fo");
			performXsltTransformation(inputStream, outputStream, Format.FO
					.getProfile(), profile, properties);
		}
		else if (Format.EPUB.getMimeType().equals(toMimeType)) {
			if (!ConverterConfiguration.checkProfile(profile, Format.EPUB
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			transformToEpub(inputStream, outputStream, profile, Format.EPUB.getProfile(), properties);
		}
		else if (Format.TEXT.getMimeType().equals(toMimeType)
			 && fromDataType.getFormat().equals(Format.TEXT.getFormatName())) {
			if (!ConverterConfiguration.checkProfile(profile, Format.TEXT
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			properties.put("extension", "txt");
			performXsltTransformation(inputStream, outputStream, Format.TEXT
					.getProfile(), profile, properties);
		}
		else if (Format.XML.getMimeType().equals(toMimeType)
			 && fromDataType.getFormat().equals(Format.XML.getFormatName())) {
			if (!ConverterConfiguration.checkProfile(profile, Format.XML
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			properties.put("extension", "xml");
			performXsltTransformation(inputStream, outputStream, Format.XML
					.getProfile(), profile, properties);
		}
		else if (Format.RDF.getMimeType().equals(toMimeType)
			 && fromDataType.getFormat().equals(Format.RDF.getFormatName())) {
			if (!ConverterConfiguration.checkProfile(profile, Format.RDF
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			properties.put("extension", "rdf");
			performXsltTransformation(inputStream, outputStream, Format.RDF
					.getProfile(), profile, properties);
		}
	}

Output:
	private void convertDocument(InputStream inputStream, OutputStream outputStream,
			DataType fromDataType, DataType toDataType, Map<String, String> properties) throws IOException,
			SaxonApiException, ConfigurationException, ConverterException {
		String toMimeType = toDataType.getMimeType();
		String profile = properties.get(ConverterConfiguration.PROFILE_KEY);
		if (ConverterConfiguration.XML_MIME.equals(toMimeType)
				&& toDataType.getFormat().equals(ConverterConfiguration.TEI)
				&& fromDataType.getFormat().equals(Format.DOCX.getId())) {
			if (!ConverterConfiguration.checkProfile(profile, Format.DOCX
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			transformFromDocX(inputStream, outputStream, profile, properties);
		}
		else if (Format.DOCX.getMimeType().equals(toMimeType)) {
			if (!ConverterConfiguration.checkProfile(profile, Format.DOCX
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			Processor proc = SaxonProcFactory.getProcessor();
			XsltCompiler comp = proc.newXsltCompiler();
			transformToDocX(inputStream, outputStream, proc, comp, profile, properties);
		}
		else if (ConverterConfiguration.XML_MIME.equals(toMimeType)
				&& toDataType.getFormat().equals(ConverterConfiguration.TEI)
				&& fromDataType.getFormat().equals(Format.ODT.getId())) {
			if (!ConverterConfiguration.checkProfile(profile, Format.ODT
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			transformFromOdt(inputStream, outputStream, profile, properties);
		}
		else if (Format.ODT.getMimeType().equals(toMimeType)) {
			if (!ConverterConfiguration.checkProfile(profile, Format.ODT
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			Processor proc = SaxonProcFactory.getProcessor();
			XsltCompiler comp = proc.newXsltCompiler();
			transformToOdt(inputStream, outputStream, proc, comp, profile, properties);
		}
		else if (Format.ODDHTML.getMimeType().equals(toMimeType)
			 && fromDataType.getFormat().equals(Format.ODDHTML.getFormatName())) {
			if (!ConverterConfiguration.checkProfile(profile, Format.ODDHTML
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			properties.put("extension", "html");
			performXsltTransformation(inputStream, outputStream, Format.ODDHTML
					.getProfile(), profile, properties);
		}
		else if (Format.XHTML.getMimeType().equals(toMimeType)) {
			if (!ConverterConfiguration.checkProfile(profile, Format.XHTML
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			properties.put("extension", "html");
			performXsltTransformation(inputStream, outputStream, Format.XHTML
					.getProfile(), profile, properties);
		}
		else if (Format.RELAXNG.getMimeType().equals(toMimeType)) {
			if (!ConverterConfiguration.checkProfile(profile, Format.RELAXNG
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			properties.put("extension", "rng");
			performXsltTransformation(inputStream, outputStream, Format.RELAXNG
					.getProfile(), profile, properties);
		}
		else if (Format.RNC.getMimeType().equals(toMimeType)
			 && fromDataType.getFormat().equals(Format.RNC.getFormatName())) {
			if (!ConverterConfiguration.checkProfile(profile, Format.RELAXNG
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			properties.put("extension", "rnc");
			try {
			    generateRngThenTrang(inputStream, outputStream, Format.RELAXNG
							       .getProfile(), profile, properties);
			}
			catch (Exception e) {
				throw new IOException("to RNG then Trang failed: " + e.toString());
			}
		}
		else if (Format.XSD.getMimeType().equals(toMimeType)
			 && fromDataType.getFormat().equals(Format.XSD.getFormatName())) {
			if (!ConverterConfiguration.checkProfile(profile, Format.RELAXNG
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			properties.put("extension", "zip");
			try {
			    generateRngThenTrang(inputStream, outputStream, Format.RELAXNG
							       .getProfile(), profile, properties);
			}
			catch (Exception e) {
				throw new IOException("to RNG then Trang failed: " + e.toString());
			}
		}
		else if (Format.DTD.getMimeType().equals(toMimeType)) {
			if (!ConverterConfiguration.checkProfile(profile, Format.DTD
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			properties.put("extension", "dtd");
			performXsltTransformation(inputStream, outputStream, Format.DTD
					.getProfile(), profile, properties);
		}
		else if (Format.LITE.getMimeType().equals(toMimeType)
			 && fromDataType.getFormat().equals(Format.LITE.getFormatName())) {
			if (!ConverterConfiguration.checkProfile(profile, Format.LITE
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			properties.put("extension", "xml");
			performXsltTransformation(inputStream, outputStream, Format.LITE
					.getProfile(), profile, properties);
		}
		else if (Format.LATEX.getMimeType().equals(toMimeType)) {
			if (!ConverterConfiguration.checkProfile(profile, Format.LATEX
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			properties.put("extension", "tex");
			performXsltTransformation(inputStream, outputStream, Format.LATEX
					.getProfile(), profile, properties);
		}
		else if (Format.ODDJSON.getMimeType().equals(toMimeType)) {
			if (!ConverterConfiguration.checkProfile(profile, Format.ODDJSON
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			properties.put("extension", "json");
			performXsltTransformation(inputStream, outputStream, Format.ODDJSON
					.getProfile(), profile, properties);
		}
		else if (Format.FO.getMimeType().equals(toMimeType)) {
			if (!ConverterConfiguration.checkProfile(profile, Format.FO
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			properties.put("extension", "fo");
			performXsltTransformation(inputStream, outputStream, Format.FO
					.getProfile(), profile, properties);
		}
		else if (Format.EPUB.getMimeType().equals(toMimeType)) {
			if (!ConverterConfiguration.checkProfile(profile, Format.EPUB
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			transformToEpub(inputStream, outputStream, profile, Format.EPUB.getProfile(), properties);
		}
		else if (Format.TEXT.getMimeType().equals(toMimeType)
			 && fromDataType.getFormat().equals(Format.TEXT.getFormatName())) {
			if (!ConverterConfiguration.checkProfile(profile, Format.TEXT
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			properties.put("extension", "txt");
			performXsltTransformation(inputStream, outputStream, Format.TEXT
					.getProfile(), profile, properties);
		}
		else if (Format.XML.getMimeType().equals(toMimeType)
			 && fromDataType.getFormat().equals(Format.XML.getFormatName())) {
			if (!ConverterConfiguration.checkProfile(profile, Format.XML
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			properties.put("extension", "xml");
			performXsltTransformation(inputStream, outputStream, Format.XML
					.getProfile(), profile, properties);
		}
		else if (Format.RDF.getMimeType().equals(toMimeType)
			 && fromDataType.getFormat().equals(Format.RDF.getFormatName())) {
			if (!ConverterConfiguration.checkProfile(profile, Format.RDF
					.getProfile())) {
				LOGGER.debug(ConverterConfiguration.PROFILE_NOT_FOUND_MSG);
				profile = EGEConstants.DEFAULT_PROFILE;
			}
			properties.put("extension", "rdf");
			performXsltTransformation(inputStream, outputStream, Format.RDF
					.getProfile(), profile, properties);
		}
	}


Input:
	public static void main(String[] args) {
		String str = null;
		String str2 = "Object";
		int n = 10;
		n = n + 1;
		if (str instanceof String) {
			System.out.println("STRING");
		} else if (str2.equals(str)) {
			System.out.println("EQUAL");
		}
		switch (n) {
			case 1 :
				System.out.println(n);
				break;
			case 2 :
				System.out.println(n + 1);
				break;
			case 3 :
				System.out.println(n + 1);
				break;
			default :
				System.out.println(n + 3);
				break;
		}
		String str3 = "Test";
		Boolean bool = true;
		System.out.println(bool);
		int x = 10;
		boolean ean = true;
		if (ean == false) {
			System.out.println("STRING");
		}
		int b = 100;
		b = 10;
	}

Output:
	public static void main(String[] args) {
		String str = null;
		String str2 = "Object";
		int n = 10;
		n = n + 1;
		if (str instanceof String) {
			System.out.println("STRING");
		} else if (str2.equals(str)) {
			System.out.println("EQUAL");
		}
		switch (n) {
			case 1 :
				System.out.println(n);
			case 2 :
				System.out.println(n + 1);
			case 3 :
				System.out.println(n + 1);
			default :
				System.out.println(n + 3);
		}
		String str3 = "Test";
		Boolean bool = true;
		System.out.println(bool);
		int x = 10;
		boolean ean = true;
		if (ean == false) {
			System.out.println("STRING");
		}
		int b = 100;
		b = 10;
	}


Input:
	protected void extractResult(Message reqMessage, List<IIndexerDocument> results) {
		List<Message> messageList = null;
		synchronized (this.resultMap) {
			if (!this.resultMap.containsKey(Integer.valueOf(reqMessage.getMessageNumber()))) {
				this.logger.warn("Unknown requestID: " + reqMessage.getMessageNumber());
				messageList = Collections.EMPTY_LIST;
			} else {
				messageList = this.resultMap.remove(Integer.valueOf(reqMessage.getMessageNumber()));
			}
		}
		for (Message msg : messageList) {
			try {
				MessageElement resultListElement = msg.getMessageElement(SearchServiceConstants.RESP_RESULT);
				SAXReader reader = new SAXReader();
				Document xmlDoc = reader.read(resultListElement.getStream());
				Element xmlRoot = xmlDoc.getRootElement();
		        for (Iterator<Element> i = xmlRoot.elementIterator(SearchServiceConstants.RESULT_ENTRY); i.hasNext(); ) {
		            Element resultElement = i.next();
			        for (Iterator<Element> j = resultElement.elementIterator(SearchServiceConstants.RESULT_ENTRY_ITEM); j.hasNext(); ) {
			        	Element resultItemElement = j.next();
			        	IndexerDocument indexerDoc = new IndexerDocument();
			        	for (Iterator<Element> k = resultItemElement.elementIterator(); k.hasNext(); ) {
			        		Element resultItemFieldElement = k.next();
			        		String fieldName = resultItemFieldElement.getName();
			        		String fieldValue = resultItemFieldElement.getText();
			        		final org.paxle.core.doc.Field<?> pfield = this.fieldManager.get(fieldName);
			    			if (pfield != null) {
			    				indexerDoc.put(pfield, fieldValue);
			    			}
			        	}
			        	results.add(indexerDoc);
			        }
		        }
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}

Output:
	protected void extractResult(Message reqMessage, List<IIndexerDocument> results) {
		List<Message> messageList = null;
		synchronized (this.resultMap) {
			if (!this.resultMap.containsKey(Integer.valueOf(reqMessage.getMessageNumber()))) {
				this.logger.warn("Unknown requestID: " + reqMessage.getMessageNumber());
				messageList = Collections.emptyList();
			} else {
				messageList = this.resultMap.remove(Integer.valueOf(reqMessage.getMessageNumber()));
			}
		}
		for (Message msg : messageList) {
			try {
				MessageElement resultListElement = msg.getMessageElement(SearchServiceConstants.RESP_RESULT);
				SAXReader reader = new SAXReader();
				Document xmlDoc = reader.read(resultListElement.getStream());
				Element xmlRoot = xmlDoc.getRootElement();
		        for (Iterator<Element> i = xmlRoot.elementIterator(SearchServiceConstants.RESULT_ENTRY); i.hasNext(); ) {
		            Element resultElement = i.next();
			        for (Iterator<Element> j = resultElement.elementIterator(SearchServiceConstants.RESULT_ENTRY_ITEM); j.hasNext(); ) {
			        	Element resultItemElement = j.next();
			        	IndexerDocument indexerDoc = new IndexerDocument();
			        	for (Iterator<Element> k = resultItemElement.elementIterator(); k.hasNext(); ) {
			        		Element resultItemFieldElement = k.next();
			        		String fieldName = resultItemFieldElement.getName();
			        		String fieldValue = resultItemFieldElement.getText();
			        		final org.paxle.core.doc.Field<?> pfield = this.fieldManager.get(fieldName);
			    			if (pfield != null) {
			    				indexerDoc.put(pfield, fieldValue);
			    			}
			        	}
			        	results.add(indexerDoc);
			        }
		        }
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}


Input:
    public Contact insert(Contact contact) throws SaveException {
        final String query = "INSERT INTO Contact (Contact_Name "
                + "Contact_Zip_Code, Contact_City, Contact_Street, Contact_Street_Number, "
                + "Contact_Shortcut, Contact_Phone, Contact_Fax, Contact_Mobile, Contact_Email) "
                + "VALUES (:name, :zipCode, :city, :street, :streetNumber, "
                + ":shortcut, :phone, :fax, :mobile, :email);";
        try (Connection con = DatabaseFactory.getConnection()) {
            try (NamedParameterStatement stmt = NamedParameterStatement.fromConnection(con, query)) {
                stmt.setParameter("name", contact.getName());
                stmt.setParameter("zipCode", contact.getPostCode());
                stmt.setParameter("city", contact.getCity());
                stmt.setParameter("street", contact.getStreet());
                stmt.setParameter("streetNumber", contact.getStreetNo());
                stmt.setParameter("shortcut", contact.getShortcut().orNull());
                stmt.setParameter("phone", contact.getPhone().orNull());
                stmt.setParameter("fax", contact.getFax().orNull());
                stmt.setParameter("mobile", contact.getMobile().orNull());
                stmt.setParameter("email", contact.getEmail().orNull());
                int affectedRows = stmt.executeUpdate();
                if (affectedRows != 1) {
                    throw new SaveException();
                }
                try (ResultSet generatedKeys = stmt.getGeneratedKeys()) {
                    if (generatedKeys.next()) {
                        int id = generatedKeys.getInt(1);
                        Contact inserted = new Contact(id, contact.getName(), contact.getStreet(),
                                contact.getStreetNo(), contact.getPostCode(), contact.getCity());
                        inserted.setShortcut(contact.getShortcut().orNull());
                        inserted.setPhone(contact.getPhone().orNull());
                        inserted.setFax(contact.getFax().orNull());
                        inserted.setMobile(contact.getMobile().orNull());
                        inserted.setEmail(contact.getEmail().orNull());
                        return inserted;
                    }
                    else {
                        throw new SaveException("Could not retrieve generated ID.");
                    }
                }
            }
        }
        catch (SQLException | DatabaseException e) {
            throw new SaveException(e);
        }
    }

Output:
    public Contact insert(Contact contact) throws SaveException {
        final String query = "INSERT INTO Contact (Contact_Name, "
                + "Contact_Zip_Code, Contact_City, Contact_Street, Contact_Street_Number, "
                + "Contact_Shortcut, Contact_Phone, Contact_Fax, Contact_Mobile, Contact_Email) "
                + "VALUES (:name, :zipCode, :city, :street, :streetNumber, "
                + ":shortcut, :phone, :fax, :mobile, :email);";
        try (Connection con = DatabaseFactory.getConnection()) {
            try (NamedParameterStatement stmt = NamedParameterStatement.fromConnection(con, query)) {
                stmt.setParameter("name", contact.getName());
                stmt.setParameter("zipCode", contact.getPostCode());
                stmt.setParameter("city", contact.getCity());
                stmt.setParameter("street", contact.getStreet());
                stmt.setParameter("streetNumber", contact.getStreetNo());
                stmt.setParameter("shortcut", contact.getShortcut().orNull());
                stmt.setParameter("phone", contact.getPhone().orNull());
                stmt.setParameter("fax", contact.getFax().orNull());
                stmt.setParameter("mobile", contact.getMobile().orNull());
                stmt.setParameter("email", contact.getEmail().orNull());
                int affectedRows = stmt.executeUpdate();
                if (affectedRows != 1) {
                    throw new SaveException();
                }
                try (ResultSet generatedKeys = stmt.getGeneratedKeys()) {
                    if (generatedKeys.next()) {
                        int id = generatedKeys.getInt(1);
                        Contact inserted = new Contact(id, contact.getName(), contact.getStreet(),
                                contact.getStreetNo(), contact.getPostCode(), contact.getCity());
                        inserted.setShortcut(contact.getShortcut().orNull());
                        inserted.setPhone(contact.getPhone().orNull());
                        inserted.setFax(contact.getFax().orNull());
                        inserted.setMobile(contact.getMobile().orNull());
                        inserted.setEmail(contact.getEmail().orNull());
                        return inserted;
                    }
                    else {
                        throw new SaveException("Could not retrieve generated ID.");
                    }
                }
            }
        }
        catch (SQLException | DatabaseException e) {
            throw new SaveException(e);
        }
    }


Input:
	protected List<Element> handleModFind( Element contextNode, Element node ) {
		List<Element> result = null;
		if ( node.getNamespace().equals( modNS ) ) {
			if ( node.getName().equals( "findName" ) ) {
				String searchName = node.getAttributeValue( "name" );
				String searchType = node.getAttributeValue( "type" );
				boolean searchReverse = getAttributeBooleanValue( node, "reverse", true );
				int searchStart = getAttributeIntValue( node, "start", 0 );
				int searchLimit = getAttributeIntValue( node, "limit", 1 );
				boolean panic = getAttributeBooleanValue( node, "panic", false );
				if ( searchName == null || searchName.length() == 0 )
					throw new IllegalArgumentException( String.format( "<%s> requires a name attribute (%s).", node.getName(), getPathToRoot(node) ) );
				if ( searchType != null && searchType.length() == 0 )
					throw new IllegalArgumentException( String.format( "<%s> type attribute, when present, can't be empty (%s).", node.getName(), getPathToRoot(node) ) );
				if ( searchStart < 0 )
					throw new IllegalArgumentException( String.format( "<%s> 'start' attribute is not >= 0 (%s).", node.getName(), getPathToRoot(node) ) );
				if ( searchLimit < -1 )
					throw new IllegalArgumentException( String.format( "<%s> 'limit' attribute is not >= -1 (%s).", node.getName(), getPathToRoot(node) ) );
				Map<String,String> attrMap = new HashMap<String,String>();
				attrMap.put( "name", searchName );
				LikeFilter searchFilter = new LikeFilter( searchType, attrMap, null );
				List<Element> matchedNodes = new ArrayList<Element>( contextNode.getContent( searchFilter ) );
				if ( searchReverse ) Collections.reverse( matchedNodes );
				if ( searchStart < matchedNodes.size() ) {
					if ( searchLimit > -1 ) {
						matchedNodes = matchedNodes.subList( searchStart, Math.max( matchedNodes.size(), searchStart + searchLimit ) );
					} else if ( searchStart > 0 ) {
						matchedNodes = matchedNodes.subList( searchStart, matchedNodes.size() );
					}
				}
				if ( panic && matchedNodes.isEmpty() )
					throw new NoSuchElementException( String.format( "<%s> was set to require results but found none (%s).", node.getName(), getPathToRoot(node) ) );
				result = matchedNodes;
			}
			else if ( node.getName().equals( "findLike" ) ) {
				String searchType = node.getAttributeValue( "type" );
				boolean searchReverse = getAttributeBooleanValue( node, "reverse", false );
				int searchStart = getAttributeIntValue( node, "start", 0 );
				int searchLimit = getAttributeIntValue( node, "limit", -1 );
				boolean panic = getAttributeBooleanValue( node, "panic", false );
				if ( searchType != null && searchType.length() == 0 )
					throw new IllegalArgumentException( String.format( "<%s> type attribute, when present, can't be empty (%s).", node.getName(), getPathToRoot(node) ) );
				if ( searchStart < 0 )
					throw new IllegalArgumentException( String.format( "<%s> 'start' attribute is not >= 0 (%s).", node.getName(), getPathToRoot(node) ) );
				if ( searchLimit < -1 )
					throw new IllegalArgumentException( String.format( "<%s> 'limit' attribute is not >= -1 (%s).", node.getName(), getPathToRoot(node) ) );
				Map<String,String> attrMap = new HashMap<String,String>();
				String searchValue = null;
				Element selectorNode = node.getChild( "selector", modNS );
				if ( selectorNode != null ) {
					for ( Attribute attr : selectorNode.getAttributes() ) {
						if ( attr.getNamespace().equals( Namespace.NO_NAMESPACE ) ) {
							if ( attr.getValue().length() == 0 )
								throw new IllegalArgumentException( String.format( "<%s> attributes, when present, can't be empty (%s).", selectorNode.getName(), getPathToRoot(selectorNode) ) );
							attrMap.put( attr.getName(), attr.getValue() );
						}
					}
					searchValue = selectorNode.getTextTrim();
					if ( searchValue.length() > 0 ) searchValue = null;
				}
				LikeFilter searchFilter = new LikeFilter( searchType, attrMap, searchValue );
				List<Element> matchedNodes = new ArrayList<Element>( contextNode.getContent( searchFilter ) );
				if ( searchReverse ) Collections.reverse( matchedNodes );
				if ( searchStart < matchedNodes.size() ) {
					if ( searchLimit > -1 ) {
						matchedNodes = matchedNodes.subList( searchStart, Math.max( matchedNodes.size(), searchStart + searchLimit ) );
					} else if ( searchStart > 0 ) {
						matchedNodes = matchedNodes.subList( searchStart, matchedNodes.size() );
					}
				}
				if ( panic && matchedNodes.isEmpty() )
					throw new NoSuchElementException( String.format( "<%s> was set to require results but found none (%s).", node.getName(), getPathToRoot(node) ) );
				result = matchedNodes;
			}
			else if ( node.getName().equals( "findWithChildLike" ) ) {
				String searchType = node.getAttributeValue( "type" );
				String searchChildType = node.getAttributeValue( "child-type" );
				boolean searchReverse = getAttributeBooleanValue( node, "reverse", false );
				int searchStart = getAttributeIntValue( node, "start", 0 );
				int searchLimit = getAttributeIntValue( node, "limit", -1 );
				boolean panic = getAttributeBooleanValue( node, "panic", false );
				if ( searchType != null && searchType.length() == 0 )
					throw new IllegalArgumentException( String.format( "<%s> type attribute, when present, can't be empty (%s).", node.getName(), getPathToRoot(node) ) );
				if ( searchChildType != null && searchChildType.length() == 0 )
					throw new IllegalArgumentException( String.format( "<%s> child-type attribute, when present, can't be empty (%s).", node.getName(), getPathToRoot(node) ) );
				if ( searchStart < 0 )
					throw new IllegalArgumentException( String.format( "<%s> 'start' attribute is not >= 0 (%s).", node.getName(), getPathToRoot(node) ) );
				if ( searchLimit < -1 )
					throw new IllegalArgumentException( String.format( "<%s> 'limit' attribute is not >= -1 (%s).", node.getName(), getPathToRoot(node) ) );
				Map<String,String> attrMap = new HashMap<String,String>();
				String searchValue = null;
				Element selectorNode = node.getChild( "selector", modNS );
				if ( selectorNode != null ) {
					for ( Attribute attr : selectorNode.getAttributes() ) {
						if ( attr.getNamespace().equals( Namespace.NO_NAMESPACE ) ) {
							attrMap.put( attr.getName(), attr.getValue() );
						}
					}
					searchValue = selectorNode.getTextTrim();
					if ( searchValue.length() > 0 ) searchValue = null;
				}
				LikeFilter searchChildFilter = new LikeFilter( searchChildType, attrMap, searchValue );
				WithChildFilter searchFilter = new WithChildFilter( searchType, searchChildFilter );
				List<Element> matchedNodes = new ArrayList<Element>( contextNode.getContent( searchFilter ) );
				if ( searchReverse ) Collections.reverse( matchedNodes );
				if ( searchStart < matchedNodes.size() ) {
					if ( searchLimit > -1 ) {
						matchedNodes = matchedNodes.subList( searchStart, Math.max( matchedNodes.size(), searchStart + searchLimit ) );
					} else if ( searchStart > 0 ) {
						matchedNodes = matchedNodes.subList( searchStart, matchedNodes.size() );
					}
				}
				if ( panic && matchedNodes.isEmpty() )
					throw new NoSuchElementException( String.format( "<%s> was set to require results but found none (%s).", node.getName(), getPathToRoot(node) ) );
				result = matchedNodes;
			}
			else if ( node.getName().equals( "findComposite" ) ) {
				boolean searchReverse = getAttributeBooleanValue( node, "reverse", false );
				int searchStart = getAttributeIntValue( node, "start", 0 );
				int searchLimit = getAttributeIntValue( node, "limit", -1 );
				boolean panic = getAttributeBooleanValue( node, "panic", false );
				if ( searchStart < 0 )
					throw new IllegalArgumentException( String.format( "<%s> 'start' attribute is not >= 0 (%s).", node.getName(), getPathToRoot(node) ) );
				if ( searchLimit < -1 )
					throw new IllegalArgumentException( String.format( "<%s> 'limit' attribute is not >= -1 (%s).", node.getName(), getPathToRoot(node) ) );
				Element parNode = node.getChild( "par", modNS );
				if ( parNode == null )
					throw new IllegalArgumentException( String.format( "<%s> requires a <par> tag (%s).", node.getName(), getPathToRoot(node) ) );
				List<Element> matchedNodes = handleModPar( contextNode, parNode );
				if ( searchReverse ) Collections.reverse( matchedNodes );
				if ( searchStart < matchedNodes.size() ) {
					if ( searchLimit > -1 ) {
						matchedNodes = matchedNodes.subList( searchStart, Math.max( matchedNodes.size(), searchStart + searchLimit ) );
					} else if ( searchStart > 0 ) {
						matchedNodes = matchedNodes.subList( searchStart, matchedNodes.size() );
					}
				}
				if ( panic && matchedNodes.isEmpty() )
					throw new NoSuchElementException( String.format( "<%s> was set to require results but found none (%s).", node.getName(), getPathToRoot(node) ) );
				result = matchedNodes;
			}
		}
		return result;
	}

Output:
	protected List<Element> handleModFind( Element contextNode, Element node ) {
		List<Element> result = null;
		if ( node.getNamespace().equals( modNS ) ) {
			if ( node.getName().equals( "findName" ) ) {
				String searchName = node.getAttributeValue( "name" );
				String searchType = node.getAttributeValue( "type" );
				boolean searchReverse = getAttributeBooleanValue( node, "reverse", true );
				int searchStart = getAttributeIntValue( node, "start", 0 );
				int searchLimit = getAttributeIntValue( node, "limit", 1 );
				boolean panic = getAttributeBooleanValue( node, "panic", false );
				if ( searchName == null || searchName.length() == 0 )
					throw new IllegalArgumentException( String.format( "<%s> requires a name attribute (%s).", node.getName(), getPathToRoot(node) ) );
				if ( searchType != null && searchType.length() == 0 )
					throw new IllegalArgumentException( String.format( "<%s> type attribute, when present, can't be empty (%s).", node.getName(), getPathToRoot(node) ) );
				if ( searchStart < 0 )
					throw new IllegalArgumentException( String.format( "<%s> 'start' attribute is not >= 0 (%s).", node.getName(), getPathToRoot(node) ) );
				if ( searchLimit < -1 )
					throw new IllegalArgumentException( String.format( "<%s> 'limit' attribute is not >= -1 (%s).", node.getName(), getPathToRoot(node) ) );
				Map<String,String> attrMap = new HashMap<String,String>();
				attrMap.put( "name", searchName );
				LikeFilter searchFilter = new LikeFilter( searchType, attrMap, null );
				List<Element> matchedNodes = new ArrayList<Element>( contextNode.getContent( searchFilter ) );
				if ( searchReverse ) Collections.reverse( matchedNodes );
				if ( searchStart < matchedNodes.size() ) {
					if ( searchLimit > -1 ) {
						matchedNodes = matchedNodes.subList( searchStart, Math.max( matchedNodes.size(), searchStart + searchLimit ) );
					} else if ( searchStart > 0 ) {
						matchedNodes = matchedNodes.subList( searchStart, matchedNodes.size() );
					}
				}
				if ( panic && matchedNodes.isEmpty() )
					throw new NoSuchElementException( String.format( "<%s> was set to require results but found none (%s).", node.getName(), getPathToRoot(node) ) );
				result = matchedNodes;
			}
			else if ( node.getName().equals( "findLike" ) ) {
				String searchType = node.getAttributeValue( "type" );
				boolean searchReverse = getAttributeBooleanValue( node, "reverse", false );
				int searchStart = getAttributeIntValue( node, "start", 0 );
				int searchLimit = getAttributeIntValue( node, "limit", -1 );
				boolean panic = getAttributeBooleanValue( node, "panic", false );
				if ( searchType != null && searchType.length() == 0 )
					throw new IllegalArgumentException( String.format( "<%s> type attribute, when present, can't be empty (%s).", node.getName(), getPathToRoot(node) ) );
				if ( searchStart < 0 )
					throw new IllegalArgumentException( String.format( "<%s> 'start' attribute is not >= 0 (%s).", node.getName(), getPathToRoot(node) ) );
				if ( searchLimit < -1 )
					throw new IllegalArgumentException( String.format( "<%s> 'limit' attribute is not >= -1 (%s).", node.getName(), getPathToRoot(node) ) );
				Map<String,String> attrMap = new HashMap<String,String>();
				String searchValue = null;
				Element selectorNode = node.getChild( "selector", modNS );
				if ( selectorNode != null ) {
					for ( Attribute attr : selectorNode.getAttributes() ) {
						if ( attr.getNamespace().equals( Namespace.NO_NAMESPACE ) ) {
							if ( attr.getValue().length() == 0 )
								throw new IllegalArgumentException( String.format( "<%s> attributes, when present, can't be empty (%s).", selectorNode.getName(), getPathToRoot(selectorNode) ) );
							attrMap.put( attr.getName(), attr.getValue() );
						}
					}
					searchValue = selectorNode.getTextTrim();
					if ( searchValue.length() == 0 ) searchValue = null;
				}
				LikeFilter searchFilter = new LikeFilter( searchType, attrMap, searchValue );
				List<Element> matchedNodes = new ArrayList<Element>( contextNode.getContent( searchFilter ) );
				if ( searchReverse ) Collections.reverse( matchedNodes );
				if ( searchStart < matchedNodes.size() ) {
					if ( searchLimit > -1 ) {
						matchedNodes = matchedNodes.subList( searchStart, Math.max( matchedNodes.size(), searchStart + searchLimit ) );
					} else if ( searchStart > 0 ) {
						matchedNodes = matchedNodes.subList( searchStart, matchedNodes.size() );
					}
				}
				if ( panic && matchedNodes.isEmpty() )
					throw new NoSuchElementException( String.format( "<%s> was set to require results but found none (%s).", node.getName(), getPathToRoot(node) ) );
				result = matchedNodes;
			}
			else if ( node.getName().equals( "findWithChildLike" ) ) {
				String searchType = node.getAttributeValue( "type" );
				String searchChildType = node.getAttributeValue( "child-type" );
				boolean searchReverse = getAttributeBooleanValue( node, "reverse", false );
				int searchStart = getAttributeIntValue( node, "start", 0 );
				int searchLimit = getAttributeIntValue( node, "limit", -1 );
				boolean panic = getAttributeBooleanValue( node, "panic", false );
				if ( searchType != null && searchType.length() == 0 )
					throw new IllegalArgumentException( String.format( "<%s> type attribute, when present, can't be empty (%s).", node.getName(), getPathToRoot(node) ) );
				if ( searchChildType != null && searchChildType.length() == 0 )
					throw new IllegalArgumentException( String.format( "<%s> child-type attribute, when present, can't be empty (%s).", node.getName(), getPathToRoot(node) ) );
				if ( searchStart < 0 )
					throw new IllegalArgumentException( String.format( "<%s> 'start' attribute is not >= 0 (%s).", node.getName(), getPathToRoot(node) ) );
				if ( searchLimit < -1 )
					throw new IllegalArgumentException( String.format( "<%s> 'limit' attribute is not >= -1 (%s).", node.getName(), getPathToRoot(node) ) );
				Map<String,String> attrMap = new HashMap<String,String>();
				String searchValue = null;
				Element selectorNode = node.getChild( "selector", modNS );
				if ( selectorNode != null ) {
					for ( Attribute attr : selectorNode.getAttributes() ) {
						if ( attr.getNamespace().equals( Namespace.NO_NAMESPACE ) ) {
							attrMap.put( attr.getName(), attr.getValue() );
						}
					}
					searchValue = selectorNode.getTextTrim();
					if ( searchValue.length() == 0 ) searchValue = null;
				}
				LikeFilter searchChildFilter = new LikeFilter( searchChildType, attrMap, searchValue );
				WithChildFilter searchFilter = new WithChildFilter( searchType, searchChildFilter );
				List<Element> matchedNodes = new ArrayList<Element>( contextNode.getContent( searchFilter ) );
				if ( searchReverse ) Collections.reverse( matchedNodes );
				if ( searchStart < matchedNodes.size() ) {
					if ( searchLimit > -1 ) {
						matchedNodes = matchedNodes.subList( searchStart, Math.max( matchedNodes.size(), searchStart + searchLimit ) );
					} else if ( searchStart > 0 ) {
						matchedNodes = matchedNodes.subList( searchStart, matchedNodes.size() );
					}
				}
				if ( panic && matchedNodes.isEmpty() )
					throw new NoSuchElementException( String.format( "<%s> was set to require results but found none (%s).", node.getName(), getPathToRoot(node) ) );
				result = matchedNodes;
			}
			else if ( node.getName().equals( "findComposite" ) ) {
				boolean searchReverse = getAttributeBooleanValue( node, "reverse", false );
				int searchStart = getAttributeIntValue( node, "start", 0 );
				int searchLimit = getAttributeIntValue( node, "limit", -1 );
				boolean panic = getAttributeBooleanValue( node, "panic", false );
				if ( searchStart < 0 )
					throw new IllegalArgumentException( String.format( "<%s> 'start' attribute is not >= 0 (%s).", node.getName(), getPathToRoot(node) ) );
				if ( searchLimit < -1 )
					throw new IllegalArgumentException( String.format( "<%s> 'limit' attribute is not >= -1 (%s).", node.getName(), getPathToRoot(node) ) );
				Element parNode = node.getChild( "par", modNS );
				if ( parNode == null )
					throw new IllegalArgumentException( String.format( "<%s> requires a <par> tag (%s).", node.getName(), getPathToRoot(node) ) );
				List<Element> matchedNodes = handleModPar( contextNode, parNode );
				if ( searchReverse ) Collections.reverse( matchedNodes );
				if ( searchStart < matchedNodes.size() ) {
					if ( searchLimit > -1 ) {
						matchedNodes = matchedNodes.subList( searchStart, Math.max( matchedNodes.size(), searchStart + searchLimit ) );
					} else if ( searchStart > 0 ) {
						matchedNodes = matchedNodes.subList( searchStart, matchedNodes.size() );
					}
				}
				if ( panic && matchedNodes.isEmpty() )
					throw new NoSuchElementException( String.format( "<%s> was set to require results but found none (%s).", node.getName(), getPathToRoot(node) ) );
				result = matchedNodes;
			}
		}
		return result;
	}


Input:
    public ResourceBundle getBundle() {
        if (this.bundle == null) {
            Locale locale = getLocale();
            String baseName = (String) get(Config.FMT_LOCALIZATION_CONTEXT);
            if (baseName == null) {
                baseName = DEFAULT_BUNDLE_NAME;
            }
            try {
				this.bundle = new SafeResourceBundle(ResourceBundle.getBundle(baseName, locale));
			} catch (MissingResourceException e) {
				logger.warn("couldn't find message bundle, creating an empty one", e);
				this.bundle = new SafeResourceBundle(createEmptyBundle());
			}
        }
        return this.bundle;
    }

Output:
    public ResourceBundle getBundle() {
        if (this.bundle == null) {
            Locale locale = getLocale();
            String baseName = (String) get(Config.FMT_LOCALIZATION_CONTEXT);
            if (baseName == null) {
                baseName = DEFAULT_BUNDLE_NAME;
            }
            try {
				this.bundle = new SafeResourceBundle(ResourceBundle.getBundle(baseName, locale));
			} catch (MissingResourceException e) {
				logger.warn("couldn't find message bundle, creating an empty one");
				this.bundle = new SafeResourceBundle(createEmptyBundle());
			}
        }
        return this.bundle;
    }


Input:
    public boolean isPluginWebResourceBatchingEnabled()
    {
        final String explicitSetting = System.getProperty(PLUGIN_WEBRESOURCE_BATCHING_OFF);
        if (explicitSetting != null)
        {
            return Boolean.parseBoolean(explicitSetting);
        }
        else
        {
            return Boolean.parseBoolean(System.getProperty(PluginUtils.ATLASSIAN_DEV_MODE));
        }
    }

Output:
    public boolean isPluginWebResourceBatchingEnabled()
    {
        final String explicitSetting = System.getProperty(PLUGIN_WEBRESOURCE_BATCHING_OFF);
        if (explicitSetting != null)
        {
            return !Boolean.parseBoolean(explicitSetting);
        }
        else
        {
            return !Boolean.parseBoolean(System.getProperty(PluginUtils.ATLASSIAN_DEV_MODE));
        }
    }


Input:
	public boolean ausfuehren(ServerKontext kontext, Spieler spieler,
			Befehlszeile befehlszeile)
	{
		String string = befehlszeile.getGeparsteZeile().get(1);
		if("katze".equals(string))
		{
			kontext.schreibeAnSpieler(spieler, "Katzen:");
			for(Raum raum : kontext.getRaeume())
			{
				if(raum.hasKatze())
					kontext.schreibeAnSpieler(spieler, raum.getName());
			}
		}
		if("maus".equals(string))
		{
			kontext.schreibeAnSpieler(spieler, "Mäuse:");
			for(Raum raum : kontext.getRaeume())
			{
				if(raum.hasMaus())
					kontext.schreibeAnSpieler(spieler, raum.getName());
			}
		}
		if("spieler".equals(string))
		{
			kontext.schreibeAnSpieler(spieler, "Spieler:");
			for(Spieler fremderSpieler : kontext.getSpielerListe())
			{
				kontext.schreibeAnSpieler(spieler, fremderSpieler.getName()
						+ ": " + kontext.getAktuellenRaumZu(spieler).getName());
			}
		}
		if("lebensenergie".equals(string))
		{
			kontext.schreibeAnSpieler(spieler, "Lebensenergie:");
			kontext.schreibeAnSpieler(spieler, "" + spieler.getLebensEnergie());
		}
		return false;
	}

Output:
	public boolean ausfuehren(ServerKontext kontext, Spieler spieler,
			Befehlszeile befehlszeile)
	{
		String string = befehlszeile.getGeparsteZeile().get(1);
		if("katze".equals(string))
		{
			kontext.schreibeAnSpieler(spieler, "Katzen:");
			for(Raum raum : kontext.getRaeume())
			{
				if(raum.hasKatze())
					kontext.schreibeAnSpieler(spieler, raum.getName());
			}
		}
		if("maus".equals(string))
		{
			kontext.schreibeAnSpieler(spieler, "Mäuse:");
			for(Raum raum : kontext.getRaeume())
			{
				if(raum.hasMaus())
					kontext.schreibeAnSpieler(spieler, raum.getName());
			}
		}
		if("spieler".equals(string))
		{
			kontext.schreibeAnSpieler(spieler, "Spieler:");
			for(Spieler fremderSpieler : kontext.getSpielerListe())
			{
				kontext.schreibeAnSpieler(spieler, fremderSpieler.getName()
						+ ": "
						+ kontext.getAktuellenRaumZu(fremderSpieler).getName());
			}
		}
		if("lebensenergie".equals(string))
		{
			kontext.schreibeAnSpieler(spieler, "Lebensenergie:");
			kontext.schreibeAnSpieler(spieler, "" + spieler.getLebensEnergie());
		}
		return false;
	}


Input:
    public World step(Input input) {
        Env env = getEnv();
        Player player = getPlayer();
        boolean touchingFloor = env.isTouchingFloor(player);
        int ax = 0;
        int ay = 0;
        if (touchingFloor) {
            if (input.isJumpPressed()) {
                ay -= Player.JUMP;
            }
            if (input.isLeftPressed()) {
                ax -= 1;
            }
            if (input.isRightPressed()) {
                ax += 1;
            }
        }
        int vx;
        int vy = player.getVy() + ay*Player.VELOCITY_SCALE;
        if (IS_PERSON) {
            if (touchingFloor) {
                vx = 5*ax*Player.VELOCITY_SCALE;
            } else {
                vx = player.getVx();
            }
        } else {
            vx = player.getVx() + ax*Player.VELOCITY_SCALE;
        }
        if (touchingFloor) {
            if (!IS_PERSON) {
                vx -= Integer.signum(vx)*FRICTION;
            }
        } else {
            vy += GRAVITY;
        }
        int dx = (int) Math.round((double) vx/Player.VELOCITY_SCALE);
        int x = player.getX() + dx;
        int y = player.getY() + (int) Math.round((double) vy/Player.VELOCITY_SCALE);
        int angle = player.getAngle() - 360*dx/player.getCircumference();
        double radius = player.getRealRadius();
        int toyIndex = env.getToyIndex(player);
        if (toyIndex >= 0) {
            Toy toy = env.getToy(toyIndex);
            radius += 2.0*toy.getRadius()*toy.getRadius()/(radius*radius);
            env = env.withoutToy(toyIndex);
        }
        Integer pushBack = env.getPushBack(player, x, y, vx, vy);
        if (pushBack != null) {
            int dy = pushBack.intValue();
            y -= dy;
            if ((vy > 0) == (dy > 0)) {
                vy = 0;
            }
        }
        if (y > Env.HEIGHT) {
            x = Env.WIDTH/2;
            y = Env.HEIGHT/3;
            vx = 0;
            vy = 0;
        }
        Player newPlayer = new Player(x, y, angle, vx, vy, radius);
        return new World(env, newPlayer);
    }

Output:
    public World step(Input input) {
        Env env = getEnv();
        Player player = getPlayer();
        boolean touchingFloor = env.isTouchingFloor(player);
        int ax = 0;
        int ay = 0;
        if (touchingFloor) {
            if (input.isJumpPressed()) {
                ay -= Player.JUMP;
            }
            if (input.isLeftPressed()) {
                ax -= 1;
            }
            if (input.isRightPressed()) {
                ax += 1;
            }
        }
        int vx;
        int vy = player.getVy() + ay*Player.VELOCITY_SCALE;
        if (IS_PERSON) {
            if (touchingFloor) {
                vx = 3*ax*Player.VELOCITY_SCALE;
            } else {
                vx = player.getVx();
            }
        } else {
            vx = player.getVx() + ax*Player.VELOCITY_SCALE;
        }
        if (touchingFloor) {
            if (!IS_PERSON) {
                vx -= Integer.signum(vx)*FRICTION;
            }
        } else {
            vy += GRAVITY;
        }
        int dx = (int) Math.round((double) vx/Player.VELOCITY_SCALE);
        int x = player.getX() + dx;
        int y = player.getY() + (int) Math.round((double) vy/Player.VELOCITY_SCALE);
        int angle = player.getAngle() - 360*dx/player.getCircumference();
        double radius = player.getRealRadius();
        int toyIndex = env.getToyIndex(player);
        if (toyIndex >= 0) {
            Toy toy = env.getToy(toyIndex);
            radius += 2.0*toy.getRadius()*toy.getRadius()/(radius*radius);
            env = env.withoutToy(toyIndex);
        }
        Integer pushBack = env.getPushBack(player, x, y, vx, vy);
        if (pushBack != null) {
            int dy = pushBack.intValue();
            y -= dy;
            if ((vy > 0) == (dy > 0)) {
                vy = 0;
            }
        }
        if (y > Env.HEIGHT) {
            x = Env.WIDTH/2;
            y = Env.HEIGHT/3;
            vx = 0;
            vy = 0;
        }
        Player newPlayer = new Player(x, y, angle, vx, vy, radius);
        return new World(env, newPlayer);
    }


Input:
  public Map<String, Component> readComponents(File directory)
  {
    if (!directory.isDirectory())
    {
      throw new IllegalArgumentException(
          directory.getAbsolutePath() + " is no Directory");
    }
    Map<String, Component> result = new HashMap<>();
    File[] files = directory.listFiles();
    for (File file : files)
    {
      String fileName = file.getName();
      if (fileName.endsWith(".xhtml"))
      {
        try
        {
          FileInputStream inputStream = new FileInputStream(file);
          Component component = parse(inputStream);
          if (component.getId() == null)
          {
            component.setId(fileName.substring(0, fileName.length() - 6));
          }
          result.put(component.getId(), component);
        }
        catch (FileNotFoundException e)
        {
          throw new RuntimeException(e);
        }
        catch (SAXException e)
        {
          throw new RuntimeException(e);
        }
        catch (IOException e)
        {
          throw new RuntimeException(e);
        }
        catch (ParserConfigurationException e)
        {
          throw new RuntimeException(e);
        }
      }
    }
    return result;
  }

Output:
  public Map<String, Component> readComponents(File sourceDirectory)
  {
    if (sourceDirectory == null)
    {
      throw new NullPointerException("sourceDirectory must not be null");
    }
    if (!sourceDirectory.isDirectory())
    {
      throw new IllegalArgumentException(
          sourceDirectory.getAbsolutePath() + " is no Directory");
    }
    Map<String, Component> result = new HashMap<>();
    File[] files = sourceDirectory.listFiles();
    for (File file : files)
    {
      String fileName = file.getName();
      if (fileName.endsWith(".xhtml"))
      {
        try
        {
          FileInputStream inputStream = new FileInputStream(file);
          Component component = parse(inputStream);
          if (component.getId() == null)
          {
            component.setId(fileName.substring(0, fileName.length() - 6));
          }
          result.put(component.getId(), component);
        }
        catch (FileNotFoundException e)
        {
          throw new RuntimeException(e);
        }
        catch (SAXException e)
        {
          throw new RuntimeException(e);
        }
        catch (IOException e)
        {
          throw new RuntimeException(e);
        }
        catch (ParserConfigurationException e)
        {
          throw new RuntimeException(e);
        }
      }
    }
    return result;
  }


Input:
	public BufferedImage draw(double[] data, int imageWidth, int imageHeight, int maxPlottedData, int minPlottedData) {
		BufferedImage bi = new BufferedImage(imageWidth, imageHeight, BufferedImage.TYPE_INT_RGB);
		Graphics2D g = (Graphics2D) bi.getGraphics();
		g.setColor(Color.white);
		g.drawRect(0, 0, imageWidth, imageHeight);
		g.setColor(Color.black);
		for (int i=1;i<data.length;i++) {
			int x1 = (int) Math.rint((i-1) * imageWidth / data.length);
			int x2 = (int) Math.rint(i * imageWidth / data.length);
			int y1 = (int) Math.rint((data[i-1] -minPlottedData) / maxPlottedData * imageHeight );
			int y2 = (int) Math.rint((data[i] -minPlottedData) / maxPlottedData * imageHeight );
			g.drawLine(x1, y1, x2, y2);
		}
		return bi;
	}

Output:
	public BufferedImage draw(double[] data, int imageWidth, int imageHeight, double maxPlottedData, double minPlottedData) {
		BufferedImage bi = new BufferedImage(imageWidth, imageHeight, BufferedImage.TYPE_INT_RGB);
		Graphics2D g = (Graphics2D) bi.getGraphics();
		g.setColor(Color.white);
		g.drawRect(0, 0, imageWidth, imageHeight);
		g.setColor(Color.black);
		for (int i=1;i<data.length;i++) {
			int x1 = (int) Math.rint((i-1) * imageWidth / data.length);
			int x2 = (int) Math.rint(i * imageWidth / data.length);
			int y1 = (int) Math.rint((data[i-1] -minPlottedData) / maxPlottedData * imageHeight );
			int y2 = (int) Math.rint((data[i] -minPlottedData) / maxPlottedData * imageHeight );
			g.drawLine(x1, y1, x2, y2);
		}
		return bi;
	}


Input:
	public void run() {
		eEvent				= Edk.INSTANCE.EE_EmoEngineEventCreate();
    	eState				= Edk.INSTANCE.EE_EmoStateCreate();
    	IntByReference userID 		= null;
		IntByReference nSamplesTaken= null;
    	int state  					= 0;
    	float secs 					= 60;
    	boolean readytocollect 		= false;
    	collecting = true;
    	writingMatrix = false;
    	userID 			= new IntByReference(0);
		nSamplesTaken	= new IntByReference(0);
		try {
			out = new BufferedWriter(new FileWriter("VisualizationData/" + fileName + ".txt"));
		} catch (IOException e) {
			System.err.println(e.getMessage());
			System.exit(-1);
		}
		if (Edk.INSTANCE.EE_EngineConnect("Emotiv Systems-5") != EdkErrorCode.EDK_OK.ToInt()) {
			System.err.println("Emotiv Engine start up failed.");
			return;
		}
		Pointer hData = Edk.INSTANCE.EE_DataCreate();
		Edk.INSTANCE.EE_DataSetBufferSizeInSec(secs);
    	System.out.println("Started receiving EEG Data!");
		while (collecting) {
			state = Edk.INSTANCE.EE_EngineGetNextEvent(eEvent);
			if (state == EdkErrorCode.EDK_OK.ToInt()) {
				int eventType = Edk.INSTANCE.EE_EmoEngineEventGetType(eEvent);
				Edk.INSTANCE.EE_EmoEngineEventGetUserId(eEvent, userID);
				if (eventType == Edk.EE_Event_t.EE_UserAdded.ToInt()) {
						if (userID != null) {
							System.out.println("User added");
							Edk.INSTANCE.EE_DataAcquisitionEnable(userID.getValue(),true);
							readytocollect = true;
						}
				}
				if (eventType == Edk.EE_Event_t.EE_EmoStateUpdated.ToInt()) {
					Edk.INSTANCE.EE_EmoEngineEventGetEmoState(eEvent, eState);
				}
			}
			else if (state != EdkErrorCode.EDK_NO_EVENT.ToInt()) {
				System.err.println("Internal error in Emotiv Engine!");
				break;
			}
			if (readytocollect) {
				Edk.INSTANCE.EE_DataUpdateHandle(0, hData);
				Edk.INSTANCE.EE_DataGetNumberOfSample(hData, nSamplesTaken);
				if (nSamplesTaken != null) {
					if (nSamplesTaken.getValue() != 0) {
						double[] data = new double[nSamplesTaken.getValue()];
						for (int sampleIdx=0 ; sampleIdx < nSamplesTaken.getValue(); ++sampleIdx) {
							try {
								Edk.INSTANCE.EE_DataGet(hData, 19, data, nSamplesTaken.getValue());
								out.write(Integer.toString((int) (data[sampleIdx] * 1000)) + " ");
								for (int i = 0 ; i < 25 ; i++) {
									Edk.INSTANCE.EE_DataGet(hData, i, data, nSamplesTaken.getValue());
									if ( writingMatrix && i >= 3 && i <= 16) {
										try {
											matrix.matrix[sample][i-3] = data[sampleIdx];
										} catch (ArrayIndexOutOfBoundsException e) {
											writingMatrix = false;
										}
									}
									out.write( Double.toString((data[sampleIdx])));
									out.write(" ");
								}
								if(writingMatrix)
									sample++;
								out.write("0");
								for (int i = 1; i < 15 ; i++)
									out.write(" " + EmoState.INSTANCE.ES_GetContactQuality(eState, i) + " ");
								out.newLine();
							} catch (IOException e) {
								System.err.println(e.getMessage());
								System.exit(-1);
							}
						}
					}
				}
			}
		}
		cleanUp();
	}

Output:
	public void run() {
		eEvent				= Edk.INSTANCE.EE_EmoEngineEventCreate();
    	eState				= Edk.INSTANCE.EE_EmoStateCreate();
    	IntByReference userID 		= null;
		IntByReference nSamplesTaken= null;
    	int state  					= 0;
    	float secs 					= 60;
    	boolean readytocollect 		= false;
    	collecting = true;
    	writingMatrix = false;
    	userID 			= new IntByReference(0);
		nSamplesTaken	= new IntByReference(0);
		try {
			out = new BufferedWriter(new FileWriter("VisualizationData/" + fileName + ".txt"));
		} catch (IOException e) {
			System.err.println(e.getMessage());
			System.exit(-1);
		}
		if (Edk.INSTANCE.EE_EngineConnect("Emotiv Systems-5") != EdkErrorCode.EDK_OK.ToInt()) {
			System.err.println("Emotiv Engine start up failed.");
			return;
		}
		Pointer hData = Edk.INSTANCE.EE_DataCreate();
		Edk.INSTANCE.EE_DataSetBufferSizeInSec(secs);
    	System.out.println("Started receiving EEG Data!");
		while (collecting) {
			state = Edk.INSTANCE.EE_EngineGetNextEvent(eEvent);
			if (state == EdkErrorCode.EDK_OK.ToInt()) {
				int eventType = Edk.INSTANCE.EE_EmoEngineEventGetType(eEvent);
				Edk.INSTANCE.EE_EmoEngineEventGetUserId(eEvent, userID);
				if (eventType == Edk.EE_Event_t.EE_UserAdded.ToInt()) {
						if (userID != null) {
							System.out.println("User added");
							Edk.INSTANCE.EE_DataAcquisitionEnable(userID.getValue(),true);
							readytocollect = true;
						}
				}
				if (eventType == Edk.EE_Event_t.EE_EmoStateUpdated.ToInt()) {
					Edk.INSTANCE.EE_EmoEngineEventGetEmoState(eEvent, eState);
				}
			}
			else if (state != EdkErrorCode.EDK_NO_EVENT.ToInt()) {
				System.err.println("Internal error in Emotiv Engine!");
				break;
			}
			if (readytocollect) {
				Edk.INSTANCE.EE_DataUpdateHandle(0, hData);
				Edk.INSTANCE.EE_DataGetNumberOfSample(hData, nSamplesTaken);
				if (nSamplesTaken != null) {
					if (nSamplesTaken.getValue() != 0) {
						double[] data = new double[nSamplesTaken.getValue()];
						for (int sampleIdx=0 ; sampleIdx < nSamplesTaken.getValue(); ++sampleIdx) {
							try {
								Edk.INSTANCE.EE_DataGet(hData, 19, data, nSamplesTaken.getValue());
								out.write(Integer.toString((int) (data[sampleIdx] * 1000)) + " ");
								for (int i = 0 ; i < 25 ; i++) {
									Edk.INSTANCE.EE_DataGet(hData, i, data, nSamplesTaken.getValue());
									if ( writingMatrix && i >= 3 && i <= 16) {
										try {
											matrix.matrix[sample][i-3] = data[sampleIdx];
										} catch (ArrayIndexOutOfBoundsException e) {
											writingMatrix = false;
										}
									}
									out.write( Double.toString((data[sampleIdx])));
									out.write(" ");
								}
								if(writingMatrix)
									sample++;
								out.write((writingMatrix)? "1" : "0");
								for (int i = 1; i < 15 ; i++)
									out.write(" " + EmoState.INSTANCE.ES_GetContactQuality(eState, i) + " ");
								out.newLine();
							} catch (IOException e) {
								System.err.println(e.getMessage());
								System.exit(-1);
							}
						}
					}
				}
			}
		}
		cleanUp();
	}