OpenedValueStoreImpl implements OpenedValueStore<AuthT, OpenT> { @Override public Pair<List<AuthT>, List<OpenT>> popValues() { List<AuthT> tempSharesWithMacs = sharesWithMacs; List<OpenT> tempOpenedValues = openValues; sharesWithMacs = new ArrayList<>(); openValues = new ArrayList<>(); return new Pair<>(tempSharesWithMacs, tempOpenedValues); } OpenedValueStoreImpl(); @Override void pushOpenedValues(List<AuthT> newSharesWithMacs, List<OpenT> newOpenedValues); @Override void pushOpenedValue(AuthT newShareWithMac, OpenT newOpenedValue); @Override Pair<List<AuthT>, List<OpenT>> popValues(); @Override boolean hasPendingValues(); @Override boolean exceedsThreshold(int threshold);  }
@Test public void testPopValues() { OpenedValueStore<BigInteger, BigInteger> store = new OpenedValueStoreImpl<>(); store.pushOpenedValue(authenticated, open); store.pushOpenedValue(authenticated, open); Pair<List<BigInteger>, List<BigInteger>> both = store.popValues(); List<BigInteger> first = both.getFirst(); Assert.assertEquals(2, first.size()); List<BigInteger> second = both.getSecond(); Assert.assertEquals(2, second.size()); Assert.assertEquals(authenticated, first.get(0)); Assert.assertEquals(authenticated, first.get(1)); Assert.assertEquals(open, second.get(0)); Assert.assertEquals(open, second.get(1)); Assert.assertFalse("Store not expected to have pending values", store.hasPendingValues()); }