Input:
    public int read(byte[] b, int off, int len) throws IOException {
        int nSamples = len/frameSize;
        int totalRead = 0;
        int currentPos = off;
        do {
            int toRead = nSamples-totalRead;
            if (toRead > sampleBuf.length) toRead = sampleBuf.length;
            int nRead = source.getData(sampleBuf, 0, toRead);
            if (frameSize == 1) {
                for (int i=0; i<nRead; i++, currentPos++) {
                    int sample = (int) (sampleBuf[i] * 128.0);
                    b[currentPos] = (byte) ((sample>>8)&0xFF);
                }
            } else if (frameSize == 2){
                boolean bigEndian = format.isBigEndian();
                for (int i=0; i<nRead; i++, currentPos+=2) {
                    int sample = (int) (sampleBuf[i] * 32768.0);
                    if (sample > MAX_AMPLITUDE || sample < -MAX_AMPLITUDE) {
                        System.err.println("Warning: signal amplitude out of range: "+sample);
                    }
                    byte hibyte = (byte) (sample>>8);
                    byte lobyte = (byte) (sample&0xFF);
                    if (!bigEndian) {
                        b[currentPos] = lobyte;
                        b[currentPos+1] = hibyte;
                    } else {
                        b[currentPos] = hibyte;
                        b[currentPos+1] = lobyte;
                    }
                }
            } else {
                boolean bigEndian = format.isBigEndian();
                for (int i=0; i<nRead; i++, currentPos+=3) {
                    int sample = (int) (sampleBuf[i] * 8388606.0);
                    byte hibyte = (byte) (sample>>16);
                    byte midbyte = (byte) ((sample>>8) & 0xFF);
                    byte lobyte = (byte) (sample&0xFF);
                    if (!bigEndian) {
                        b[currentPos] = lobyte;
                        b[currentPos+1] = midbyte;
                        b[currentPos+2] = hibyte;
                    } else {
                        b[currentPos] = hibyte;
                        b[currentPos+1] = midbyte;
                        b[currentPos+2] = lobyte;
                    }
                }
            }
            totalRead += nRead;
            assert currentPos <= off+len;
        } while (source.hasMoreData() && totalRead < nSamples);
        if (totalRead == 0) return -1;
        else return totalRead*frameSize;
    }

Output:
    public int read(byte[] b, int off, int len) throws IOException {
        int nSamples = len/frameSize;
        int totalRead = 0;
        int currentPos = off;
        do {
            int toRead = nSamples-totalRead;
            if (toRead > sampleBuf.length) toRead = sampleBuf.length;
            int nRead = source.getData(sampleBuf, 0, toRead);
            if (frameSize == 1) {
                for (int i=0; i<nRead; i++, currentPos++) {
                    int sample = (int) Math.round(sampleBuf[i] * 127.0);
                    b[currentPos] = (byte) ((sample>>8)&0xFF);
                }
            } else if (frameSize == 2){
                boolean bigEndian = format.isBigEndian();
                for (int i=0; i<nRead; i++, currentPos+=2) {
                    int sample = (int) Math.round(sampleBuf[i] * 32767.0);
                    if (sample > MAX_AMPLITUDE || sample < -MAX_AMPLITUDE) {
                        System.err.println("Warning: signal amplitude out of range: "+sample);
                    }
                    byte hibyte = (byte) (sample>>8);
                    byte lobyte = (byte) (sample&0xFF);
                    if (!bigEndian) {
                        b[currentPos] = lobyte;
                        b[currentPos+1] = hibyte;
                    } else {
                        b[currentPos] = hibyte;
                        b[currentPos+1] = lobyte;
                    }
                }
            } else {
                boolean bigEndian = format.isBigEndian();
                for (int i=0; i<nRead; i++, currentPos+=3) {
                    int sample = (int) Math.round(sampleBuf[i] * 8388605.0);
                    byte hibyte = (byte) (sample>>16);
                    byte midbyte = (byte) ((sample>>8) & 0xFF);
                    byte lobyte = (byte) (sample&0xFF);
                    if (!bigEndian) {
                        b[currentPos] = lobyte;
                        b[currentPos+1] = midbyte;
                        b[currentPos+2] = hibyte;
                    } else {
                        b[currentPos] = hibyte;
                        b[currentPos+1] = midbyte;
                        b[currentPos+2] = lobyte;
                    }
                }
            }
            totalRead += nRead;
            assert currentPos <= off+len;
        } while (source.hasMoreData() && totalRead < nSamples);
        if (totalRead == 0) return -1;
        else return totalRead*frameSize;
    }


Input:
	public void StartClient(int SERVERpassedPort, String SERVERpassedTarget, int DROPOFFpassedPort,
			String DROPOFFpassedTarget) {
		ServerNetwork = new Networking(mylog, SERVERpassedPort, SERVERpassedTarget);
		Socket ServerSock = ServerNetwork.PassBackClient();
		ServerNetwork.BringUp(ServerSock);
		DropOffNetwork = new Networking(mylog, SERVERpassedPort, SERVERpassedTarget);
		Socket DropOffSock = DropOffNetwork.PassBackClient();
		DropOffNetwork.BringUp(DropOffSock);
		String UserInput = null;
		String ServerResponse = null;
		String OS = (String) clientSession.getAttribute("OS");
		String SecLev = (String) clientSession.getAttribute("SecurityLevel");
		String ClientID = (String) clientSession.getAttribute("ID");
		DisplayMenu();
		System.out.println("Connected to server [" + SERVERpassedTarget + "] on port [" + SERVERpassedPort + "]");
		crypt = new Crypto(mylog, subject.GetPSK());
		String rawTest = "Testing!!!12345";
		byte[] testdata = crypt.encrypt(rawTest);
		ServerNetwork.Send(testdata);
		byte[] fetched = ServerNetwork.ReceiveByte();
		String dec = crypt.decrypt(fetched);
		if (dec.equals(rawTest + "<S>")) {
			mylog.out("INFO", "Functional bi-directional encryption established. (Server)");
		} else {
			mylog.out("ERROR", "Failed to establish a functional encrypted channel! (Server)");
			mylog.out("ERROR", "Expected [" + rawTest + "<S>" + "] but recieved [" + dec + "] (Server)");
			ServerNetwork.BringDown();
			try {
				ServerSock.close();
			} catch (IOException e) {
				mylog.out("ERROR", "Failed to close client socket (Server)");
			}
			System.exit(0);
		}
		DropOffNetwork.Send(testdata);
		fetched = DropOffNetwork.ReceiveByte();
		dec = crypt.decrypt(fetched);
		if (dec.equals(rawTest + "<S>")) {
			mylog.out("INFO", "Functional bi-directional encryption established. (Drop Off)");
		} else {
			mylog.out("ERROR", "Failed to establish a functional encrypted channel! (Drop Off)");
			mylog.out("ERROR", "Expected [" + rawTest + "<S>" + "] but recieved [" + dec + "] (Drop Off)");
			DropOffNetwork.BringDown();
			try {
				ServerSock.close();
			} catch (IOException e) {
				mylog.out("ERROR", "Failed to close client socket (Drop Off)");
			}
			System.exit(0);
		}
		DHrekey(ServerNetwork);
		DHrekey(DropOffNetwork);
		UserInput = readUI();
		int MaxBeforeREKEY = 100;
		int Current = 0;
		boolean serverUp = true;
		boolean flagJob = false;
		boolean noSend = false;
		while ((UserInput != null) && (UserInput.compareToIgnoreCase("quit") != 0) && (ServerSock.isConnected())
				&& (DropOffSock.isConnected())) {
			if (!noSend) {
				ServerNetwork.Send(crypt.encrypt(UserInput));
				fetched = ServerNetwork.ReceiveByte();
				ServerResponse = crypt.decrypt(fetched);
				if (ServerResponse == null) {
					mylog.out("WARN", "Server disconected");
					serverUp = false;
					break;
				}
			} else {
				noSend = false;
			}
			if (flagJob) {
				if (ServerResponse.length() > 0) {
					System.out.println("JobIn:[" + ServerResponse + "]");
					if (OS.contains("Windows")) {
						ServerResponse = "cmd /C " + ServerResponse;
					}
					try {
						Runtime rt = Runtime.getRuntime();
						Process proc = rt.exec(ServerResponse);
						StreamGobbler errorGobbler = new StreamGobbler(proc.getErrorStream(), "ERROR");
						StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream(), "OUTPUT");
						errorGobbler.start();
						outputGobbler.start();
						int exitVal = 0;
						try {
							exitVal = proc.waitFor();
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
						System.out.println("ExitValue: " + exitVal);
					} catch (IOException e) {
						e.printStackTrace();
					}
					System.out.println("JobOut:[" + ServerResponse + "]");
				} else {
					System.out.println("Job:[No jobs available]");
				}
				flagJob = false;
			} else {
				System.out.println(ServerResponse);
			}
			UserInput = readUI().toLowerCase();
			if ((UserInput.contains("rekey")) && serverUp) {
				UserInput = "Rekey executed.";
				DHrekey(ServerNetwork);
				DHrekey(DropOffNetwork);
				Current = 0;
			} else if (UserInput.contains("job")) {
				flagJob = true;
				UserInput = UserInput + ":" + ClientID + ":" + OS + ":" + SecLev;
			} else if (UserInput.contains("help")) {
				noSend = true;
				DisplayMenu();
			}
			if (Current == MaxBeforeREKEY) {
				DHrekey(ServerNetwork);
				DHrekey(DropOffNetwork);
				Current = 0;
			} else {
				Current++;
			}
		}
		if ((UserInput.compareToIgnoreCase("quit") == 0) && serverUp) {
			ServerNetwork.Send(crypt.encrypt("quit"));
			DropOffNetwork.Send(crypt.encrypt("quit"));
		}
		ServerNetwork.BringDown();
		DropOffNetwork.BringDown();
		try {
			ServerSock.close();
			DropOffSock.close();
		} catch (IOException e) {
			mylog.out("ERROR", "Failed to close client socket");
		}
	}

