// Path: cloud-vmware-server/src/main/java/jetbrains/buildServer/clouds/base/connector/AbstractInstance.java
// public abstract class AbstractInstance {
//   @NotNull
//   public abstract String getName();
// 
//   public abstract boolean isInitialized();
// 
//   public abstract Date getStartDate();
// 
//   public abstract String getIpAddress();
// 
//   public abstract InstanceStatus getInstanceStatus();
// 
//   @Nullable
//   public abstract String getProperty(String name);
// }
// 
// Path: cloud-vmware-server/src/main/java/jetbrains/buildServer/clouds/vmware/VmwareSourceState.java
// public class VmwareSourceState {
// 
//   @Nullable
//   private final String mySnapshotName;
// 
//   @Nullable
//   private final String mySourceVmId;
// 
//   private VmwareSourceState(@Nullable final String snapshotName, @Nullable final String sourceVmId){
//     mySnapshotName = snapshotName;
//     mySourceVmId = sourceVmId;
//   }
// 
//   public static VmwareSourceState from(@Nullable final String snapshot, @Nullable final String sourceVmId){
//     return new VmwareSourceState(snapshot, sourceVmId);
//   }
// 
//   @Nullable
//   public String getDiffMessage(final VmwareSourceState vmState) {
//     if (!Objects.equals(vmState.mySnapshotName, this.mySnapshotName)) {
//       return String.format("Snapshot is outdated. VM: '%s' vs Actual: '%s'", mySnapshotName, vmState.mySnapshotName);
//     } else if (!Objects.equals(vmState.mySourceVmId, this.mySourceVmId) && mySourceVmId != null && vmState.mySourceVmId != null) {
//       return String.format("Source VM id is outdated. VM: '%s' vs Actual: '%s'", mySourceVmId, vmState.mySourceVmId);
//     }
//     return null;
//   }
// 
//   @Nullable
//   public String getSnapshotName() {
//     return mySnapshotName;
//   }
// 
//   @Nullable
//   public String getSourceVmId() {
//     return mySourceVmId;
//   }
// 
//   @Override
//   public boolean equals(final Object obj) {
//     if (!(obj instanceof VmwareSourceState))
//       return false;
//     final VmwareSourceState state = (VmwareSourceState)obj;
// 
//     if (!Objects.equals(state.mySnapshotName, this.mySnapshotName))
//       return false;
// 
//     if (!Objects.equals(state.mySourceVmId, this.mySourceVmId) && mySourceVmId != null && state.mySourceVmId != null)
//       return false;
// 
//     return true;
//   }
// 
//   @Override
//   public String toString() {
//     return "VmwareSourceState{" +
//            "mySnapshotName='" + mySnapshotName + '\'' +
//            ", mySourceVmId='" + mySourceVmId + '\'' +
//            '}';
//   }
// }


import com.intellij.openapi.diagnostic.Logger;
import com.vmware.vim25.ManagedObjectReference;
import com.vmware.vim25.OptionValue;
import com.vmware.vim25.VirtualMachinePowerState;
import com.vmware.vim25.mo.VirtualMachine;
import java.util.*;
import jetbrains.buildServer.Used;
import jetbrains.buildServer.clouds.InstanceStatus;
import jetbrains.buildServer.clouds.base.connector.AbstractInstance;
import jetbrains.buildServer.clouds.vmware.VmwareSourceState;
import jetbrains.buildServer.util.StringUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
    }
    return myBootTime == null ? null : myBootTime.getTime();
  }

  @Nullable
  public String getIpAddress() {
    return myIpAddress;
  }

  @Override
  public InstanceStatus getInstanceStatus() {
    if (myPowerState == VirtualMachinePowerState.poweredOff) {
      return InstanceStatus.STOPPED;
    }
    if (myPowerState == VirtualMachinePowerState.poweredOn) {
      return InstanceStatus.RUNNING;
    }
    return InstanceStatus.UNKNOWN;
  }

  public boolean isReadonly() {
    return myIsTemplate;
  }

  @NotNull
  public String getChangeVersion() {
    return myChangeVersion;
  }

  @Nullable
