@Test
public void testQuoteMetacharacters() {

	assertThat(StringUtils.quoteMetacharacters("foo"), is(equalTo("foo")));
	assertThat(StringUtils.quoteMetacharacters("foo bar"), is(equalTo("foo bar")));
	assertThat(StringUtils.quoteMetacharacters("\\"), is(equalTo("\\\\")));
	assertThat(StringUtils.quoteMetacharacters("."), is(equalTo("\\.")));
	assertThat(StringUtils.quoteMetacharacters("+"), is(equalTo("\\+")));
	assertThat(StringUtils.quoteMetacharacters("*"), is(equalTo("\\*")));
	assertThat(StringUtils.quoteMetacharacters("?"), is(equalTo("\\?")));
	assertThat(StringUtils.quoteMetacharacters("["), is(equalTo("\\[")));
	assertThat(StringUtils.quoteMetacharacters("^"), is(equalTo("\\^")));
	assertThat(StringUtils.quoteMetacharacters("]"), is(equalTo("\\]")));
	assertThat(StringUtils.quoteMetacharacters("$"), is(equalTo("\\$")));
	assertThat(StringUtils.quoteMetacharacters("("), is(equalTo("\\(")));
	assertThat(StringUtils.quoteMetacharacters(")"), is(equalTo("\\)")));
	assertThat(StringUtils.quoteMetacharacters("{"), is(equalTo("\\{")));
	assertThat(StringUtils.quoteMetacharacters("}"), is(equalTo("\\}")));
	assertThat(StringUtils.quoteMetacharacters("="), is(equalTo("\\=")));
	assertThat(StringUtils.quoteMetacharacters("!"), is(equalTo("\\!")));
	assertThat(StringUtils.quoteMetacharacters("<"), is(equalTo("\\<")));
	assertThat(StringUtils.quoteMetacharacters(">"), is(equalTo("\\>")));
	assertThat(StringUtils.quoteMetacharacters("|"), is(equalTo("\\|")));
	assertThat(StringUtils.quoteMetacharacters(":"), is(equalTo("\\:")));
	assertThat(StringUtils.quoteMetacharacters("foo bar \\.+*?[^]$(){}=!<>|:"),
			is(equalTo("foo bar \\\\\\.\\+\\*\\?\\[\\^\\]\\$\\(\\)\\{\\}\\=\\!\\<\\>\\|\\:")));
	assertThat(StringUtils.quoteMetacharacters(""), is(equalTo("")));
	assertThat(StringUtils.quoteMetacharacters(null), is(equalTo(null)));
}