Declare Method Synchronized Java