@Override
  public Long getInteger( Object object ) throws KettleValueException {
    InetAddress address = getInternetAddress( object );
    if ( address == null ) {
      return null;
    }
    long total = 0L;
    byte[] addr = address.getAddress();

    if ( addr.length > 8 ) {
      throw new KettleValueException( "Unable to convert Internet Address v6 to an Integer: "
        + getString( object ) + " (The precision is too high to be contained in a long integer value)" );
    }

    for ( int i = 0; i < addr.length; i++ ) {
      total += ( addr[i] & 0xFF ) * ( (long) Math.pow( 256, ( addr.length - 1 - i ) ) );
    }

    return total;
  }
@Test
  public void testGetInteger_Success() throws UnknownHostException, KettleValueException {
    ValueMetaInternetAddress vm = new ValueMetaInternetAddress();
    String[] addresses = {
      // Some IPv4 addresses
      "192.168.10.0",
      "0.0.0.1",
      "0.0.0.0",
      "127.0.0.1",
      "255.255.0.10",
      "192.0.2.235"
    };

    // No exception should be thrown in any of the following calls
    for ( String address : addresses ) {
      InetAddress addr = InetAddress.getByName( address );
      vm.getInteger( addr );
    }
  }