examples for java design patten