public static RemoteTranslateHelper create(String projectId, InputStream keyStream)
      throws TranslateHelperException {
    try {
      HttpTransportOptions transportOptions = TranslateOptions.getDefaultHttpTransportOptions();
      transportOptions =
          transportOptions.toBuilder().setConnectTimeout(60000).setReadTimeout(60000).build();
      TranslateOptions translateOptions =
          TranslateOptions.newBuilder()
              .setCredentials(GoogleCredentials.fromStream(keyStream))
              .setProjectId(projectId)
              .setRetrySettings(retryParams())
              .setTransportOptions(transportOptions)
              .build();
      return new RemoteTranslateHelper(translateOptions);
    } catch (IOException ex) {
      if (logger.isLoggable(Level.WARNING)) {
        logger.log(Level.WARNING, ex.getMessage());
      }
      throw TranslateHelperException.translate(ex);
    }
  }
Creates a {@code RemoteTranslateHelper} object for the given project id and JSON key input
stream.

@param projectId id of the project to be used for running the tests
@param keyStream input stream for a JSON key
@return A {@code RemoteTranslateHelper} object for the provided options
@throws com.google.cloud.translate.testing.RemoteTranslateHelper.TranslateHelperException if
    {@code keyStream} is not a valid JSON key stream
java-translate/google-cloud-translate/src/main/java/com/google/cloud/translate/testing/RemoteTranslateHelper.java