/*
 * Copyright 2015-16, Yahoo! Inc.
 * Licensed under the terms of the Apache License 2.0. See LICENSE file at the project root for terms.
 */
package com.yahoo.sketches.quantiles;

import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;

import org.testng.annotations.Test;

import com.yahoo.memory.Memory;
import com.yahoo.memory.NativeMemory;

public class DoublesUnionBuilderTest {

  @Test
  public void checkBuilds() {
    DoublesSketch qs1 = DoublesSketch.builder().build();
    for (int i=0; i<1000; i++) qs1.update(i);
    
    int bytes = qs1.getStorageBytes();
    Memory dstMem = new NativeMemory(new byte[bytes]);
    qs1.putMemory(dstMem);
    Memory srcMem = dstMem;
    
    DoublesUnionBuilder bldr = new DoublesUnionBuilder();
    bldr.setK(128);
    DoublesUnion union = bldr.build(); //virgin union
    
    union = DoublesUnionBuilder.build(srcMem);
    DoublesSketch qs2 = union.getResult();
    assertEquals(qs1.getStorageBytes(), qs2.getStorageBytes());
    
    union = DoublesUnionBuilder.copyBuild(qs2);
    DoublesSketch qs3 = union.getResult();
    assertEquals(qs2.getStorageBytes(), qs3.getStorageBytes());
    assertFalse(qs2 == qs3);
  }
  
  @Test
  public void printlnTest() {
    println("PRINTING: "+this.getClass().getName());
  }

  /**
   * @param s value to print 
   */
  static void println(String s) {
    //System.err.println(s); //disable here
  }
  
}

@@ -416,24 +416,59 @@
 Test %7B%0A%0A
+  @SuppressWarnings(%22deprecation%22)%0A
   @Test%0A
   public
@@ -451,32 +451,32 @@
 ation%22)%0A  @Test%0A
-
   public void ch
@@ -592,21 +592,17 @@
 ate(i);%0A
-    
 %0A
+
     int 
@@ -742,21 +742,17 @@
 dstMem;%0A
-    
 %0A
+
     Doub
@@ -875,21 +875,17 @@
 n union%0A
-    
 %0A
+
     unio
@@ -1034,13 +1034,9 @@
 ));%0A
-    
 %0A
+
     
@@ -1219,19 +1219,17 @@
 3);%0A  %7D%0A
-  
 %0A
+
   @Test%0A
@@ -1350,17 +1350,16 @@
 to print
- 
 %0A   */%0A 
@@ -1439,13 +1439,11 @@
 ere%0A  %7D%0A
-  
 %0A%7D%0A

Add SuppressWarnings for deprecated method