Perhaps, Java is casting the primitive value 2258974152221 in your IF/ELSE into a Long wrapper object which makes "==" an object reference comparison not a value comparison.
Not clear to me why you cannot just treat both values as string -- assuming 'variable' in your code snippet is an input request element which is probably already a string. For example,
if ( "2258974152221".equals( variable.toString() ) )
return true;
If you feel as though you must use long types, is it possible to use the Long wrapper object rather than the primitive and do what amounts to a string compare. For example,
Long long1 = Long.valueOf( "2258974152221" );
Long var1 = Long.valueOf( variable.toString() );
if ( long1.toString().equals( var1.toString() ) )
return true;