title: NoSuchMethodException when instantiating a class using newInstance()
body: <p>I'm using the following code to instantiate every class in a package:</p>
  
  <pre><code>        for (Class listenerClass : ClassGetter.getClassesForPackage(this, "cullan.listener")) {
          Bukkit.getLogger().info(listenerClass.getSimpleName());
          if (!listenerClass.getSimpleName().equals("EnchantmentListener")) {
              try {
                  listenerClass.newInstance();
              } catch (Exception ex) {
                  ex.printStackTrace();
              }
          }
      }
  </code></pre>
  
  <p>This works perfectly fine, however, I'm getting this error when one of the classes is being instantiated:</p>
  
  <pre><code>[07:07:58] [Server thread/WARN]: java.lang.InstantiationException: cullan.listener.AgilityListener$1
      [07:07:58] [Server thread/WARN]:    at java.lang.Class.newInstance(Unknown Source)
      [07:07:58] [Server thread/WARN]:    at cullan.main.DCEnchants.loadEnchants(DCEnchants.java:62)
      [07:07:58] [Server thread/WARN]:    at cullan.main.DCEnchants.onEnable(DCEnchants.java:24)
      [07:07:58] [Server thread/WARN]:    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321)
      [07:07:58] [Server thread/WARN]:    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:340)
      [07:07:58] [Server thread/WARN]:    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405)
      [07:07:58] [Server thread/WARN]:    at net.skycraftmc.PluginManager.PluginManagerPlugin.onCommand(PluginManagerPlugin.java:287)
      [07:07:58] [Server thread/WARN]:    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
      [07:07:58] [Server thread/WARN]:    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141)
      [07:07:58] [Server thread/WARN]:    at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:646)
      [07:07:58] [Server thread/WARN]:    at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchServerCommand(CraftServer.java:632)
      [07:07:58] [Server thread/WARN]:    at net.minecraft.server.v1_8_R3.DedicatedServer.aO(DedicatedServer.java:409)
      [07:07:58] [Server thread/WARN]:    at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:373)
      [07:07:58] [Server thread/WARN]:    at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:709)
      [07:07:58] [Server thread/WARN]:    at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:612)
      [07:07:58] [Server thread/WARN]:    at java.lang.Thread.run(Unknown Source)
      [07:07:58] [Server thread/WARN]: Caused by: java.lang.NoSuchMethodException: cullan.listener.AgilityListener$1.&lt;init&gt;()
      [07:07:58] [Server thread/WARN]:    at java.lang.Class.getConstructor0(Unknown Source)
  </code></pre>
  
  <p>This is the class that is throwing the error:</p>
  
  <pre><code>    package cullan.listener;
  import cullan.type.EnchantmentRarity;
  import org.bukkit.enchantments.Enchantment;
  import org.bukkit.entity.Player;
  import org.bukkit.event.EventHandler;
  import org.bukkit.event.player.PlayerQuitEvent;
  import org.bukkit.inventory.ItemStack;
  import org.bukkit.potion.PotionEffect;
  
  import java.util.ArrayList;
  import java.util.List;
  
  public class AgilityListener extends EnchantmentListener{
  
      private List&lt;Player&gt; players = new ArrayList&lt;&gt;();
  
      public AgilityListener() {
          super(Enchantment.getByName("Agility"), EnchantmentRarity.VERY_RARE);
          startTimer();
      }
  
      @EventHandler
      public void onQuit(PlayerQuitEvent event) {
          Player player = event.getPlayer();
          if (players.contains(player)) {
              players.remove(player);
          }
      }
  
      private void startTimer() {
          final PotionEffect effect = mainConfig.getAgilityEffect();
          instance.getServer().getScheduler().scheduleSyncRepeatingTask(instance, new Runnable() {
              @Override
              public void run() {
                  for (Player player : instance.getServer().getOnlinePlayers()) {
                      ItemStack boots = player.getInventory().getBoots();
                      if (boots != null &amp;&amp; boots.containsEnchantment(enchantment)) {
                          player.addPotionEffect(effect);
                          players.add(player);
                      } else if (players.contains(player)) {
                          player.removePotionEffect(effect.getType());
                          players.remove(player);
                      }
                  }
              }
          }, 10L, 10L);
      }
  }
  </code></pre>
  
  <p>The error does not occur if I remove the startTimer() method. Why does this happen?</p>