RpcCommandUtil { public static boolean match(String expression, String path) { if (expression == null || expression.length() == 0) { return false; } return evaluator.match(expression, path); }  static RpcCommand stringToCommand(String commandString); static String commandToString(RpcCommand command); static boolean match(String expression, String path);  }
@Test public void testPathMatch() { assertFalse(RpcCommandUtil.match("b* & !bc \n | a* & !ac \t\n | c*", "bc")); assertFalse(RpcCommandUtil.match("b* & !bc* \n | a* & !ac \t\n | c*", "bcd")); assertFalse(RpcCommandUtil.match("b* & !bc \n | a* & !ac \t\n | c*", "ac")); assertFalse(RpcCommandUtil.match("b* & !bc \n | (a* & !ac) \t\n | c*", "bc")); assertFalse(RpcCommandUtil.match("b* & !bc* \n | (a* & !ac) \t\n | c*", "bcd")); assertFalse(RpcCommandUtil.match("b* & !bc \n | a* & !ac \t\n | c*", "ac")); assertFalse(RpcCommandUtil.match("b*&!bc&!bd", "bc")); assertFalse(RpcCommandUtil.match("b*&!bc&!bd", "bd")); assertFalse(RpcCommandUtil.match("((a*&!aa)|b*)", "aa")); assertTrue(RpcCommandUtil.match("b* & !bc \n | a* & !ac \t\n | c*", "ba")); assertTrue(RpcCommandUtil.match("b* & !bc \n | a* & !ac \t\n | c*", "aaa")); assertTrue(RpcCommandUtil.match("b* & !bc \n | a* & !ac \t\n | c*", "acc")); assertTrue(RpcCommandUtil.match("b* & !bc \n | a* & !ac \t\n | c*", "cel")); assertTrue(RpcCommandUtil.match("b* & !bc \n | (a* & !ac) \t\n | c*", "ba")); assertTrue(RpcCommandUtil.match("b* & !bc \n | a* & !ac \t\n | c*", "aaa")); assertTrue(RpcCommandUtil.match("b* & !bc \n | a* & !ac \t\n | c*", "acc")); assertTrue(RpcCommandUtil.match("b* & !bc \n | a* & !ac \t\n | c*", "cel")); assertTrue(RpcCommandUtil.match("((b*&!bc) | (a*&!ab))", "ba")); assertTrue(RpcCommandUtil.match("a*", "a")); assertTrue(RpcCommandUtil.match("b* | (a* & !ab) | (c* & !cc)", "accc")); }