Peter Norvig has written some stuff in python.
http://norvig.com/ngrams/ngrams.py
contains a function called segment. It run a Naive Bayes probability of a sequence of words. works well. Can be a good basis for what your trying to accomplish in java.
If you get it converted to java, i'd be interested in seeing the implementation.
Thanks.
Mike