Dans un environnement multithread, le comportement d'un singleton peut être faussé.
Pour éviter ce problème, il suffit d'ajouter le qualificatif synchronized à la méthode du singleton :
public static synchronized Singleton getInstance() {
if (instance == null) {
instance = new Singleton();
}
return instance;
}