Concurrency: State Models and Java Programs