public static long toLong( String str, long def ) {
    long retval;
    if ( str == null ) {
      retval = def;
    } else {
      try {
        retval = Long.parseLong( str );
      } catch ( Exception e ) {
        retval = def;
      }
    }
    return retval;
  }
@Test
  public void testToLong() {
    assertEquals( 1447252914241L, Const.toLong( "1447252914241", -12 ) );
    assertEquals( -1447252914241L, Const.toLong( "1447252914241L", -1447252914241L ) );
    assertEquals( -1447252914241L, Const.toLong( "", -1447252914241L ) );
    assertEquals( -1447252914241L, Const.toLong( null, -1447252914241L ) );
  }