title: Java Enum Returns Null
body: <p>I am currently creating a plugin for Minecraft using the SpigotAPI. Reason I'm posting this here is because this I believe is a Java error. I am creating a duels plugin where inside my code it'll loop through an enum, and see if it's a specific type. The first time using it around it properly works, no problems. But when I try it for a second time without restarting my plugin/program/code it'll return the enum as null. Here is the code, is there a fix to this?</p>
  
  <pre><code>public DuelArenas[] getArenasWithType(DuelTypes type) {
      String suffix = "_NORMAL";
      List&lt;DuelArenas&gt; arenasAsList = new ArrayList&lt;&gt;();
      switch (type) {
          case NORMAL:
              suffix = "_NORMAL";
              break;
      }
      for (DuelArenas arena : duelArenaStatus.keySet()) {
          if (arena.toString().endsWith(suffix)) {
              arenasAsList.add(arena);
          }
      }
      DuelArenas[] arenas = new DuelArenas[arenasAsList.size()];
      return arenasAsList.toArray(arenas);
  }
  </code></pre>
  
  <p>Stacktrace:</p>
  
  <pre><code>Caused by: java.lang.NullPointerException
      at me.nick.acore.duels.DuelsAPI.getArenasWithType(DuelsAPI.java:97) ~[?:?]
  </code></pre>
  
  <p>And yes I've checked to see if the enum was null, and it was in fact null. Also line 97 is </p>
  
  <pre><code>if (arena.toString().endsWith(suffix)) {
  </code></pre>
  
  <p>And finally here is the DuelArena class</p>
  
  <pre><code>public enum DuelArenas {
  
  ARENA_1_NORMAL, ARENA_2_NORMAL, ARENA_3_NORMAL, ARENA_4_NORMAL, ARENA_5_NORMAL,
  ARENA_6_NORMAL, ARENA_7_NORMAL, ARENA_8_NORMAL, ARENA_9_NORMAL, ARENA_10_NORMAL,
  ARENA_11_NORMAL, ARENA_12_NORMAL }
  </code></pre>
  
  <p>Thanks!</p>