@Override
   public boolean match(String attributeValue) {
      if (attributeValue == null) {
         return false;
      }

      switch (type) {
         case Equals:
            return attributeValue.equals(value);
         case StartsWith:
            return (length == -1 || length == attributeValue.length()) && attributeValue.startsWith(value);
         case EndsWith:
            return (length == -1 || length == attributeValue.length()) && attributeValue.endsWith(value);
         case Contains:
            return attributeValue.contains(value);
         case Regexp:
            return regexPattern.matcher(attributeValue).matches();
         default:
            throw new IllegalStateException("Unexpected type " + type);
      }
   }
@Test
   public void testSingleCharWildcard() {
      LikeCondition likeCondition = new LikeCondition("a_b_c");
      assertTrue(likeCondition.match("aXbYc"));
      assertTrue(likeCondition.match("a_b_c"));
      assertTrue(likeCondition.match("a%b%c"));
      assertFalse(likeCondition.match("abc"));
      assertFalse(likeCondition.match("aXXbYYc"));
   }