Do you mean synchronization in Java between multiple threads, or between the computer and the Arduino?
If it's the first then the Java Tutorial
on concurrency is a good information source.
If it's the latter, then I'm assuming you're getting mistakes because the computer is sending the data faster than the arduino can process it. (This means the serial buffer will be filling up and bytes will be lost, resulting in mismatched upper and lower values). You can get around this by having the arduino send acknowledgements back so the computer knows when it is ready to send more data.
As an example, in a project I've been working on I have a Java class which manages the serial connection, and it counts the number of bytes that have been sent, when 100 bytes have been sent it will not send any more until a certain message is received from the arduino. The arduino then counts the number of bytes it has recieved and processed, and when that number reaches 100, it sends the request for more to the computer.