Code example for AtomicReference

0
amazonEC2Client = EasyMock.createMock(AmazonEC2Client.class);
    runInstancesResult = EasyMock.createMock(RunInstancesResult.class);
    describeInstancesResult = EasyMock.createMock(DescribeInstancesResult.class);
    reservation = EasyMock.createMock(Reservation.class);
    workerSetupData = new AtomicReference<WorkerSetupData>(null);
 
    instance = new Instance()
        .withInstanceId(INSTANCE_ID)
        .withLaunchTime(new Date())
        .withImageId(AMI_ID)
        .withPrivateIpAddress(IP);
 
    strategy = new EC2AutoScalingStrategy(
        new DefaultObjectMapper(), 
        amazonEC2Client,
        new SimpleResourceManagementConfig().setWorkerPort(8080).setWorkerVersion(""), 
        DSuppliers.of(workerSetupData)
    ); 
  } 
 
  @After 
  public void tearDown() throws Exception