@Test public void testCopyFrom() { BooleanBag bag0, bag1; boolean e0 = true, e1 = true, e2 = true, e3 = true; bag0 = new BooleanBag(); bag0.set(0, e0); bag0.set(3, e1); bag0.set(9, e2); bag1 = new BooleanBag(); bag1.copyFrom(bag0); assertEquals((Boolean) e0, (Boolean) bag1.get(0)); assertEquals((Boolean) e1, (Boolean) bag1.get(3)); assertEquals((Boolean) e2, (Boolean) bag1.get(9)); bag1 = new BooleanBag(); bag1.set(53, e3); bag1.copyFrom(bag0, false); assertEquals((Boolean) e0, (Boolean) bag1.get(0)); assertEquals((Boolean) e1, (Boolean) bag1.get(3)); assertEquals((Boolean) e2, (Boolean) bag1.get(9)); assertEquals((Boolean) e3, (Boolean) bag1.get(53)); bag1 = new BooleanBag(); bag1.set(53, e3); bag1.copyFrom(bag0, true); assertEquals((Boolean) e0, (Boolean) bag1.get(0)); assertEquals((Boolean) e1, (Boolean) bag1.get(3)); assertEquals((Boolean) e2, (Boolean) bag1.get(9)); assertEquals((Boolean) false, (Boolean) bag1.get(53)); bag0 = new BooleanBag(); bag0.set(4, e0); bag0.set(7, e1); bag1 = new BooleanBag(); bag1.copyFrom(bag0, 3); assertEquals((Boolean) false, (Boolean) bag1.get(0)); assertEquals((Boolean) false, (Boolean) bag1.get(1)); assertEquals((Boolean) false, (Boolean) bag1.get(2)); assertEquals((Boolean) false, (Boolean) bag1.get(3)); assertEquals((Boolean) false, (Boolean) bag1.get(4)); assertEquals((Boolean) false, (Boolean) bag1.get(5)); assertEquals((Boolean) false, (Boolean) bag1.get(6)); assertEquals((Boolean) false, (Boolean) bag1.get(7)); bag1 = new BooleanBag(); bag1.copyFrom(bag0, 5); assertEquals((Boolean) false, (Boolean) bag1.get(0)); assertEquals((Boolean) false, (Boolean) bag1.get(1)); assertEquals((Boolean) false, (Boolean) bag1.get(2)); assertEquals((Boolean) false, (Boolean) bag1.get(3)); assertEquals((Boolean) e0, (Boolean) bag1.get(4)); assertEquals((Boolean) false, (Boolean) bag1.get(5)); assertEquals((Boolean) false, (Boolean) bag1.get(6)); assertEquals((Boolean) false, (Boolean) bag1.get(7)); bag1 = new BooleanBag(); bag1.set(8, e2); bag1.copyFrom(bag0, 8, true); assertEquals((Boolean) false, (Boolean) bag1.get(0)); assertEquals((Boolean) false, (Boolean) bag1.get(1)); assertEquals((Boolean) false, (Boolean) bag1.get(2)); assertEquals((Boolean) false, (Boolean) bag1.get(3)); assertEquals((Boolean) e0, (Boolean) bag1.get(4)); assertEquals((Boolean) false, (Boolean) bag1.get(5)); assertEquals((Boolean) false, (Boolean) bag1.get(6)); assertEquals((Boolean) e1, (Boolean) bag1.get(7)); assertEquals((Boolean) false, (Boolean) bag1.get(8)); assertEquals((Boolean) false, (Boolean) bag1.get(9)); bag0 = new BooleanBag(); bag0.set(0, e0); bag0.set(4, e1); bag0.set(6, e2); bag1 = new BooleanBag(); bag1.copyFrom(bag0, 3, 2); assertEquals((Boolean) false, (Boolean) bag1.get(0)); assertEquals((Boolean) e1, (Boolean) bag1.get(1)); assertEquals((Boolean) false, (Boolean) bag1.get(2)); assertEquals((Boolean) false, (Boolean) bag1.get(3)); assertEquals((Boolean) false, (Boolean) bag1.get(4)); assertEquals((Boolean) false, (Boolean) bag1.get(5)); assertEquals((Boolean) false, (Boolean) bag1.get(6)); assertEquals((Boolean) false, (Boolean) bag1.get(7)); assertEquals((Boolean) false, (Boolean) bag1.get(8)); bag0 = new BooleanBag(); bag0.set(0, e0); bag0.set(4, e1); bag0.set(10, e2); bag1 = new BooleanBag(); bag1.set(7, e3); bag1.copyFrom(bag0, 3, 2, false); assertEquals((Boolean) false, (Boolean) bag1.get(0)); assertEquals((Boolean) e1, (Boolean) bag1.get(1)); assertEquals((Boolean) false, (Boolean) bag1.get(2)); assertEquals((Boolean) false, (Boolean) bag1.get(3)); assertEquals((Boolean) false, (Boolean) bag1.get(4)); assertEquals((Boolean) false, (Boolean) bag1.get(5)); assertEquals((Boolean) false, (Boolean) bag1.get(6)); assertEquals((Boolean) e3, (Boolean) bag1.get(7)); assertEquals((Boolean) false, (Boolean) bag1.get(8)); assertEquals((Boolean) false, (Boolean) bag1.get(9)); assertEquals((Boolean) false, (Boolean) bag1.get(10)); }
@Override public void copyFrom(BooleanBag from) { copyFrom(from, true); }
BooleanBag implements AnyBag<BooleanBag> { @Override public void copyFrom(BooleanBag from) { copyFrom(from, true); } }
BooleanBag implements AnyBag<BooleanBag> { @Override public void copyFrom(BooleanBag from) { copyFrom(from, true); } BooleanBag(); }
BooleanBag implements AnyBag<BooleanBag> { @Override public void copyFrom(BooleanBag from) { copyFrom(from, true); } BooleanBag(); @Override void copyFrom(BooleanBag from); @Override void copyFrom(BooleanBag from, boolean clearExceeding); @Override void copyFrom(BooleanBag from, int length); @Override void copyFrom(BooleanBag from, int length, boolean clearExceeding); @Override void copyFrom(BooleanBag from, int fromOffset, int length); @Override void copyFrom(BooleanBag from, int fromOffset, int length, boolean clearExceeding); @Override void copyPartFrom(BooleanBag from, int fromOffset, int toOffset, int length); @Override void ensureCapacity(int capacity); boolean get(int index); void set(int index, boolean value); @Override void clear(); @Override void clear(Mask mask); }
BooleanBag implements AnyBag<BooleanBag> { @Override public void copyFrom(BooleanBag from) { copyFrom(from, true); } BooleanBag(); @Override void copyFrom(BooleanBag from); @Override void copyFrom(BooleanBag from, boolean clearExceeding); @Override void copyFrom(BooleanBag from, int length); @Override void copyFrom(BooleanBag from, int length, boolean clearExceeding); @Override void copyFrom(BooleanBag from, int fromOffset, int length); @Override void copyFrom(BooleanBag from, int fromOffset, int length, boolean clearExceeding); @Override void copyPartFrom(BooleanBag from, int fromOffset, int toOffset, int length); @Override void ensureCapacity(int capacity); boolean get(int index); void set(int index, boolean value); @Override void clear(); @Override void clear(Mask mask); @Experimental
    public boolean[] buffer; }