// Path: src/test/Input.java
// public class Input {
// 	private static HashMap<String, String[]> filesMap = new HashMap<>();
// 	private static HashMap<String[], String> reverseFileMap = new HashMap<>();
// 
// 	/**
// 	 * This class is not meant to be instantiated.
// 	 */
// 	private Input() {
// 	}
// 
// 	/**
// 	 * Returns a path to a file containing the lines given in {@code lines}. Creates the file if it was not created
// 	 * before.
// 	 * 
// 	 * @param lines
// 	 *            The lines to print in the file.
// 	 * @return path to a file containing {@code lines}
// 	 */
// 	public static String getFile(String... lines) {
// 		String fileName;
// 		if (!Input.reverseFileMap.containsKey(lines)) {
// 			fileName = UUID.randomUUID().toString() + ".txt";
// 			File file = new File(fileName);
// 			BufferedWriter outputWriter = null;
// 			try {
// 				outputWriter = new BufferedWriter(new FileWriter(file));
// 				for (String line : lines) {
// 					outputWriter.write(line);
// 					outputWriter.newLine();
// 				}
// 				outputWriter.flush();
// 				outputWriter.close();
// 				file.deleteOnExit();
// 			} catch (IOException e) {
// 				fail("The test was unable to create a test file. That's a shame!");
// 			}
// 
// 			Input.filesMap.put(fileName, lines);
// 			Input.reverseFileMap.put(lines, fileName);
// 		} else {
// 			fileName = Input.reverseFileMap.get(lines);
// 		}
// 		return fileName;
// 	}
// 
// 	/**
// 	 * Returns a path to a file containing the lines given in {@code lines}. Creates the file if it was not created
// 	 * before.
// 	 * 
// 	 * @param lines
// 	 *            The lines to print in the file.
// 	 * @return path to a file containing {@code lines}
// 	 */
// 	public static String getFile(Collection<String> lines) {
// 		String[] linesArray = new String[lines.size()];
// 		Iterator<String> iterator = lines.iterator();
// 		for (int i = 0; iterator.hasNext(); i++) {
// 			linesArray[i] = iterator.next();
// 		}
// 		return getFile(linesArray);
// 	}
// 
// 	/**
// 	 * A message giving information about the input file used in a test.
// 	 * 
// 	 * @param filePath
// 	 *            The command line arguments the main method was called with during the test. The file message will read
// 	 *            the file name in the second argument and output the contents of the file its pointing to.
// 	 * @return A text representing the input file
// 	 */
// 	public static String fileMessage(String filePath) {
// 		String result = "";
// 		if (filesMap.containsKey(filePath)) {
// 			result = "\n with the following input file:\n\n" + arrayToLines(filesMap.get(filePath)) + "\n\n";
// 		}
// 		return result;
// 	}
// 
// 	/**
// 	 * @return The paths to all generated input files.
// 	 */
// 	public static List<String> getAllFilePaths() {
// 		return new LinkedList<String>(filesMap.keySet());
// 	}
// 
// 	/**
// 	 * @param filePath
// 	 *            The path of a generated input file.
// 	 * @return The lines of the input file that was given the path {@code filePath}, {@code null} if there is no such
// 	 *         file.
// 	 */
// 	public static String[] getFileContentOf(String filePath) {
// 		return filesMap.get(filePath);
// 	}
// 
// 	public static boolean isFile(String fileName) {
// 		return filesMap.containsKey(fileName);
// 	}
// 
// 	/**
// 	 * Converts an Array of Strings into a String where each array element is represented as one line.
// 	 * 
// 	 * @param lines
// 	 *            The array to process
// 	 * @return the array as lines.
// 	 */
// 	public static String arrayToLines(String[] lines) {
// 		String result = "";
// 		for (String line : lines) {
// 			if (result != "") {
// 				result += "\n";
// 			}
// 			result += line;
// 		}
// 		return result;
// 	}
// 
// }


