задача не проходит валидацию. Не видит блок синхронизации в методе getFund. Подскажите пожалуйста где может быть ошибка.
package com.javarush.task.task17.task1707;
public class Solution {
public static void main(String[] args) {
IMF fund = IMF.getFund();
IMF anotherFund = IMF.getFund();
System.out.println(fund == anotherFund );
}
public static class IMF{
private static IMF imf;
private static Object sync = new Object();
private IMF(){
}
public static IMF getFund(){
synchronized(sync){
if(imf == null){
imf = new IMF();
}
}
return imf;
}
}
}