@Test
public void testEscapeMessagePattern() throws ResourceFilterException {

    for (String[] testCase : MESSAGE_PATTERN_TEST_CASES) {
        String result = JavaPropertiesResource.escapeMessagePattern(testCase[0], MessagePatternEscape.AUTO);
        assertEquals("escapeMessagePattern(" + testCase[0] + ", AUTO)", testCase[1], result);
    }
    for (String[] testCase : MESSAGE_PATTERN_TEST_CASES) {
        String result = JavaPropertiesResource.escapeMessagePattern(testCase[0], MessagePatternEscape.ALL);
        String expected = testCase.length >= 3 && testCase[2] != null ? testCase[2] : testCase[1];
        assertEquals("escapeMessagePattern(" + testCase[0] + ", ALL)", expected, result);
    }
}