public String process(String str)
	{
		StringBuilder sb = new StringBuilder();
		for (String line : str.split("\r?\n"))
		{
			if (line.startsWith("#include "))
			{
				String resource = line.substring(9);
				if (resource.startsWith("\"") && resource.endsWith("\""))
				{
					resource = resource.substring(1, resource.length() - 1);
				}

				String resourceStr = load(resource);
				sb.append(resourceStr);
			}
			else
			{
				sb.append(line).append('\n');
			}
		}
		return sb.toString();
	}
@Test
	public void testProcess()
	{
		Function<String, String> func = (String resource) ->
		{
			switch (resource)
			{
				case "file2":
					return FILE2;
				default:
					throw new RuntimeException("unknown resource");
			}
		};
		String out = new Template()
			.add(func)
			.process(FILE1);
		assertEquals(RESULT, out);
	}