@Override
  public int compare( Object data1, Object data2 ) throws KettleValueException {
    InetAddress inet1 = getInternetAddress( data1 );
    InetAddress inet2 = getInternetAddress( data2 );
    int cmp = 0;
    if ( inet1 == null ) {
      if ( inet2 == null ) {
        cmp = 0;
      } else {
        cmp = -1;
      }
    } else if ( inet2 == null ) {
      cmp = 1;
    } else {
      BigDecimal bd1 = getBigNumber( inet1 );
      BigDecimal bd2 = getBigNumber( inet2 );
      cmp = bd1.compareTo( bd2 );
    }
    if ( isSortedDescending() ) {
      return -cmp;
    } else {
      return cmp;
    }
  }
@Test
  public void testCompare_PDI17270() throws UnknownHostException, KettleValueException {
    ValueMetaInternetAddress vm = new ValueMetaInternetAddress();

    InetAddress smaller = InetAddress.getByName( "0.0.0.0" );
    InetAddress larger = InetAddress.getByName( "255.250.200.128" );
    assertEquals( -1, vm.compare( smaller, larger ) );
    assertEquals( 1, vm.compare( larger, smaller ) );

    smaller = InetAddress.getByName( "0.0.0.0" );
    larger = InetAddress.getByName( "192.168.10.0" );
    assertEquals( -1, vm.compare( smaller, larger ) );
    assertEquals( 1, vm.compare( larger, smaller ) );

    smaller = InetAddress.getByName( "192.168.10.0" );
    larger = InetAddress.getByName( "255.250.200.128" );
    assertEquals( -1, vm.compare( smaller, larger ) );
    assertEquals( 1, vm.compare( larger, smaller ) );
  }