code: private void sortAvailableInstancesByNumberOfCPUCores() {
  
  		if (this.availableInstanceTypes.length < 2) {
  			return;
  		}
  
  		for (int i = 1; i < this.availableInstanceTypes.length; i++) {
  			final InstanceType it = this.availableInstanceTypes[i];
  			int j = i;
  			while (j > 0 && this.availableInstanceTypes[j - 1].getNumberOfCores() < it.getNumberOfCores()) {
  				this.availableInstanceTypes[j] = this.availableInstanceTypes[j - 1];
  				--j;
  			}
  			this.availableInstanceTypes[j] = it;
  		}
  	}
docs: Sorts the list of available instance types by the number of CPU cores in a descending order.