Solution { public static Solution getInstance() { if (null == solution) { synchronized (lock) { if (null == solution) { solution = new Solution(); } } } return solution; } private  Solution(); static Solution getInstance();  }
@Test public void test1() { Solution a = Solution.getInstance(); Solution b = Solution.getInstance(); assertSame(a,b); }