Output:
	public void StartClient(int SERVERpassedPort, String SERVERpassedTarget, int DROPOFFpassedPort,
			String DROPOFFpassedTarget) {
		ServerNetwork = new Networking(mylog, SERVERpassedPort, SERVERpassedTarget);
		Socket ServerSock = ServerNetwork.PassBackClient();
		ServerNetwork.BringUp(ServerSock);
		System.out.println("Connected to Server [" + SERVERpassedTarget + "] on port [" + SERVERpassedPort + "]");
		DropOffNetwork = new Networking(mylog, DROPOFFpassedPort, DROPOFFpassedTarget);
		Socket DropOffSock = DropOffNetwork.PassBackClient();
		DropOffNetwork.BringUp(DropOffSock);
		System.out.println("Connected to Drop Off [" + DROPOFFpassedTarget + "] on port [" + DROPOFFpassedPort + "]");
		String UserInput = null;
		String ServerResponse = null;
		String OS = (String) clientSession.getAttribute("OS");
		String SecLev = (String) clientSession.getAttribute("SecurityLevel");
		String ClientID = (String) clientSession.getAttribute("ID");
		DisplayMenu();
		crypt = new Crypto(mylog, subject.GetPSK());
		String rawTest = "Testing!!!12345";
		byte[] testdata = crypt.encrypt(rawTest);
		ServerNetwork.Send(testdata);
		byte[] fetched = ServerNetwork.ReceiveByte();
		String dec = crypt.decrypt(fetched);
		if (dec.equals(rawTest + "<S>")) {
			mylog.out("INFO", "Functional bi-directional encryption established. (Server)");
		} else {
			mylog.out("ERROR", "Failed to establish a functional encrypted channel! (Server)");
			mylog.out("ERROR", "Expected [" + rawTest + "<S>" + "] but recieved [" + dec + "] (Server)");
			ServerNetwork.BringDown();
			try {
				ServerSock.close();
			} catch (IOException e) {
				mylog.out("ERROR", "Failed to close client socket (Server)");
			}
			System.exit(0);
		}
		DropOffNetwork.Send(testdata);
		fetched = DropOffNetwork.ReceiveByte();
		dec = crypt.decrypt(fetched);
		if (dec.equals(rawTest + "<S>")) {
			mylog.out("INFO", "Functional bi-directional encryption established. (Drop Off)");
		} else {
			mylog.out("ERROR", "Failed to establish a functional encrypted channel! (Drop Off)");
			mylog.out("ERROR", "Expected [" + rawTest + "<S>" + "] but recieved [" + dec + "] (Drop Off)");
			DropOffNetwork.BringDown();
			try {
				ServerSock.close();
			} catch (IOException e) {
				mylog.out("ERROR", "Failed to close client socket (Drop Off)");
			}
			System.exit(0);
		}
		DHrekey(ServerNetwork);
		DHrekey(DropOffNetwork);
		UserInput = readUI();
		int MaxBeforeREKEY = 100;
		int Current = 0;
		boolean serverUp = true;
		boolean flagJob = false;
		boolean noSend = false;
		while ((UserInput != null) && (UserInput.compareToIgnoreCase("quit") != 0) && (ServerSock.isConnected())
				&& (DropOffSock.isConnected())) {
			if (!noSend) {
				ServerNetwork.Send(crypt.encrypt(UserInput));
				fetched = ServerNetwork.ReceiveByte();
				ServerResponse = crypt.decrypt(fetched);
				if (ServerResponse == null) {
					mylog.out("WARN", "Server disconected");
					serverUp = false;
					break;
				}
			} else {
				noSend = false;
			}
			if (flagJob) {
				if (ServerResponse.length() > 0) {
					System.out.println("JobIn:[" + ServerResponse + "]");
					if (OS.contains("Windows")) {
						ServerResponse = "cmd /C " + ServerResponse;
					}
					try {
						Runtime rt = Runtime.getRuntime();
						Process proc = rt.exec(ServerResponse);
						StreamGobbler errorGobbler = new StreamGobbler(proc.getErrorStream(), "ERROR");
						StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream(), "OUTPUT");
						errorGobbler.start();
						outputGobbler.start();
						int exitVal = 0;
						try {
							exitVal = proc.waitFor();
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
						System.out.println("ExitValue: " + exitVal);
					} catch (IOException e) {
						e.printStackTrace();
					}
					System.out.println("JobOut:[" + ServerResponse + "]");
				} else {
					System.out.println("Job:[No jobs available]");
				}
				flagJob = false;
			} else {
				System.out.println(ServerResponse);
			}
			UserInput = readUI().toLowerCase();
			if ((UserInput.contains("rekey")) && serverUp) {
				UserInput = "Rekey executed.";
				DHrekey(ServerNetwork);
				DHrekey(DropOffNetwork);
				Current = 0;
			} else if (UserInput.contains("job")) {
				flagJob = true;
				UserInput = UserInput + ":" + ClientID + ":" + OS + ":" + SecLev;
			} else if (UserInput.contains("help")) {
				noSend = true;
				DisplayMenu();
			}
			if (Current == MaxBeforeREKEY) {
				DHrekey(ServerNetwork);
				DHrekey(DropOffNetwork);
				Current = 0;
			} else {
				Current++;
			}
		}
		if ((UserInput.compareToIgnoreCase("quit") == 0) && serverUp) {
			ServerNetwork.Send(crypt.encrypt("quit"));
			DropOffNetwork.Send(crypt.encrypt("quit"));
		}
		ServerNetwork.BringDown();
		DropOffNetwork.BringDown();
		try {
			ServerSock.close();
			DropOffSock.close();
		} catch (IOException e) {
			mylog.out("ERROR", "Failed to close client socket");
		}
	}


