code: public static Properties loadProperties(String path, Class cls) {
  
          Properties properties = new Properties();
  
          // environment variables will always override properties file
  
          try {
  
              InputStream in = cls.getResourceAsStream(path);
  
              // if we cant find the properties file
              if (in != null) {
                  properties.load(in);
              }
  
  
              // Env variables will always override properties
              if (System.getenv("api_key") != null && System.getenv("api_url") != null) {
                  properties.put("api_key", System.getenv("api_key"));
                  properties.put("api_url", System.getenv("api_url"));
              }
  
          } catch (IOException e) {
              LOGGER.log(Level.SEVERE, "Problems loading properties", e);
          }
  
  
          return properties;
      }
docs: Loads your api_key and api_url properties from the given property file
  <p>
  Two important things to have in mind here:
  1) if api_key and api_url are defined as environment variables, they will be returned as the properties.
  2) If you want to load your properties file have in mind your classloader path may change.
  
  @return the Properties object containing the properties to setup Authy or an empty Properties object if no properties were found