code: private static boolean isDouble( Number n ) {
        if( n instanceof Double ){
           return true;
        }
        try{
           double d = Double.parseDouble( String.valueOf( n ) );
           return !Double.isInfinite( d );
        }catch( NumberFormatException e ){
           return false;
        }
     }
docs: Finds out if n represents a Double.
  
  @return true if n is instanceOf Double or the literal value can be
  evaluated as a Double.