Input:
    public void readConfig(Configuration aStorageConfig, File aRepoConfigFile) throws RepositoryException {
        Boolean       createPrefix;
        Configuration repositoryConfig;
        Configuration credentialsConfig;
        Database      database;
        File          databaseHomeDir;
        Service       collectionService;
        String        driverName;
        String        databaseHome;
        String        rootCollection;
        String        pathPrefix;
        String        databaseAddress;
        String        databaseName;
        String        databaseURIPrefix;
        if (aStorageConfig == null || aRepoConfigFile == null)
            throw new RepositoryException("No storage/repository configuration available.");
        try {
            driverName        = aStorageConfig.getChild("driver").getValue("");
            mLog.error("Specified driver name = \"" + driverName + "\".");
            databaseHome      = aStorageConfig.getChild("db-home").getValue(null);
            mLog.error("Specified database home = \"" + databaseHome + "\".");
            rootCollection    = aStorageConfig.getChild("root").getValue("");
            mLog.error("Specified root collection = \"" + rootCollection + "\".");
            pathPrefix        = aStorageConfig.getChild("prefix").getValue("");
            createPrefix      = aStorageConfig.getChild("prefix").getAttributeAsBoolean("createIfNotExists", false);
            mLog.error("Specified collection prefix = \"" + pathPrefix + "\" (create if not exists: \"" + createPrefix + "\").");
            databaseAddress   = aStorageConfig.getChild("address").getValue("");
            mLog.error("Specified database address = \"" + databaseAddress + "\".");
            credentialsConfig = aStorageConfig.getChild("credentials", false);
            if (credentialsConfig != null) {
                mCredentials = new Credentials(credentialsConfig.getChild("username").getValue(""),
                                               credentialsConfig.getChild("password").getValue(""));
                mLog.error("Specified credentials read.");
            }
        } catch (Exception exception) {
            mLog.error(exception);
            throw new RepositoryException(exception.getMessage(), exception);
        }
        if (driverName.equals(""))
            throw new RepositoryException("Database driver not specified.");
        if (rootCollection.equals(""))
            throw new RepositoryException("Database root collection not specified.");
        try {
            database = (Database) Class.forName(driverName).newInstance();
            if (databaseHome != null) {
                databaseHomeDir = new File(databaseHome);
                if (!databaseHomeDir.isAbsolute()) {
                    databaseHomeDir = FileUtil.file(aRepoConfigFile.getParent(), databaseHomeDir.toString());
                }
                mLog.error("Resolved database home directory = \"" + databaseHomeDir + "\"");
                database.setProperty("db-home", databaseHomeDir.toString());
            }
            DatabaseManager.registerDatabase(database);
            databaseName = database.getName();
        } catch (Exception exception) {
            mLog.error(exception);
            throw new RepositoryException(exception.getMessage(), exception);
        }
        databaseURIPrefix = "xmldb:" + databaseName + "://" + databaseAddress  + "/" + rootCollection + "/";
        if (pathPrefix.equals("")) {
            mDatabaseURIPrefix = databaseURIPrefix;
        } else {
            mDatabaseURIPrefix = databaseURIPrefix + "/" + pathPrefix + "/";
        }
        mLog.error("Collection base path = \"" + databaseURIPrefix + "\".");
        mLog.error("Complete collection base path = \"" + mDatabaseURIPrefix + "\".");
        try {
            database.acceptsURI(mDatabaseURIPrefix);
        } catch (XMLDBException exception) {
            mLog.error(exception);
            if (exception.errorCode == org.xmldb.api.base.ErrorCodes.INVALID_URI) {
                throw new RepositoryException("The database does not accept the URI prefix \"" + mDatabaseURIPrefix + "\" as valid. Please make sure that the database host address (\"" + databaseAddress + "\") is correct. Original message: " + exception.getMessage(), exception);
            } else {
                throw new RepositoryException(exception.getMessage(), exception);
            }
        } catch (Exception exception) {
            mLog.error(exception);
            throw new RepositoryException(exception.getMessage(), exception);
        }
        try {
            if (getCollection(databaseURIPrefix) == null)
                throw new RepositoryException("Specified root collection (\"" + rootCollection + "\") does not exist.");
            if (getCollectionRelative(null) == null) {
                if (createPrefix) {
                    try {
                        collectionService = getCollection(databaseURIPrefix).getService("CollectionManagementService", "1.0");
                        ((CollectionManagementService) collectionService).createCollection(pathPrefix);
                        if (getCollectionRelative(null) == null)
                            throw new RepositoryException("Specified collection prefix (\"" + pathPrefix + "\") does not exist.");
                    } catch (Exception exception) {
                        mLog.error(exception);
                        throw new RepositoryException("Failed to create prefix collection (\"" + pathPrefix + "\"). Original message: " + exception.getMessage(), exception);
                    }
                    mLog.error("Created new collection \"" + pathPrefix + "\".");
                } else {
                    throw new RepositoryException("Specified collection prefix (\"" + pathPrefix + "\") does not exist.");
                }
            }
        } catch (Exception exception) {
            try {
                DatabaseManager.deregisterDatabase(database);
            } catch (Exception databaseException) {
                mLog.error(databaseException);
                throw new RepositoryException(databaseException.getMessage(), databaseException);
            }
            throw new RepositoryException(exception.getMessage(), exception);
        }
    }

Output:
    public void readConfig(Configuration aStorageConfig, File aRepoConfigFile) throws RepositoryException {
        boolean       createPrefix;
        Configuration repositoryConfig;
        Configuration credentialsConfig;
        Database      database;
        File          databaseHomeDir;
        Service       collectionService;
        String        driverName;
        String        databaseHome;
        String        rootCollection;
        String        pathPrefix;
        String        databaseAddress;
        String        databaseName;
        String        databaseURIPrefix;
        if (aStorageConfig == null || aRepoConfigFile == null)
            throw new RepositoryException("No storage/repository configuration available.");
        try {
            driverName        = aStorageConfig.getChild("driver").getValue("");
            mLog.error("Specified driver name = \"" + driverName + "\".");
            databaseHome      = aStorageConfig.getChild("db-home").getValue(null);
            mLog.error("Specified database home = \"" + databaseHome + "\".");
            rootCollection    = aStorageConfig.getChild("root").getValue("");
            mLog.error("Specified root collection = \"" + rootCollection + "\".");
            pathPrefix        = aStorageConfig.getChild("prefix").getValue("");
            createPrefix      = aStorageConfig.getChild("prefix").getAttributeAsBoolean("createIfNotExists", false);
            mLog.error("Specified collection prefix = \"" + pathPrefix + "\" (create if not exists: \"" + createPrefix + "\").");
            databaseAddress   = aStorageConfig.getChild("address").getValue("");
            mLog.error("Specified database address = \"" + databaseAddress + "\".");
            credentialsConfig = aStorageConfig.getChild("credentials", false);
            if (credentialsConfig != null) {
                mCredentials = new Credentials(credentialsConfig.getChild("username").getValue(""),
                                               credentialsConfig.getChild("password").getValue(""));
                mLog.error("Specified credentials read.");
            }
        } catch (Exception exception) {
            mLog.error(exception);
            throw new RepositoryException(exception.getMessage(), exception);
        }
        if (driverName.equals(""))
            throw new RepositoryException("Database driver not specified.");
        if (rootCollection.equals(""))
            throw new RepositoryException("Database root collection not specified.");
        try {
            database = (Database) Class.forName(driverName).newInstance();
            if (databaseHome != null) {
                databaseHomeDir = new File(databaseHome);
                if (!databaseHomeDir.isAbsolute()) {
                    databaseHomeDir = FileUtil.file(aRepoConfigFile.getParent(), databaseHomeDir.toString());
                }
                mLog.error("Resolved database home directory = \"" + databaseHomeDir + "\"");
                database.setProperty("db-home", databaseHomeDir.toString());
            }
            DatabaseManager.registerDatabase(database);
            databaseName = database.getName();
        } catch (Exception exception) {
            mLog.error(exception);
            throw new RepositoryException(exception.getMessage(), exception);
        }
        databaseURIPrefix = "xmldb:" + databaseName + "://" + databaseAddress  + "/" + rootCollection + "/";
        if (pathPrefix.equals("")) {
            mDatabaseURIPrefix = databaseURIPrefix;
        } else {
            mDatabaseURIPrefix = databaseURIPrefix + "/" + pathPrefix + "/";
        }
        mLog.error("Collection base path = \"" + databaseURIPrefix + "\".");
        mLog.error("Complete collection base path = \"" + mDatabaseURIPrefix + "\".");
        try {
            database.acceptsURI(mDatabaseURIPrefix);
        } catch (XMLDBException exception) {
            mLog.error(exception);
            if (exception.errorCode == org.xmldb.api.base.ErrorCodes.INVALID_URI) {
                throw new RepositoryException("The database does not accept the URI prefix \"" + mDatabaseURIPrefix + "\" as valid. Please make sure that the database host address (\"" + databaseAddress + "\") is correct. Original message: " + exception.getMessage(), exception);
            } else {
                throw new RepositoryException(exception.getMessage(), exception);
            }
        } catch (Exception exception) {
            mLog.error(exception);
            throw new RepositoryException(exception.getMessage(), exception);
        }
        try {
            if (getCollection(databaseURIPrefix) == null)
                throw new RepositoryException("Specified root collection (\"" + rootCollection + "\") does not exist.");
            if (getCollectionRelative(null) == null) {
                if (createPrefix) {
                    try {
                        collectionService = getCollection(databaseURIPrefix).getService("CollectionManagementService", "1.0");
                        ((CollectionManagementService) collectionService).createCollection(pathPrefix);
                        if (getCollectionRelative(null) == null)
                            throw new RepositoryException("Specified collection prefix (\"" + pathPrefix + "\") does not exist.");
                    } catch (Exception exception) {
                        mLog.error(exception);
                        throw new RepositoryException("Failed to create prefix collection (\"" + pathPrefix + "\"). Original message: " + exception.getMessage(), exception);
                    }
                    mLog.error("Created new collection \"" + pathPrefix + "\".");
                } else {
                    throw new RepositoryException("Specified collection prefix (\"" + pathPrefix + "\") does not exist.");
                }
            }
        } catch (Exception exception) {
            try {
                DatabaseManager.deregisterDatabase(database);
            } catch (Exception databaseException) {
                mLog.error(databaseException);
                throw new RepositoryException(databaseException.getMessage(), databaseException);
            }
            throw new RepositoryException(exception.getMessage(), exception);
        }
    }


