java syncronized and factory method