title: The method is undefined for the type T
body: <p>I am trying this example, but can't make it work; it throws <code>The method getFromInt(int) is undefined for the type T</code></p>
  
  <p><code>T</code> is a generic enum type</p>
  
  <pre><code>public static &lt;T&gt; T deserializeEnumeration(InputStream inputStream) {
          int asInt = deserializeInt(inputStream);
          T deserializeObject = T.getFromInt(asInt);
          return deserializeObject;
      }
  </code></pre>
  
  <p>am calling the previous method as follows for example:</p>
  
  <pre><code>objectToDeserialize.setUnit(InputStreamUtil.&lt;Unit&gt;deserializeEnumeration(inputStream));
  </code></pre>
  
  <p>or</p>
  
  <pre><code>objectToDeserialize.setShuntCompensatorType(InputStreamUtil.&lt;ShuntCompensatorType&gt;deserializeEnumeration(inputStream));
  </code></pre>
  
  <p>or etc...</p>