void () { assertEquals("my string", StringUtil.trim("\n my string ", CharFilter.NOT_WHITESPACE_FILTER)); assertEquals("my string", StringUtil.trim("my string", CharFilter.NOT_WHITESPACE_FILTER)); assertEquals("my string", StringUtil.trim("my string\t", CharFilter.NOT_WHITESPACE_FILTER)); assertEquals("my string", StringUtil.trim("\nmy string", CharFilter.NOT_WHITESPACE_FILTER)); assertEquals("my-string", StringUtil.trim("my-string", CharFilter.NOT_WHITESPACE_FILTER)); assertEquals("my-string", StringUtil.trim("my-string ", CharFilter.NOT_WHITESPACE_FILTER)); assertEquals("\n my string ", StringUtil.trim("\n my string ", CharFilter.WHITESPACE_FILTER)); assertEquals("", StringUtil.trim("", CharFilter.WHITESPACE_FILTER)); assertEquals("", StringUtil.trim("\n my string ", ch -> false)); assertEquals("\n my string ", StringUtil.trim("\n my string ", ch -> true)); assertEquals("\u00A0 my string", StringUtil.trim("\u00A0 my string ", CharFilter.NOT_WHITESPACE_FILTER)); }