code: public static List<InstanceStateChange> terminateInstances(final List<String> instanceIDs) {
          // pass any credentials as aws-mock does not authenticate them at all
          AWSCredentials credentials = new BasicAWSCredentials("foo", "bar");
          AmazonEC2Client amazonEC2Client = new AmazonEC2Client(credentials);
  
          // the mock endpoint for ec2 which runs on your computer
          String ec2Endpoint = "http://localhost:8000/aws-mock/ec2-endpoint/";
          amazonEC2Client.setEndpoint(ec2Endpoint);
  
          // send the terminate request with args as instance IDs
          TerminateInstancesRequest request = new TerminateInstancesRequest();
          request.withInstanceIds(instanceIDs);
          TerminateInstancesResult result = amazonEC2Client.terminateInstances(request);
  
          return result.getTerminatingInstances();
      }
docs: Terminate specified instances (power-on the instances).
  
  @param instanceIDs
  IDs of the instances to terminate
  @return a list of state changes for the instances