add wait notify java code