title: Cast a Java Object to Integer
body: <p>Error shown from the below code is: Cannot Cast an object to integer. I don't know what else will i include to cast it.</p>
  
  <pre><code>private RowFilter filter(final int itemsPerPage,final int target) {
          return new RowFilter() {
              public boolean include(Entry entry) {
  
                  /* HERE I AM RECEIVING ERROR: Multiple markers at this line
                  - Type mismatch: cannot convert from  Object to int
                  - Cannot cast from Object to int */
                  int ei = (int) entry.getIdentifier();
  
                  return (target * itemsPerPage &lt;= ei &amp;&amp; ei &lt; target
                          * itemsPerPage + itemsPerPage);
              }
          };
      }
  </code></pre>