public static String htmlToPlain(final String text) {
		if (text == null) {
			return null;
		}
		CachedStringTransformationResult threadLocalCachedHtmlToPlain = cachedHtmlToPlain.get();
		if(threadLocalCachedHtmlToPlain.input.equals(text))
			return threadLocalCachedHtmlToPlain.output;
		String output = HtmlUtils.htmlToPlain(text, /* strictHTMLOnly= */true, /* removeNewLines= */true);
		cachedHtmlToPlain.set(new CachedStringTransformationResult(text, output));
		return output;
	}
@Test
	public void testHtmlToPlain_shouldRemoveTrailingWhitespaces() {
		String input = "<html>\n" +
				"  <head>\n" +
				"    \n" +
				"  </head>\n" +
				"  <body>\n" +
				"    <p>\n" +
				"      A paragraph followed by an empty one\n" +
				"    </p>\n" +
				"    <p>\n" +
				"      \n" +
				"    </p>\n" +
				"  </body>\n" +
				"</html>";
		String expected = "A paragraph followed by an empty one";
		String actual = HtmlUtils.htmlToPlain(input, true, true);
		assertEquals(expected, actual);
	}