Input:
    private void initComponents() {
        jSlider1 = new javax.swing.JSlider();
        jPanel1 = new javax.swing.JPanel();
        forwardB = new javax.swing.JButton();
        backwardB = new javax.swing.JButton();
        leftB = new javax.swing.JButton();
        rightB = new javax.swing.JButton();
        jLabel4 = new javax.swing.JLabel();
        locationTF = new javax.swing.JTextField();
        homeB = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        actionCB = new javax.swing.JComboBox();
        runActionB = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        expressionCB = new javax.swing.JComboBox();
        jLabel3 = new javax.swing.JLabel();
        renderQuality = new javax.swing.JComboBox();
        winkB = new javax.swing.JButton();
        eyeSelectionCB = new javax.swing.JComboBox();
        closeButton = new javax.swing.JButton();
        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Movement"));
        java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/jdesktop/wonderland/modules/avatarbase/client/resources/Bundle_en_US");
        forwardB.setText(bundle.getString("Forward"));
        forwardB.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                directionBMousePressed(evt);
            }
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                directionBMouseReleased(evt);
            }
        });
        backwardB.setText(bundle.getString("Backward"));
        backwardB.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                directionBMousePressed(evt);
            }
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                directionBMouseReleased(evt);
            }
        });
        leftB.setText(bundle.getString("Left"));
        leftB.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                directionBMousePressed(evt);
            }
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                directionBMouseReleased(evt);
            }
        });
        rightB.setText(bundle.getString("Right"));
        rightB.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                directionBMousePressed(evt);
            }
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                directionBMouseReleased(evt);
            }
        });
        org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel1Layout.createSequentialGroup()
                .add(44, 44, 44)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(69, 69, 69)
                        .add(forwardB)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 65, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                        .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup()
                            .add(leftB)
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 83, Short.MAX_VALUE)
                            .add(rightB))
                        .add(jPanel1Layout.createSequentialGroup()
                            .add(69, 69, 69)
                            .add(backwardB)
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 65, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
                .add(57, 57, 57))
        );
        jPanel1Layout.linkSize(new java.awt.Component[] {backwardB, forwardB}, org.jdesktop.layout.GroupLayout.HORIZONTAL);
        jPanel1Layout.linkSize(new java.awt.Component[] {leftB, rightB}, org.jdesktop.layout.GroupLayout.HORIZONTAL);
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel1Layout.createSequentialGroup()
                .add(forwardB)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(rightB)
                    .add(leftB))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(backwardB)
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jLabel4.setText(bundle.getString("Location:"));
        locationTF.setEditable(false);
        homeB.setText(bundle.getString("Go_home"));
        homeB.setToolTipText(bundle.getString("Go_to_0,0,0"));
        homeB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                homeBActionPerformed(evt);
            }
        });
        jLabel1.setText(bundle.getString("Action:"));
        actionCB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                actionCBActionPerformed(evt);
            }
        });
        runActionB.setText(bundle.getString("Run"));
        runActionB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                runActionBActionPerformed(evt);
            }
        });
        jLabel2.setText(bundle.getString("Expression:"));
        expressionCB.setEnabled(false);
        expressionCB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                expressionCBActionPerformed(evt);
            }
        });
        jLabel3.setText(bundle.getString("Render_Quality:"));
        renderQuality.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "High", "Medium", "Low" }));
        renderQuality.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                renderQualityActionPerformed(evt);
            }
        });
        winkB.setText(bundle.getString("Wink"));
        winkB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                winkBActionPerformed(evt);
            }
        });
        eyeSelectionCB.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Left Eye", "Right Eye" }));
        closeButton.setText(bundle.getString("Close"));
        closeButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                closeButtonActionPerformed(evt);
            }
        });
        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap(6, Short.MAX_VALUE))
            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel4)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel1)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel2)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel3))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(layout.createSequentialGroup()
                        .add(6, 6, 6)
                        .add(closeButton))
                    .add(layout.createSequentialGroup()
                        .add(renderQuality, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .add(124, 124, 124))
                    .add(layout.createSequentialGroup()
                        .add(eyeSelectionCB, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 144, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(winkB))
                    .add(layout.createSequentialGroup()
                        .add(expressionCB, 0, 144, Short.MAX_VALUE)
                        .add(81, 81, 81))
                    .add(layout.createSequentialGroup()
                        .add(actionCB, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 144, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(runActionB))
                    .add(layout.createSequentialGroup()
                        .add(homeB)
                        .add(125, 125, 125))
                    .add(locationTF, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 225, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.linkSize(new java.awt.Component[] {runActionB, winkB}, org.jdesktop.layout.GroupLayout.HORIZONTAL);
        layout.linkSize(new java.awt.Component[] {actionCB, expressionCB, eyeSelectionCB}, org.jdesktop.layout.GroupLayout.HORIZONTAL);
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(locationTF, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLabel4))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(homeB)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel1)
                    .add(actionCB, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(runActionB))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel2)
                    .add(expressionCB, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(eyeSelectionCB, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(winkB))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(renderQuality, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLabel3))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(closeButton)
                .addContainerGap())
        );
    }

