Address PR comments: fix cast, make variable public static final, fix histogram equals
Adding serialized histogram
Fix test to use MAX_BIN_SIZE
merge from upstream. Fixed small confluxed in HistogramRollupTest.java.