public CustomToggle config(Properties properties) {
    for (String key : properties.stringPropertyNames()) {
      String value = properties.getProperty(key);
      key = key.toLowerCase();

      // compare with legal configuration names
      for (Property p: Property.values()) {
        if (key.equals(p.key())) {
          String ability = key.split("\\.")[1];
          if (key.contains("enabled") && value.equalsIgnoreCase("false")) {
            this.turnOff(ability);
          }else if (key.contains("toggle")) {
            this.toggle(ability, value);
          }
        }
      }
    }
    return this;
  }
@Test
  public void canProcessAbilitiesThroughProperties() {
    Properties properties = new Properties();
    try {
      properties.load(Files.newInputStream(Paths.get(filename)));
      toggle = new CustomToggle().config(properties);
    } catch (IOException e) {
      System.out.println("No such file");
    }

    customBot = new DefaultBot(null, EMPTY, db, toggle);
    customBot.onRegister();

    String targetName = "restrict";
    assertTrue(customBot.getAbilities().containsKey(targetName));
  }