title: Empty row in Excel
body: <p>I have a excel sheet with 5 records, I have to add only first 4 cell in a row to the List of object and ignore rest of the cells. If the first 4 cell are empty or blank  then I need to ignore that row and did not add into object.The catch is there are some records where in row first 4 cell are empty but after that cell have some value. I don't want to include those rows in the object. I have tried to put a piece of code:</p>
  
  <pre><code>public static boolean isRowEmpty(Row row){
           for(int c = row.getFirstCellNum(); c&lt;row.getLastCellNum();c++){
               Cell cell = row.getCell(c);
               if(cell!=null &amp;&amp; cell.getCellType()!=Cell.CELL_TYPE_BLANK){
                   return false;
               }
           }
           return true;
      }
  
  if(isRowEmpty(row)==false){
     compList.add(compItem);
  }
  </code></pre>
  
  <p>This piece of code works only when row is empty and isRowEmpty() method returns true. So far good, it didn't add value to the list. If the first 4 cell are blank and rest cell have value in a row, isRowEmpty() returns false and null value is set to list of object. Can somebody suggest me a solution to fix it?</p>