I have 2 singleton services, each of them must have a 'context' field, but this field must be represented as the same object for both singletons. Also, access to this object must be limited by these singletons. Further, there is a chance that I will add the third singleton service with this field, and that one must be represented with the same object too. My first approach was smth like this:
abstract class Abs {
protected static Object context = new Object();
// some static methods
}
class Service1 extends Abs {}
class Service2 extends Abs {}
But I'm not sure that it is a good solution.