source: class LazyInitRaceTest {
  
  	 ExpensiveObject exObject_1;
  	 ExpensiveObject exObject_2;
  
  	@Test
  	public void testRaceConditionInLazyInit() {
  
target: 		LazyInitRace lazy = new LazyInitRace();
  
  		Thread th_1 = new Thread(() -> {
  			exObject_1 = lazy.getInstance();
  		});
  
  		Thread th_2 = new Thread(() -> {
  			exObject_2 = lazy.getInstance();
  		});
  
  		th_1.start();
  		th_2.start();
  
  		try {
  			th_1.join();
  			th_2.join();
  		}
  		catch (InterruptedException e) {
  			e.printStackTrace();
  		}
  
  		assertEquals(exObject_1, exObject_2);
  	}
  
  }