code: private static boolean isLong( Number n ) {
        if( n instanceof Long ){
           return true;
        }
        try{
           Long.parseLong( String.valueOf( n ) );
           return true;
        }catch( NumberFormatException e ){
           return false;
        }
     }
docs: Finds out if n represents a Long.
  
  @return true if n is instanceOf Long or the literal value can be evaluated
  as a Long.