// Path: cloud-vmware-server/src/main/java/jetbrains/buildServer/clouds/base/connector/AbstractInstance.java
// public abstract class AbstractInstance {
//   @NotNull
//   public abstract String getName();
// 
//   public abstract boolean isInitialized();
// 
//   public abstract Date getStartDate();
// 
//   public abstract String getIpAddress();
// 
//   public abstract InstanceStatus getInstanceStatus();
// 
//   @Nullable
//   public abstract String getProperty(String name);
// }
// 
// Path: cloud-vmware-server/src/main/java/jetbrains/buildServer/clouds/vmware/VmwareSourceState.java
// public class VmwareSourceState {
// 
//   @Nullable
//   private final String mySnapshotName;
// 
//   @Nullable
//   private final String mySourceVmId;
// 
//   private VmwareSourceState(@Nullable final String snapshotName, @Nullable final String sourceVmId){
//     mySnapshotName = snapshotName;
//     mySourceVmId = sourceVmId;
//   }
// 
//   public static VmwareSourceState from(@Nullable final String snapshot, @Nullable final String sourceVmId){
//     return new VmwareSourceState(snapshot, sourceVmId);
//   }
// 
//   @Nullable
//   public String getDiffMessage(final VmwareSourceState vmState) {
//     if (!Objects.equals(vmState.mySnapshotName, this.mySnapshotName)) {
//       return String.format("Snapshot is outdated. VM: '%s' vs Actual: '%s'", mySnapshotName, vmState.mySnapshotName);
//     } else if (!Objects.equals(vmState.mySourceVmId, this.mySourceVmId) && mySourceVmId != null && vmState.mySourceVmId != null) {
//       return String.format("Source VM id is outdated. VM: '%s' vs Actual: '%s'", mySourceVmId, vmState.mySourceVmId);
//     }
//     return null;
//   }
// 
//   @Nullable
//   public String getSnapshotName() {
//     return mySnapshotName;
//   }
// 
//   @Nullable
//   public String getSourceVmId() {
//     return mySourceVmId;
//   }
// 
//   @Override
//   public boolean equals(final Object obj) {
//     if (!(obj instanceof VmwareSourceState))
//       return false;
//     final VmwareSourceState state = (VmwareSourceState)obj;
// 
//     if (!Objects.equals(state.mySnapshotName, this.mySnapshotName))
//       return false;
// 
//     if (!Objects.equals(state.mySourceVmId, this.mySourceVmId) && mySourceVmId != null && state.mySourceVmId != null)
//       return false;
// 
//     return true;
//   }
// 
//   @Override
//   public String toString() {
//     return "VmwareSourceState{" +
//            "mySnapshotName='" + mySnapshotName + '\'' +
//            ", mySourceVmId='" + mySourceVmId + '\'' +
//            '}';
//   }
// }


// Path: cloud-vmware-server/src/main/java/jetbrains/buildServer/clouds/vmware/connector/VmwareInstance.java
import com.intellij.openapi.diagnostic.Logger;
import com.vmware.vim25.ManagedObjectReference;
import com.vmware.vim25.OptionValue;
import com.vmware.vim25.VirtualMachinePowerState;
import com.vmware.vim25.mo.VirtualMachine;
import java.util.*;
import jetbrains.buildServer.Used;
import jetbrains.buildServer.clouds.InstanceStatus;
import jetbrains.buildServer.clouds.base.connector.AbstractInstance;
import jetbrains.buildServer.clouds.vmware.VmwareSourceState;
import jetbrains.buildServer.util.StringUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

    }
    return myBootTime == null ? null : myBootTime.getTime();
  }

  @Nullable
  public String getIpAddress() {
    return myIpAddress;
  }

  @Override
  public InstanceStatus getInstanceStatus() {
    if (myPowerState == VirtualMachinePowerState.poweredOff) {
      return InstanceStatus.STOPPED;
    }
    if (myPowerState == VirtualMachinePowerState.poweredOn) {
      return InstanceStatus.RUNNING;
    }
    return InstanceStatus.UNKNOWN;
  }

  public boolean isReadonly() {
    return myIsTemplate;
  }

  @NotNull
  public String getChangeVersion() {
    return myChangeVersion;
  }

  @Nullable
  public VmwareSourceState getVmSourceState(){