code: private String generateUserAgent(String userAgent) {
          String title = null;
          String thisVersion = null;
  
          if(userAgent == null) {
              StackTraceElement[] callers = Thread.currentThread().getStackTrace();
              String module = null;
              String callerClass = null;
              int stackIdx;
              for(stackIdx = callers.length - 1; stackIdx >= 0; stackIdx--) {
                  callerClass = callers[stackIdx].getClassName();
                  try {
                      Class<?> clazz = Class.forName(callerClass);
                      ClassLoader classLoader = clazz.getClassLoader();
                      // skip JRE classes
                      if (classLoader == null) {
                          continue;
                      }
                      String classFilePath = callerClass.replace(".", "/") + ".class";
                      URL classUrl = classLoader.getResource(classFilePath);
                      if (classUrl != null) {
                          String classUrlPath = classUrl.getPath();
                          int jarSeparator = classUrlPath.indexOf('!');
                          if (jarSeparator > 0) {
                              module = classUrlPath.substring(0, jarSeparator);
                              // extract the last path element (the jar name only)
                              module = module.substring(module.lastIndexOf('/') + 1);
                              break;
                          }
                      }
                  } catch (Exception ex) { }
              }
              userAgent = module + "!" + callerClass;
          }
          try {
              final Properties properties = new Properties();
              properties.load(this.getClass().getClassLoader().getResourceAsStream("sdk.properties"));
              thisVersion = properties.getProperty("sdk.version");
              title = properties.getProperty("sdk.name");
          } catch (IOException e) { }
          return title + "/" + thisVersion + "/" + userAgent + "/" + System.getProperty("os.name") + " "
                  + System.getProperty("java.vm.name") + " " + System.getProperty("java.vendor") + " "
                  + System.getProperty("java.version");
      }
docs: Compose a User-Agent string that represents this version of the SDK (along with platform info)
  
  @return a User-Agent string