Yes, you can synchronize on a class. Something like this would do:
Synchronizing on a class is little different from synchronizing on an object. It's important to remember that every object has exactly 1 lock. Likewise, a class has exactly 1 lock. So, in the code I wrote above, there would be 3 locks readily available - one for each Test object and one for the Test class (of course, you could lock on any other class, as well).
Sometimes, locking on a class, as opposed to an object, can be convenient so that multiple threads can synchronize without sharing access to an object.