public Waiter<DescribeInstancesRequest> instanceTerminated() {

        return new WaiterBuilder<DescribeInstancesRequest, DescribeInstancesResult>()
                .withSdkFunction(new DescribeInstancesFunction(client))
                .withAcceptors(new InstanceTerminated.IsTerminatedMatcher(), new InstanceTerminated.IsResourceNotFoundExceptionMatcher(),
                        new InstanceTerminated.IsBootingMatcher(), new InstanceTerminated.IsOnlineMatcher(), new InstanceTerminated.IsPendingMatcher(),
                        new InstanceTerminated.IsRebootingMatcher(), new InstanceTerminated.IsRequestedMatcher(),
                        new InstanceTerminated.IsRunning_setupMatcher(), new InstanceTerminated.IsSetup_failedMatcher(),
                        new InstanceTerminated.IsStart_failedMatcher())
                .withDefaultPollingStrategy(new PollingStrategy(new MaxAttemptsRetryStrategy(40), new FixedDelayStrategy(15)))
                .withExecutorService(executorService).build();
    }
Builds a InstanceTerminated waiter by using custom parameters waiterParameters and other parameters defined in
the waiters specification, and then polls until it determines whether the resource entered the desired state or
not, where polling criteria is bound by either default polling strategy or custom polling strategy.
aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/waiters/AWSOpsWorksWaiters.java