Output:
    private void initComponents() {
        jSlider1 = new javax.swing.JSlider();
        jPanel1 = new javax.swing.JPanel();
        forwardB = new javax.swing.JButton();
        backwardB = new javax.swing.JButton();
        leftB = new javax.swing.JButton();
        rightB = new javax.swing.JButton();
        jLabel4 = new javax.swing.JLabel();
        locationTF = new javax.swing.JTextField();
        homeB = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        actionCB = new javax.swing.JComboBox();
        runActionB = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        expressionCB = new javax.swing.JComboBox();
        jLabel3 = new javax.swing.JLabel();
        renderQuality = new javax.swing.JComboBox();
        winkB = new javax.swing.JButton();
        eyeSelectionCB = new javax.swing.JComboBox();
        closeButton = new javax.swing.JButton();
        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Movement"));
        java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/jdesktop/wonderland/modules/avatarbase/client/resources/Bundle");
        forwardB.setText(bundle.getString("Forward"));
        forwardB.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                directionBMousePressed(evt);
            }
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                directionBMouseReleased(evt);
            }
        });
        backwardB.setText(bundle.getString("Backward"));
        backwardB.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                directionBMousePressed(evt);
            }
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                directionBMouseReleased(evt);
            }
        });
        leftB.setText(bundle.getString("Left"));
        leftB.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                directionBMousePressed(evt);
            }
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                directionBMouseReleased(evt);
            }
        });
        rightB.setText(bundle.getString("Right"));
        rightB.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                directionBMousePressed(evt);
            }
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                directionBMouseReleased(evt);
            }
        });
        org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel1Layout.createSequentialGroup()
                .add(44, 44, 44)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(69, 69, 69)
                        .add(forwardB)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 65, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                        .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup()
                            .add(leftB)
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 83, Short.MAX_VALUE)
                            .add(rightB))
                        .add(jPanel1Layout.createSequentialGroup()
                            .add(69, 69, 69)
                            .add(backwardB)
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 65, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
                .add(57, 57, 57))
        );
        jPanel1Layout.linkSize(new java.awt.Component[] {backwardB, forwardB}, org.jdesktop.layout.GroupLayout.HORIZONTAL);
        jPanel1Layout.linkSize(new java.awt.Component[] {leftB, rightB}, org.jdesktop.layout.GroupLayout.HORIZONTAL);
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel1Layout.createSequentialGroup()
                .add(forwardB)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(rightB)
                    .add(leftB))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(backwardB)
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jLabel4.setText(bundle.getString("Location:"));
        locationTF.setEditable(false);
        homeB.setText(bundle.getString("Go_home"));
        homeB.setToolTipText(bundle.getString("Go_to_0,0,0"));
        homeB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                homeBActionPerformed(evt);
            }
        });
        jLabel1.setText(bundle.getString("Action:"));
        actionCB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                actionCBActionPerformed(evt);
            }
        });
        runActionB.setText(bundle.getString("Run"));
        runActionB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                runActionBActionPerformed(evt);
            }
        });
        jLabel2.setText(bundle.getString("Expression:"));
        expressionCB.setEnabled(false);
        expressionCB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                expressionCBActionPerformed(evt);
            }
        });
        jLabel3.setText(bundle.getString("Render_Quality:"));
        renderQuality.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "High", "Medium", "Low" }));
        renderQuality.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                renderQualityActionPerformed(evt);
            }
        });
        winkB.setText(bundle.getString("Wink"));
        winkB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                winkBActionPerformed(evt);
            }
        });
        eyeSelectionCB.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Left Eye", "Right Eye" }));
        closeButton.setText(bundle.getString("Close"));
        closeButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                closeButtonActionPerformed(evt);
            }
        });
        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap(6, Short.MAX_VALUE))
            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel4)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel1)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel2)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel3))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(layout.createSequentialGroup()
                        .add(6, 6, 6)
                        .add(closeButton))
                    .add(layout.createSequentialGroup()
                        .add(renderQuality, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .add(124, 124, 124))
                    .add(layout.createSequentialGroup()
                        .add(eyeSelectionCB, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 144, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(winkB))
                    .add(layout.createSequentialGroup()
                        .add(expressionCB, 0, 144, Short.MAX_VALUE)
                        .add(81, 81, 81))
                    .add(layout.createSequentialGroup()
                        .add(actionCB, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 144, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(runActionB))
                    .add(layout.createSequentialGroup()
                        .add(homeB)
                        .add(125, 125, 125))
                    .add(locationTF, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 225, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.linkSize(new java.awt.Component[] {runActionB, winkB}, org.jdesktop.layout.GroupLayout.HORIZONTAL);
        layout.linkSize(new java.awt.Component[] {actionCB, expressionCB, eyeSelectionCB}, org.jdesktop.layout.GroupLayout.HORIZONTAL);
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(locationTF, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLabel4))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(homeB)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel1)
                    .add(actionCB, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(runActionB))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel2)
                    .add(expressionCB, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(eyeSelectionCB, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(winkB))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(renderQuality, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLabel3))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(closeButton)
                .addContainerGap())
        );
    }


Input:
    public boolean handle(CommandSender sender, String senderName, String command, String[] args, WorldGuardConfiguration cfg, WorldGuardWorldConfiguration wcfg) throws CommandHandlingException {
        CommandHandler.checkArgs(args, 3, 4, "/region flag <regionid> <name> (<subname>) <value>");
        try {
            String id = args[0].toLowerCase();
            String nameStr = args[1];
            String subnameStr = null;
            String valueStr = null;
            if (args.length < 4) {
                valueStr = args[2];
            } else {
                subnameStr = args[2];
                valueStr = args[3];
            }
            RegionManager mgr = cfg.getWorldGuardPlugin().getGlobalRegionManager().getRegionManager(wcfg.getWorldName());
            ProtectedRegion region = mgr.getRegion(id);
            if (region == null) {
                sender.sendMessage(ChatColor.RED + "Could not find a region by that ID.");
                return true;
            }
            if (sender instanceof Player) {
                Player player = (Player) sender;
                if (region.isOwner(BukkitPlayer.wrapPlayer(cfg, player))) {
                    cfg.checkRegionPermission(sender, "region.flag.ownregions");
                } else if (region.isMember(BukkitPlayer.wrapPlayer(cfg, player))) {
                    cfg.checkRegionPermission(sender, "region.flag.memberregions");
                } else {
                    cfg.checkRegionPermission(sender, "region.flag.foreignregions");
                }
            } else {
                cfg.checkRegionPermission(sender, "region.flag.foreignregions");
            }
            FlagInfo nfo = FlagInfo.getFlagInfo(nameStr, subnameStr);
            if (nfo == null) {
                sender.sendMessage(ChatColor.RED + "Unknown flag specified.");
                return true;
            } else if (nfo.subName != null && args.length < 4) {
                sender.sendMessage(ChatColor.RED + "Name a subflag to set this flag.");
                return true;
            }
            boolean validValue = false;
            switch (nfo.type) {
                case STRING: {
                    validValue = true;
                    break;
                }
                case INT: {
                    validValue = true;
                    try {
                        Integer val = Integer.valueOf(valueStr);
                    } catch (Exception e) {
                        validValue = false;
                    }
                    break;
                }
                case BOOLEAN: {
                    valueStr = valueStr.toLowerCase();
                    if (valueStr.equals("on")) {
                        valueStr = "true";
                    } else if (valueStr.equals("allow")) {
                        valueStr = "true";
                    } else if (valueStr.equals("1")) {
                        valueStr = "true";
                    }
                    validValue = true;
                    break;
                }
                case FLOAT: {
                    validValue = true;
                    try {
                        Float val = Float.valueOf(valueStr);
                    } catch (Exception e) {
                        validValue = false;
                    }
                    break;
                }
                case DOUBLE: {
                    validValue = true;
                    try {
                        Double val = Double.valueOf(valueStr);
                    } catch (Exception e) {
                        validValue = false;
                    }
                    break;
                }
                case STATE: {
                    validValue = true;
                    if (valueStr.equalsIgnoreCase("allow")) {
                        valueStr = AreaFlags.State.ALLOW.toString();
                    } else if (valueStr.equalsIgnoreCase("deny")) {
                        valueStr = AreaFlags.State.DENY.toString();
                    } else if (valueStr.equalsIgnoreCase("none")) {
                        valueStr = AreaFlags.State.NONE.toString();
                    } else {
                        validValue = false;
                    }
                    break;
                }
                case LOCATION: {
                    if (!(sender instanceof Player)) {
                        sender.sendMessage(ChatColor.RED + "Flag not supported in console mode.");
                        return true;
                    }
                    Player player = (Player) sender;
                    Location l = player.getLocation();
                    if (valueStr.equals("set")) {
                        if (region.contains(BukkitUtil.toVector(l))) {
                            region.getFlags().setLocationFlag(nfo.flagName, l);
                            validValue = true;
                            sender.sendMessage(ChatColor.YELLOW + "Region '" + id + "' updated. Flag " + nameStr + " set to current location");
                        } else {
                            player.sendMessage(ChatColor.RED + "You must set the " + nameStr + " location inside the region it belongs to.");
                            return true;
                        }
                    } else if (valueStr.equals("delete")) {
                        region.getFlags().setLocationFlag(nfo.flagName, null);
                        validValue = true;
                        sender.sendMessage(ChatColor.YELLOW + "Region '" + id + "' updated. Flag " + nameStr + " removed.");
                    }
                    if (validValue) {
                        mgr.save();
                        return true;
                    }
                    break;
                }
                default: {
                    validValue = false;
                    break;
                }
            }
            String fullFlagname = nameStr;
            if (subnameStr != null) {
                fullFlagname += " " + subnameStr;
            }
            if (!validValue) {
                sender.sendMessage(ChatColor.RED + "Invalid value '" + valueStr + "' for flag " + fullFlagname);
                return true;
            }
            if (nfo.subName != null && nfo.subName.equals("*")) {
                region.getFlags().setFlag(nfo.flagName, subnameStr, valueStr);
            } else {
                region.getFlags().setFlag(nfo.flagName, nfo.flagSubName, valueStr);
            }
            mgr.save();
            sender.sendMessage(ChatColor.YELLOW + "Region '" + id + "' updated. Flag " + fullFlagname + " set to " + valueStr);
        } catch (IOException e) {
            sender.sendMessage(ChatColor.RED + "Region database failed to save: "
                    + e.getMessage());
        }
        return true;
    }

