Add                if(Double.isNaN( item ))                 	rowAsList.set( j, 0 );                 else                 	...
Add
               if(Double.isNaN( item ))
                	rowAsList.set( j, 0 );
                else
                	...

because otherwise NaN will be set as the maximum value

ppavlidis/baseCode,ppavlidis/baseCode