TestFSMainOperationsLocalFileSystem extends Class FSMainOperationsBaseTest. PathFilter FSMainOperationsBaseTest#TEST_X_FILTER checks if a path has "x" and "X" in its name.
Some of the test cases construct a path by combining path "TEST_ROOT_DIR" with a customized partial path.
The problem is that "TEST_ROOT_DIR" may also has "X" in its name. The path check will pass even if the customized partial path doesn't have "X". However, for this case the path filter is supposed to reject this path.
An easy fix is to change "file.toString().contains("X")" to "file.getName().contains("X")". Note that org.apache.hadoop.fs.Path.getName() only returns the final component of this path.