Output:
    public boolean handle(CommandSender sender, String senderName, String command, String[] args, WorldGuardConfiguration cfg, WorldGuardWorldConfiguration wcfg) throws CommandHandlingException {
        CommandHandler.checkArgs(args, 3, 4, "/region flag <regionid> <name> (<subname>) <value>");
        try {
            String id = args[0].toLowerCase();
            String nameStr = args[1];
            String subnameStr = null;
            String valueStr = null;
            if (args.length < 4) {
                valueStr = args[2];
            } else {
                subnameStr = args[2];
                valueStr = args[3];
            }
            RegionManager mgr = cfg.getWorldGuardPlugin().getGlobalRegionManager().getRegionManager(wcfg.getWorldName());
            ProtectedRegion region = mgr.getRegion(id);
            if (region == null) {
                sender.sendMessage(ChatColor.RED + "Could not find a region by that ID.");
                return true;
            }
            if (sender instanceof Player) {
                Player player = (Player) sender;
                if (region.isOwner(BukkitPlayer.wrapPlayer(cfg, player))) {
                    cfg.checkRegionPermission(sender, "region.flag.ownregions");
                } else if (region.isMember(BukkitPlayer.wrapPlayer(cfg, player))) {
                    cfg.checkRegionPermission(sender, "region.flag.memberregions");
                } else {
                    cfg.checkRegionPermission(sender, "region.flag.foreignregions");
                }
            } else {
                cfg.checkRegionPermission(sender, "region.flag.foreignregions");
            }
            FlagInfo nfo = FlagInfo.getFlagInfo(nameStr, subnameStr);
            if (nfo == null) {
                sender.sendMessage(ChatColor.RED + "Unknown flag specified.");
                return true;
            } else if (nfo.subName != null && args.length < 4) {
                sender.sendMessage(ChatColor.RED + "Name a subflag and a value to set this flag.");
                return true;
            }
            boolean validValue = false;
            switch (nfo.type) {
                case STRING: {
                    validValue = true;
                    break;
                }
                case INT: {
                    validValue = true;
                    try {
                        Integer val = Integer.valueOf(valueStr);
                    } catch (Exception e) {
                        validValue = false;
                    }
                    break;
                }
                case BOOLEAN: {
                    valueStr = valueStr.toLowerCase();
                    if (valueStr.equals("on")) {
                        valueStr = "true";
                    } else if (valueStr.equals("allow")) {
                        valueStr = "true";
                    } else if (valueStr.equals("1")) {
                        valueStr = "true";
                    }
                    validValue = true;
                    break;
                }
                case FLOAT: {
                    validValue = true;
                    try {
                        Float val = Float.valueOf(valueStr);
                    } catch (Exception e) {
                        validValue = false;
                    }
                    break;
                }
                case DOUBLE: {
                    validValue = true;
                    try {
                        Double val = Double.valueOf(valueStr);
                    } catch (Exception e) {
                        validValue = false;
                    }
                    break;
                }
                case STATE: {
                    validValue = true;
                    if (valueStr.equalsIgnoreCase("allow")) {
                        valueStr = AreaFlags.State.ALLOW.toString();
                    } else if (valueStr.equalsIgnoreCase("deny")) {
                        valueStr = AreaFlags.State.DENY.toString();
                    } else if (valueStr.equalsIgnoreCase("none")) {
                        valueStr = AreaFlags.State.NONE.toString();
                    } else {
                        validValue = false;
                    }
                    break;
                }
                case LOCATION: {
                    if (!(sender instanceof Player)) {
                        sender.sendMessage(ChatColor.RED + "Flag not supported in console mode.");
                        return true;
                    }
                    Player player = (Player) sender;
                    Location l = player.getLocation();
                    if (valueStr.equals("set")) {
                        if (region.contains(BukkitUtil.toVector(l))) {
                            region.getFlags().setLocationFlag(nfo.flagName, l);
                            validValue = true;
                            sender.sendMessage(ChatColor.YELLOW + "Region '" + id + "' updated. Flag " + nameStr + " set to current location");
                        } else {
                            player.sendMessage(ChatColor.RED + "You must set the " + nameStr + " location inside the region it belongs to.");
                            return true;
                        }
                    } else if (valueStr.equals("delete")) {
                        region.getFlags().setLocationFlag(nfo.flagName, null);
                        validValue = true;
                        sender.sendMessage(ChatColor.YELLOW + "Region '" + id + "' updated. Flag " + nameStr + " removed.");
                    }
                    if (validValue) {
                        mgr.save();
                        return true;
                    }
                    break;
                }
                default: {
                    validValue = false;
                    break;
                }
            }
            String fullFlagname = nameStr;
            if (subnameStr != null) {
                fullFlagname += " " + subnameStr;
            }
            if (!validValue) {
                sender.sendMessage(ChatColor.RED + "Invalid value '" + valueStr + "' for flag " + fullFlagname);
                return true;
            }
            if (nfo.subName != null && nfo.subName.equals("*")) {
                region.getFlags().setFlag(nfo.flagName, subnameStr, valueStr);
            } else {
                region.getFlags().setFlag(nfo.flagName, nfo.flagSubName, valueStr);
            }
            mgr.save();
            sender.sendMessage(ChatColor.YELLOW + "Region '" + id + "' updated. Flag " + fullFlagname + " set to " + valueStr);
        } catch (IOException e) {
            sender.sendMessage(ChatColor.RED + "Region database failed to save: "
                    + e.getMessage());
        }
        return true;
    }


