该代码的解释是什么?
String key = "camera.cameraConfiguration.2a";
// This regex just allows "extensions", anything after the \d+ block, to the usual format
String regex = "camera.cameraConfiguration\\.\\d+(\\..*)?";
Predicate<String> predicate = Pattern.compile(regex).asPredicate();
// This one used predicate --> Return true BUT it should be FALSE because the regex says: give me only number then an optional string formatted like ".thenAnyCharYouWant"
System.out.println(predicate.test(key));
// Return false
System.out.println(key.matches(regex));
// Return false
System.out.println(Pattern.compile(regex).matcher(key).matches());
Run Code Online (Sandbox Code Playgroud)
为什么Predicate.test似乎给出错误的答案?