import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.startsWith;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.hamcrest.Matcher;
import org.junit.Test;
import test.Input;
		}
	}

	/**
	 * Runs a test with a tolerance of {@code 0}. Asserts that the program behaves correctly in that case.
	 */
	@Test
	public void testNoTolerance() {
		queries = new String[] {
				"creator=galileocomputing",
				or(or("creator=galileocomputing", "year=2007"), "creator=ralf_reussner")
		};
		// @formatter:off
        expectedResultMatchers = getMatchers(
            is("creator=galileocomputing,title=java_ist_auch_eine_insel,year=unknown,false"),
            is("creator=unknown,title=grundkurs_programmieren_in_java,year=2007,false"),
            is("creator=ralf_reussner,title=unknown,year=2006,false"),

            is("creator=galileocomputing,title=java_ist_auch_eine_insel,year=unknown,false"),
            is("creator=unknown,title=grundkurs_programmieren_in_java,year=2007,false"),
            is("creator=ralf_reussner,title=unknown,year=2006,false")
                );
        // @formatter:on

		multiLineTest(searchForAll(queries), expectedResultMatchers, "0", Input.getFile(taskSheetInputFile));

		int randomTestRuns = 3;
		for (int i = 0; i < randomTestRuns; i++) {
			String[] shuffledCommands = searchForAll(shuffle(queries));
			String[] shuffledFile = shuffleCase(taskSheetInputFile);
// Path: src/test/Input.java
// public class Input {
// 	private static HashMap<String, String[]> filesMap = new HashMap<>();
// 	private static HashMap<String[], String> reverseFileMap = new HashMap<>();
// 
// 	/**
// 	 * This class is not meant to be instantiated.
// 	 */
// 	private Input() {
// 	}
// 
// 	/**
// 	 * Returns a path to a file containing the lines given in {@code lines}. Creates the file if it was not created
// 	 * before.
// 	 * 
// 	 * @param lines
// 	 *            The lines to print in the file.
// 	 * @return path to a file containing {@code lines}
// 	 */
// 	public static String getFile(String... lines) {
// 		String fileName;
// 		if (!Input.reverseFileMap.containsKey(lines)) {
// 			fileName = UUID.randomUUID().toString() + ".txt";
// 			File file = new File(fileName);
// 			BufferedWriter outputWriter = null;
// 			try {
// 				outputWriter = new BufferedWriter(new FileWriter(file));
// 				for (String line : lines) {
// 					outputWriter.write(line);
// 					outputWriter.newLine();
// 				}
// 				outputWriter.flush();
// 				outputWriter.close();
// 				file.deleteOnExit();
// 			} catch (IOException e) {
// 				fail("The test was unable to create a test file. That's a shame!");
// 			}
// 
// 			Input.filesMap.put(fileName, lines);
// 			Input.reverseFileMap.put(lines, fileName);
// 		} else {
// 			fileName = Input.reverseFileMap.get(lines);
// 		}
// 		return fileName;
// 	}
// 
// 	/**
// 	 * Returns a path to a file containing the lines given in {@code lines}. Creates the file if it was not created
// 	 * before.
// 	 * 
// 	 * @param lines
// 	 *            The lines to print in the file.
// 	 * @return path to a file containing {@code lines}
// 	 */
// 	public static String getFile(Collection<String> lines) {
// 		String[] linesArray = new String[lines.size()];
// 		Iterator<String> iterator = lines.iterator();
// 		for (int i = 0; iterator.hasNext(); i++) {
// 			linesArray[i] = iterator.next();
// 		}
// 		return getFile(linesArray);
// 	}
// 
// 	/**
// 	 * A message giving information about the input file used in a test.
// 	 * 
// 	 * @param filePath
// 	 *            The command line arguments the main method was called with during the test. The file message will read
// 	 *            the file name in the second argument and output the contents of the file its pointing to.
// 	 * @return A text representing the input file
// 	 */
// 	public static String fileMessage(String filePath) {
// 		String result = "";
// 		if (filesMap.containsKey(filePath)) {
// 			result = "\n with the following input file:\n\n" + arrayToLines(filesMap.get(filePath)) + "\n\n";
// 		}
// 		return result;
// 	}
// 
// 	/**
// 	 * @return The paths to all generated input files.
// 	 */
// 	public static List<String> getAllFilePaths() {
// 		return new LinkedList<String>(filesMap.keySet());
// 	}
// 
// 	/**
// 	 * @param filePath
// 	 *            The path of a generated input file.
// 	 * @return The lines of the input file that was given the path {@code filePath}, {@code null} if there is no such
// 	 *         file.
// 	 */
// 	public static String[] getFileContentOf(String filePath) {
// 		return filesMap.get(filePath);
// 	}
// 
// 	public static boolean isFile(String fileName) {
// 		return filesMap.containsKey(fileName);
// 	}
// 
// 	/**
// 	 * Converts an Array of Strings into a String where each array element is represented as one line.
// 	 * 
// 	 * @param lines
// 	 *            The array to process
// 	 * @return the array as lines.
// 	 */
// 	public static String arrayToLines(String[] lines) {
// 		String result = "";
// 		for (String line : lines) {
// 			if (result != "") {
// 				result += "\n";
// 			}
// 			result += line;
// 		}
// 		return result;
// 	}
// 
// }


// Path: src/sheet6/c_bookDatabase/subtests/CompleteSearchScenarioTest.java
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.startsWith;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.hamcrest.Matcher;
import org.junit.Test;
import test.Input;

		}
	}

	/**
	 * Runs a test with a tolerance of {@code 0}. Asserts that the program behaves correctly in that case.
	 */
	@Test
	public void testNoTolerance() {
		queries = new String[] {
				"creator=galileocomputing",
				or(or("creator=galileocomputing", "year=2007"), "creator=ralf_reussner")
		};
		// @formatter:off
        expectedResultMatchers = getMatchers(
            is("creator=galileocomputing,title=java_ist_auch_eine_insel,year=unknown,false"),
            is("creator=unknown,title=grundkurs_programmieren_in_java,year=2007,false"),
            is("creator=ralf_reussner,title=unknown,year=2006,false"),

            is("creator=galileocomputing,title=java_ist_auch_eine_insel,year=unknown,false"),
            is("creator=unknown,title=grundkurs_programmieren_in_java,year=2007,false"),
            is("creator=ralf_reussner,title=unknown,year=2006,false")
                );
        // @formatter:on

		multiLineTest(searchForAll(queries), expectedResultMatchers, "0", Input.getFile(taskSheetInputFile));

		int randomTestRuns = 3;
		for (int i = 0; i < randomTestRuns; i++) {
			String[] shuffledCommands = searchForAll(shuffle(queries));
			String[] shuffledFile = shuffleCase(taskSheetInputFile);
			multiLineTest(shuffledCommands, expectedResultMatchers, "0", Input.getFile(shuffledFile));