Input:
	public Domain generateDomain(DatabaseMeta databaseMeta, List<LogicalRelationship> joinTemplates) {
		Domain domain = null;
		try {
			String locale = LocalizedString.DEFAULT_LOCALE;
			this.generator.setLocale(locale);
			this.generator.setDatabaseMeta(databaseMeta);
			this.generator.setModelName(datasourceName);
			List<SchemaTable> schemas = new ArrayList<SchemaTable>();
			for (LogicalRelationship joinTemplate : joinTemplates) {
				schemas.add(new SchemaTable("", joinTemplate.getFromTable().getName(locale)));
				schemas.add(new SchemaTable("", joinTemplate.getToTable().getName(locale)));
			}
			SchemaTable tableNames[] = new SchemaTable[schemas.size()];
			tableNames = schemas.toArray(tableNames);
			this.generator.setTableNames(tableNames);
			domain = this.generator.generateDomain();
			domain.setId(datasourceName);
			ModelerWorkspaceHelper helper = new ModelerWorkspaceHelper(locale);
			ModelerWorkspace workspace = new ModelerWorkspace(helper);
			workspace.setModelName(datasourceName);
			workspace.setDomain(domain);
			LogicalModel logicalModel = domain.getLogicalModels().get(0);
			logicalModel.setName(new LocalizedString(locale, datasourceName));
			logicalModel.setDescription(new LocalizedString(locale, "This is the data model for "
		        + datasourceName));
		    LogicalTable businessTable = logicalModel.getLogicalTables().get(0);
		    businessTable.setName(new LocalizedString(locale, datasourceName));
			for (LogicalRelationship joinTemplate : joinTemplates) {
				String lTable = joinTemplate.getFromTable().getName(locale);
				String rTable = joinTemplate.getToTable().getName(locale);
				LogicalTable fromTable = null;
				LogicalColumn fromColumn = null;
				LogicalTable toTable = null;
				LogicalColumn toColumn = null;
				for (LogicalTable logicalTable : logicalModel.getLogicalTables()) {
					if (logicalTable.getName(locale).equals(lTable)) {
						fromTable = logicalTable;
						for (LogicalColumn logicalColumn : fromTable.getLogicalColumns()) {
							if (logicalColumn.getName(locale).equals(joinTemplate.getFromColumn().getName(locale))) {
								fromColumn = logicalColumn;
							}
						}
					}
					if (logicalTable.getName(locale).equals(rTable)) {
						toTable = logicalTable;
						for (LogicalColumn logicalColumn : toTable.getLogicalColumns()) {
							if (logicalColumn.getName(locale).equals(joinTemplate.getToColumn().getName(locale))) {
								toColumn = logicalColumn;
							}
						}
					}
				}
				LogicalRelationship logicalRelationship = new LogicalRelationship();
				logicalRelationship.setRelationshipType(RelationshipType._1_1);
				logicalRelationship.setFromTable(fromTable);
				logicalRelationship.setFromColumn(fromColumn);
				logicalRelationship.setToTable(toTable);
				logicalRelationship.setToColumn(toColumn);
				logicalModel.addLogicalRelationship(logicalRelationship);
			}
			helper.autoModelMultiTableRelational(workspace);
			helper.populateDomain(workspace);
		} catch (PentahoMetadataException e) {
			e.printStackTrace();
			logger.info(e.getLocalizedMessage());
		} catch (ModelerException e) {
			e.printStackTrace();
			logger.info(e.getLocalizedMessage());
		} catch (Exception e) {
			e.printStackTrace();
			logger.info(e.getLocalizedMessage());
		}
		return domain;
	}

Output:
	public Domain generateDomain(DatabaseMeta databaseMeta, List<LogicalRelationship> joinTemplates) {
		Domain domain = null;
		try {
			String locale = LocalizedString.DEFAULT_LOCALE;
			this.generator.setLocale(locale);
			this.generator.setDatabaseMeta(databaseMeta);
			this.generator.setModelName(datasourceName);
			List<SchemaTable> schemas = new ArrayList<SchemaTable>();
			for (LogicalRelationship joinTemplate : joinTemplates) {
				schemas.add(new SchemaTable("", joinTemplate.getFromTable().getName(locale)));
				schemas.add(new SchemaTable("", joinTemplate.getToTable().getName(locale)));
			}
			SchemaTable tableNames[] = new SchemaTable[schemas.size()];
			tableNames = schemas.toArray(tableNames);
			this.generator.setTableNames(tableNames);
			domain = this.generator.generateDomain();
			domain.setId(datasourceName);
			ModelerWorkspaceHelper helper = new ModelerWorkspaceHelper(locale);
			ModelerWorkspace workspace = new ModelerWorkspace(helper);
			workspace.setModelName(datasourceName);
			workspace.setDomain(domain);
			LogicalModel logicalModel = domain.getLogicalModels().get(0);
			logicalModel.setName(new LocalizedString(locale, datasourceName));
			logicalModel.setDescription(new LocalizedString(locale, "This is the data model for "
		        + datasourceName));
		    LogicalTable businessTable = logicalModel.getLogicalTables().get(0);
		    businessTable.setName(new LocalizedString(locale, datasourceName));
			for (LogicalRelationship joinTemplate : joinTemplates) {
				String lTable = joinTemplate.getFromTable().getName(locale);
				String rTable = joinTemplate.getToTable().getName(locale);
				LogicalTable fromTable = null;
				LogicalColumn fromColumn = null;
				LogicalTable toTable = null;
				LogicalColumn toColumn = null;
				for (LogicalTable logicalTable : logicalModel.getLogicalTables()) {
					if (logicalTable.getName(locale).equals(lTable)) {
						fromTable = logicalTable;
						for (LogicalColumn logicalColumn : fromTable.getLogicalColumns()) {
							if (logicalColumn.getName(locale).equals(joinTemplate.getFromColumn().getName(locale))) {
								fromColumn = logicalColumn;
							}
						}
					}
					if (logicalTable.getName(locale).equals(rTable)) {
						toTable = logicalTable;
						for (LogicalColumn logicalColumn : toTable.getLogicalColumns()) {
							if (logicalColumn.getName(locale).equals(joinTemplate.getToColumn().getName(locale))) {
								toColumn = logicalColumn;
							}
						}
					}
				}
				LogicalRelationship logicalRelationship = new LogicalRelationship();
				logicalRelationship.setRelationshipType(RelationshipType._1_1);
				logicalRelationship.setFromTable(fromTable);
				logicalRelationship.setFromColumn(fromColumn);
				logicalRelationship.setToTable(toTable);
				logicalRelationship.setToColumn(toColumn);
				logicalModel.addLogicalRelationship(logicalRelationship);
			}
			helper.autoModelMultiTableRelational(workspace);
			workspace.setModelName(datasourceName);
			helper.populateDomain(workspace);
		} catch (PentahoMetadataException e) {
			e.printStackTrace();
			logger.info(e.getLocalizedMessage());
		} catch (ModelerException e) {
			e.printStackTrace();
			logger.info(e.getLocalizedMessage());
		} catch (Exception e) {
			e.printStackTrace();
			logger.info(e.getLocalizedMessage());
		}
		return domain;
	}


Input:
    public boolean evaluate(BillingState<T> state, DateTime now) {
	    DateTime unpaidInvoiceTriggerDate = null;
	    if( timeSinceEarliestUnpaidInvoiceEqualsOrExceeds != null && state.getDateOfEarliestUnpaidInvoice() != null) {
	        unpaidInvoiceTriggerDate = state.getDateOfEarliestUnpaidInvoice().plus(timeSinceEarliestUnpaidInvoiceEqualsOrExceeds.toJodaPeriod());
	    }
		return
				(numberOfUnpaidInvoicesEqualsOrExceeds == null || state.getNumberOfUnpaidInvoices() >= numberOfUnpaidInvoicesEqualsOrExceeds.intValue() ) &&
				(totalUnpaidInvoiceBalanceEqualsOrExceeds == null || totalUnpaidInvoiceBalanceEqualsOrExceeds.compareTo(state.getBalanceOfUnpaidInvoices()) <= 0) &&
				(unpaidInvoiceTriggerDate == null ||
				 (state.getDateOfEarliestUnpaidInvoice() != null && !unpaidInvoiceTriggerDate.isAfter(now))) &&
				(responseForLastFailedPayment == null || responseIsIn(state.getResponseForLastFailedPayment(), responseForLastFailedPayment)) &&
				(controlTag == null || isTagIn(controlTag, state.getTags()));
	}

