 <p>The problem is that you can only switch on one known type.</p> <p>In your case you are trying to switch across multiple possible types which is flawed in itself. (How can users be expect to add to your code here?)</p> <p>What you need is an interface</p> <pre><code>interface Sensor { void sense(); } enum PhoneSensor implements Sensor { A, B; @Override public void sense() { System.out.println(this); } } public &lt;E extends Enum&lt;E&gt; &amp; Sensor&gt; void registerSensor(EnumSet&lt;E&gt; eSet) { for (E e : eSet) { System.out.print("value is "); e.sense(); } } </code></pre> <p>This way users can add any enum which implements Sensor and they can do whatever they want without having to change your code.</p>