class EndTrimmingTokenizer implements StringTokenizer {

    @Override
    public List<String> tokenize(String input)
    {
        List<String> result = myTokenizer.tokenize(input);
        while (!result.isEmpty() && myPredicate.test(result.get(result.size() - 1)))
        {
            result.remove(result.size() - 1);
        }
        return result;
    }

    public  EndTrimmingTokenizer(Predicate<String> predicate, StringTokenizer tokenizer);

}