Java multithread samples, simple to complex