public void testNoneExpandableMatching() throws Exception {

    DefaultTokenizer tokenizer = new DefaultTokenizer(configuration);
    TokenPatternImpl tp;

    // both cases non-expandable
    configuration.setLowerCaseExpandable(false);
    configuration.setUpperCaseExpandable(false);
    tp = new TokenPatternImpl("Hello", tokenizer.tokenize("Hello"), configuration);
    assertTrue(tp.match(tokenizer.tokenize("Wooop")));
    assertFalse(tp.match(tokenizer.tokenize("Greetings")));
    assertFalse(tp.match(tokenizer.tokenize("Hi")));

    // both cases expandable
    configuration.setLowerCaseExpandable(true);
    configuration.setUpperCaseExpandable(true);
    tp = new TokenPatternImpl("Hello", tokenizer.tokenize("Hello"), configuration);
    assertTrue(tp.match(tokenizer.tokenize("Wooop")));
    assertTrue(tp.match(tokenizer.tokenize("Greetings")));
    assertTrue(tp.match(tokenizer.tokenize("Hi")));
    assertTrue(tp.match(tokenizer.tokenize("HHi")));

    // only lower case expandable
    configuration.setLowerCaseExpandable(true);
    configuration.setUpperCaseExpandable(false);
    tp = new TokenPatternImpl("Hello", tokenizer.tokenize("Hello"), configuration);
    assertTrue(tp.match(tokenizer.tokenize("Wooop")));
    assertTrue(tp.match(tokenizer.tokenize("Greetings")));
    assertTrue(tp.match(tokenizer.tokenize("Hi")));
    assertFalse(tp.match(tokenizer.tokenize("HHi")));

    // only upper case expandable
    configuration.setLowerCaseExpandable(false);
    configuration.setUpperCaseExpandable(true);
    tp = new TokenPatternImpl("Hello", tokenizer.tokenize("Hello"), configuration);
    assertTrue(tp.match(tokenizer.tokenize("Wooop")));
    assertFalse(tp.match(tokenizer.tokenize("Greetings")));
    assertFalse(tp.match(tokenizer.tokenize("Hi")));
    assertTrue(tp.match(tokenizer.tokenize("HHiiii")));
  }