Java KMP String Search Algorithm