Output:
    public boolean evaluate(BillingState<T> state, DateTime now) {
	    DateTime unpaidInvoiceTriggerDate = null;
	    if( timeSinceEarliestUnpaidInvoiceEqualsOrExceeds != null && state.getDateOfEarliestUnpaidInvoice() != null) {
	        unpaidInvoiceTriggerDate = state.getDateOfEarliestUnpaidInvoice().plus(timeSinceEarliestUnpaidInvoiceEqualsOrExceeds.toJodaPeriod());
	    }
		return
				(numberOfUnpaidInvoicesEqualsOrExceeds == null || state.getNumberOfUnpaidInvoices() >= numberOfUnpaidInvoicesEqualsOrExceeds.intValue() ) &&
				(totalUnpaidInvoiceBalanceEqualsOrExceeds == null || totalUnpaidInvoiceBalanceEqualsOrExceeds.compareTo(state.getBalanceOfUnpaidInvoices()) <= 0) &&
				(timeSinceEarliestUnpaidInvoiceEqualsOrExceeds == null ||
				    (unpaidInvoiceTriggerDate != null && !unpaidInvoiceTriggerDate.isAfter(now))) &&
				(responseForLastFailedPayment == null || responseIsIn(state.getResponseForLastFailedPayment(), responseForLastFailedPayment)) &&
				(controlTag == null || isTagIn(controlTag, state.getTags()));
	}


Input:
    private List<DAGNode<TaskGraph.Node, TaskGraph.Edge>>
    makeMergedAlgoNodes(ExperimentSuite experiments, MeasurementSuite measurements, TTDataSet dataset, ExperimentOutputs outputs,
                        DAGNode<TaskGraph.Node, TaskGraph.Edge> commonDep) throws RecommenderConfigurationException {
        List<DAGNode<TaskGraph.Node, TaskGraph.Edge>> nodes = Lists.newArrayList();
        MergePool<CachedSatisfaction,DesireChain> mergePool = MergePool.create();
        List<DAGNode<CachedSatisfaction,DesireChain>> graphs = Lists.newArrayList();
        Set<DAGNode<CachedSatisfaction,DesireChain>> allNodes = Sets.newHashSet();
        ComponentCache cache = new ComponentCache(cacheDir);
        for (AlgorithmInstance algo: experiments.getAlgorithms()) {
            logger.debug("building graph for algorithm {}", algo);
            DAGNode<CachedSatisfaction, DesireChain> graph =
                    algo.buildRecommenderGraph(dataset.getTrainingData().getConfiguration());
            graph = mergePool.merge(graph);
            logger.debug("algorithm {} has {} new configuration nodes", algo,
                         Sets.difference(allNodes, graph.getReachableNodes()).size());
            allNodes.addAll(graph.getReachableNodes());
            LenskitEvalJob job = new LenskitEvalJob(algo, dataset, measurements,
                                                    outputs.getPrefixed(algo, dataset),
                                                    graph, cache);
            DAGNodeBuilder<TaskGraph.Node, TaskGraph.Edge> nb = DAGNode.newBuilder();
            nb.setLabel(TaskGraph.jobNode(job));
            if (commonDep != null) {
                nb.addEdge(commonDep, TaskGraph.edge());
            }
            assert nodes.size() == graphs.size();
            Set<DAGNode<CachedSatisfaction,DesireChain>> seen = Sets.newHashSet();
            logger.debug("finding dependencies of {}", job);
            for (int i = 0; i < nodes.size(); i++) {
                DAGNode<CachedSatisfaction, DesireChain> other = graphs.get(i);
                Set<DAGNode<CachedSatisfaction,DesireChain>> freshCommon = Sets.newHashSet();
                freshCommon.addAll(other.getReachableNodes());
                freshCommon.addAll(graph.getReachableNodes());
                freshCommon.removeAll(seen);
                if (!freshCommon.isEmpty()) {
                    logger.debug("{} depends on {} for {} nodes",
                                 job, nodes.get(i).getLabel(),
                                 freshCommon.size());
                    for (DAGNode<CachedSatisfaction,DesireChain> shared: freshCommon) {
                        logger.debug("it will reuse {}",
                                     shared.getLabel().getSatisfaction());
                    }
                    nb.addEdge(nodes.get(i), TaskGraph.edge());
                }
                seen.addAll(freshCommon);
            }
            graphs.add(graph);
            DAGNode<TaskGraph.Node, TaskGraph.Edge> jobNode = nb.build();
            logger.debug("{} has {} dependencies", job, jobNode.getAdjacentNodes().size());
            nodes.add(jobNode);
        }
        return nodes;
    }

Output:
    private List<DAGNode<TaskGraph.Node, TaskGraph.Edge>>
    makeMergedAlgoNodes(ExperimentSuite experiments, MeasurementSuite measurements, TTDataSet dataset, ExperimentOutputs outputs,
                        DAGNode<TaskGraph.Node, TaskGraph.Edge> commonDep) throws RecommenderConfigurationException {
        List<DAGNode<TaskGraph.Node, TaskGraph.Edge>> nodes = Lists.newArrayList();
        MergePool<CachedSatisfaction,DesireChain> mergePool = MergePool.create();
        List<DAGNode<CachedSatisfaction,DesireChain>> graphs = Lists.newArrayList();
        Set<DAGNode<CachedSatisfaction,DesireChain>> allNodes = Sets.newHashSet();
        ComponentCache cache = new ComponentCache(cacheDir);
        for (AlgorithmInstance algo: experiments.getAlgorithms()) {
            logger.debug("building graph for algorithm {}", algo);
            DAGNode<CachedSatisfaction, DesireChain> graph =
                    algo.buildRecommenderGraph(dataset.getTrainingData().getConfiguration());
            graph = mergePool.merge(graph);
            logger.debug("algorithm {} has {} new configuration nodes", algo,
                         Sets.difference(graph.getReachableNodes(), allNodes).size());
            allNodes.addAll(graph.getReachableNodes());
            LenskitEvalJob job = new LenskitEvalJob(algo, dataset, measurements,
                                                    outputs.getPrefixed(algo, dataset),
                                                    graph, cache);
            DAGNodeBuilder<TaskGraph.Node, TaskGraph.Edge> nb = DAGNode.newBuilder();
            nb.setLabel(TaskGraph.jobNode(job));
            if (commonDep != null) {
                nb.addEdge(commonDep, TaskGraph.edge());
            }
            assert nodes.size() == graphs.size();
            Set<DAGNode<CachedSatisfaction,DesireChain>> seen = Sets.newHashSet();
            logger.debug("finding dependencies of {}", job);
            for (int i = 0; i < nodes.size(); i++) {
                DAGNode<CachedSatisfaction, DesireChain> other = graphs.get(i);
                Set<DAGNode<CachedSatisfaction,DesireChain>> freshCommon = Sets.newHashSet();
                freshCommon.addAll(graph.getReachableNodes());
                freshCommon.retainAll(other.getReachableNodes());
                freshCommon.removeAll(seen);
                if (!freshCommon.isEmpty()) {
                    logger.debug("{} depends on {} for {} nodes",
                                 job, nodes.get(i).getLabel(),
                                 freshCommon.size());
                    for (DAGNode<CachedSatisfaction,DesireChain> shared: freshCommon) {
                        logger.debug("it will reuse {}",
                                     shared.getLabel().getSatisfaction());
                    }
                    nb.addEdge(nodes.get(i), TaskGraph.edge());
                }
                seen.addAll(freshCommon);
            }
            graphs.add(graph);
            DAGNode<TaskGraph.Node, TaskGraph.Edge> jobNode = nb.build();
            logger.debug("{} has {} dependencies", job, jobNode.getAdjacentNodes().size());
            nodes.add(jobNode);
        }
        return nodes;
    }