code: static UserConfig readUser() {
          final String configPath = System.getProperty(CONFIG_PATH_SYSTEM_PROPERTY);
          if (configPath == null)
              throw new IllegalArgumentException("Add " + CONFIG_PATH_SYSTEM_PROPERTY + " to system properties!");
  
          if (configPath.startsWith(CLASSPATH_PREFIX)) {
              final InputStream configStream = UserConfig.class.getResourceAsStream(configPath.substring(CLASSPATH_PREFIX.length()));
              if (configStream == null) throw new IllegalArgumentException("Can't load config from: " + configPath);
  
              final InputStreamReader reader = new InputStreamReader(configStream);
              return new Gson().fromJson(reader, UserConfig.class);
          } else if (configPath.startsWith(FILE_PREFIX)) {
              try {
                  return new Gson().fromJson(new FileReader(configPath.substring(FILE_PREFIX.length())), UserConfig.class);
              } catch (FileNotFoundException e) {
                  throw new IllegalArgumentException("Can't load config from: " + configPath);
              }
          } else if (configPath.equals(LOCAL)) {
              return local();
          } else if (configPath.equals(NONE)) {
              return new UserConfig();
          }
  
          throw new IllegalArgumentException("Unknown config path: " + configPath);
      }
docs: package only for tests