Program: 32106
Project: 32106
Buggy source:
@Test public void numericalNormalizeTest(){
  ColumnConfig config=new ColumnConfig();
  config.setMean(2.0);
  config.setStdDev(1.0);
  config.setColumnType(ColumnType.N);
  ColumnBinning cbin=new ColumnBinning();
  cbin.setBinCountWoe(Arrays.asList(new Double[]{10.0,11.0,12.0,13.0,6.5}));
  cbin.setBinWeightedWoe(Arrays.asList(new Double[]{20.0,21.0,22.0,23.0,16.5}));
  cbin.setBinBoundary(Arrays.asList(new Double[]{Double.NEGATIVE_INFINITY,2.0,4.0,6.0}));
  config.setColumnBinning(cbin);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",4.0,NormType.ZSCALE),3.0);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",null,NormType.ZSCALE),3.0);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",4.0,NormType.ZSCALE),0.0);
  Assert.assertEquals(Normalizer.normalize(config,null,4.0,NormType.ZSCALE),0.0);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",4.0,NormType.OLD_ZSCALE),3.0);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",null,NormType.OLD_ZSCALE),3.0);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",4.0,NormType.OLD_ZSCALE),0.0);
  Assert.assertEquals(Normalizer.normalize(config,null,4.0,NormType.OLD_ZSCALE),0.0);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",null,NormType.WEIGHT_WOE),21.0);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",null,NormType.WEIGHT_WOE),16.5);
  Assert.assertEquals(Normalizer.normalize(config,null,null,NormType.WEIGHT_WOE),16.5);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",null,NormType.WOE),11.0);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",null,NormType.WOE),6.5);
  Assert.assertEquals(Normalizer.normalize(config,null,null,NormType.WOE),6.5);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",4.0,NormType.HYBRID),3.0);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",null,NormType.HYBRID),3.0);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",4.0,NormType.HYBRID),0.0);
  Assert.assertEquals(Normalizer.normalize(config,null,4.0,NormType.HYBRID),0.0);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",4.0,NormType.WEIGHT_HYBRID),3.0);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",null,NormType.WEIGHT_HYBRID),3.0);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",4.0,NormType.WEIGHT_HYBRID),0.0);
  Assert.assertEquals(Normalizer.normalize(config,null,4.0,NormType.WEIGHT_HYBRID),0.0);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",10.0,NormType.WOE_ZSCORE),0.2);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",12.0,NormType.WOE_ZSCORE),-1.6);
  Assert.assertEquals(Normalizer.normalize(config,null,12.0,NormType.WOE_ZSCORE),-1.6);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",20.0,NormType.WEIGHT_WOE_ZSCORE),0.2);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",22.0,NormType.WEIGHT_WOE_ZSCORE),-1.6);
  Assert.assertEquals(Normalizer.normalize(config,null,22.0,NormType.WEIGHT_WOE_ZSCORE),-1.6);
}

Fixed version (ground truth):
@Test public void numericalNormalizeTest(){
  ColumnConfig config=new ColumnConfig();
  config.setMean(2.0);
  config.setStdDev(1.0);
  config.setColumnType(ColumnType.N);
  ColumnBinning cbin=new ColumnBinning();
  cbin.setBinCountWoe(Arrays.asList(new Double[]{10.0,11.0,12.0,13.0,6.5}));
  cbin.setBinWeightedWoe(Arrays.asList(new Double[]{20.0,21.0,22.0,23.0,16.5}));
  cbin.setBinBoundary(Arrays.asList(new Double[]{Double.NEGATIVE_INFINITY,2.0,4.0,6.0}));
  cbin.setBinCountNeg(Arrays.asList(1,2,3,4,5));
  cbin.setBinCountPos(Arrays.asList(5,4,3,2,1));
  config.setColumnBinning(cbin);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",4.0,NormType.ZSCALE),3.0);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",null,NormType.ZSCALE),3.0);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",4.0,NormType.ZSCALE),0.0);
  Assert.assertEquals(Normalizer.normalize(config,null,4.0,NormType.ZSCALE),0.0);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",4.0,NormType.OLD_ZSCALE),3.0);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",null,NormType.OLD_ZSCALE),3.0);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",4.0,NormType.OLD_ZSCALE),0.0);
  Assert.assertEquals(Normalizer.normalize(config,null,4.0,NormType.OLD_ZSCALE),0.0);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",null,NormType.WEIGHT_WOE),21.0);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",null,NormType.WEIGHT_WOE),16.5);
  Assert.assertEquals(Normalizer.normalize(config,null,null,NormType.WEIGHT_WOE),16.5);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",null,NormType.WOE),11.0);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",null,NormType.WOE),6.5);
  Assert.assertEquals(Normalizer.normalize(config,null,null,NormType.WOE),6.5);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",4.0,NormType.HYBRID),3.0);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",null,NormType.HYBRID),3.0);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",4.0,NormType.HYBRID),0.0);
  Assert.assertEquals(Normalizer.normalize(config,null,4.0,NormType.HYBRID),0.0);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",4.0,NormType.WEIGHT_HYBRID),3.0);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",null,NormType.WEIGHT_HYBRID),3.0);
  Assert.assertEquals(Normalizer.normalize(config,"String_Node_Str",4.0,NormType.WEIGHT_HYBRID),0.0);
  Assert.assertEquals(Normalizer.normalize(config,null,4.0,NormType.WEIGHT_HYBRID),0.0);
}