title: Add bound to class type parameter in method
body: <p>Is there any way how to make class type parameter more narrow (add another bound to it) in concrete method?</p>
  
  <p>Let's look at example</p>
  
  <pre><code>public class Value&lt;T&gt;
  {
      private final T value;
  
      public Value(T value)
      {
          this.value = value;
      }
  
      public &lt;V extends T&gt; boolean eq(V value)
      {
          return Objects.equals(this.value, value);
      }
  
      // here, I want to create bound that T extends Comparable&lt;T&gt;
      // error: type parameter cannot be followed by other bounds
      public &lt;V extends T &amp; Comparable&lt;T&gt;&gt; boolean gt(V value)
      {
          return ((V)this.value).compareTo(value) &gt; 0;
      }
  
      // here, I want to create bound that T extends String
      // error: interface expected here
      public &lt;V extends T &amp; String&gt; boolean match(V value)
      {
          return ((V)this.value).equalsIgnoreCase(value);
      }
  
      public static void main(final String[] args)
      {
          final Value&lt;Integer&gt; integerValue = new Value&lt;&gt;(10);
          integerValue.eq(10);           // should compile
          integerValue.gt(5);            // should compile
          integerValue.match("hello");   // shouldn't compile because match operates only on String values
  
          final Value&lt;String&gt; stringValue = new Value&lt;&gt;("Foo");
          stringValue.eq("Foo");         // should compile
          stringValue.gt("bar");         // should compile
          stringValue.match("foo");      // should compile
      }
  }
  </code></pre>
  
  <p>In this example line</p>
  
  <pre><code>integerValue.match("hello");
  </code></pre>
  
  <p>doesn't compile, which is correct, but the class can't be compile too due to restriction that <strong>type parameter cannot be followed by other bounds</strong></p>
  
  <p>Is there any other way how to achieve this?</p>