code: public static Builder newBuilderForEmulator(int port) {
      Builder builder = newBuilder().setProjectId("fake-project").setInstanceId("fake-instance");
  
      builder
          .stubSettings()
          .setCredentialsProvider(NoCredentialsProvider.create())
          .setEndpoint("localhost:" + port)
          .setTransportChannelProvider(
              InstantiatingGrpcChannelProvider.newBuilder()
                  .setPoolSize(1)
                  .setChannelConfigurator(
                      new ApiFunction<ManagedChannelBuilder, ManagedChannelBuilder>() {
                        @Override
                        public ManagedChannelBuilder apply(ManagedChannelBuilder input) {
                          return input.usePlaintext();
                        }
                      })
                  .build());
  
      return builder;
    }
docs: Create a new builder preconfigured to connect to the Bigtable emulator.