Simple java implementation of LSEQ