public Waiter<GetInstanceProfileRequest> instanceProfileExists() {

        return new WaiterBuilder<GetInstanceProfileRequest, GetInstanceProfileResult>().withSdkFunction(new GetInstanceProfileFunction(client))
                .withAcceptors(new HttpSuccessStatusAcceptor(WaiterState.SUCCESS), new HttpFailureStatusAcceptor(404, WaiterState.RETRY))
                .withDefaultPollingStrategy(new PollingStrategy(new MaxAttemptsRetryStrategy(40), new FixedDelayStrategy(1)))
                .withExecutorService(executorService).build();
    }
Builds a InstanceProfileExists 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-iam/src/main/java/com/amazonaws/services/identitymanagement/waiters/AmazonIdentityManagementWaiters.java