code: @SuppressWarnings("WeakerAccess")
    public ApiFuture<Policy> setIamPolicyAsync(String instanceId, Policy policy) {
      String name = NameUtil.formatInstanceName(projectId, instanceId);
      final IamPolicyMarshaller marshaller = new IamPolicyMarshaller();
  
      SetIamPolicyRequest request =
          SetIamPolicyRequest.newBuilder()
              .setResource(name)
              .setPolicy(marshaller.toPb(policy))
              .build();
  
      return ApiFutures.transform(
          stub.setIamPolicyCallable().futureCall(request),
          new ApiFunction<com.google.iam.v1.Policy, Policy>() {
            @Override
            public Policy apply(com.google.iam.v1.Policy proto) {
              return marshaller.fromPb(proto);
            }
          },
          MoreExecutors.directExecutor());
    }
docs: Asynchronously replaces the IAM policy associated with the specified instance.
  
  <p>Sample code:
  
  <pre>{@code
  ApiFuture<Policy> newPolicyFuture = client.setIamPolicyAsync("my-instance",
  Policy.newBuilder()
  .addIdentity(Role.of("bigtable.user"), Identity.user("someone@example.com"))
  .addIdentity(Role.of("bigtable.admin"), Identity.group("admins@example.com"))
  .build());
  
  ApiFutures.addCallback(policyFuture,
  new ApiFutureCallback<Policy>() {
  public void onSuccess(Policy policy) {
  for (Entry<Role, Set<Identity>> entry : policy.getBindings().entrySet()) {
  System.out.printf("Role: %s Identities: %s\n", entry.getKey(), entry.getValue());
  }
  }
  
  public void onFailure(Throwable t) {
  t.printStackTrace();
  }
  },
  MoreExecutors.directExecutor());
  }</pre>
  
  @see <a
  href="https://cloud.google.com/bigtable/docs/access-control#iam-management-instance">Instance-level
  IAM management</a>