Source:
public void testLossyOption() throws IOException, IllegalAccessException, InstantiationException { Encoder<List<Long>> encoder = SummingArrayCombiner.VarLongArrayEncoder.class.newInstance(); TreeMap<Key,Value> tm1 = new TreeMap<>(); tm1.put(newKey(1, 1, 1, 1, false), new Value("badValue")); newKeyValue(tm1, 1, 1, 1, 2, false, nal(3l, 4l, 5l), encoder); newKeyValue(tm1, 1, 1, 1, 3, false, nal(), encoder); SummingArrayCombiner summingArrayCombiner = new SummingArrayCombiner(); IteratorSetting iteratorSetting = new IteratorSetting(1, SummingArrayCombiner.class); SummingArrayCombiner.setEncodingType(iteratorSetting, SummingArrayCombiner.Type.VARLEN); Combiner.setColumns(iteratorSetting, Collections.singletonList(new IteratorSetting.Column("cf001"))); TypedValueCombiner.setLossyness(iteratorSetting, true); assertTrue(summingArrayCombiner.validateOptions(iteratorSetting.getOptions())); summingArrayCombiner.init(new SortedMapIterator(tm1), iteratorSetting.getOptions(), SCAN_IE); summingArrayCombiner.seek(new Range(), EMPTY_COL_FAMS, false); assertTrue(summingArrayCombiner.hasTop()); assertEquals(newKey(1, 1, 1, 3), summingArrayCombiner.getTopKey()); assertBytesEqual(encoder.encode(nal(3l, 4l, 5l)), summingArrayCombiner.getTopValue().get()); summingArrayCombiner.next(); assertFalse(summingArrayCombiner.hasTop()); TypedValueCombiner.setLossyness(iteratorSetting, false); assertTrue(summingArrayCombiner.validateOptions(iteratorSetting.getOptions())); summingArrayCombiner.init(new SortedMapIterator(tm1), iteratorSetting.getOptions(), SCAN_IE); try { summingArrayCombiner.seek(new Range(), EMPTY_COL_FAMS, false); Assert.fail("ValueFormatException should have been thrown"); } catch (ValueFormatException e) }

Target:
public void testLossyOption() throws IOException, IllegalAccessException, InstantiationException { Encoder<List<Long>> encoder = new SummingArrayCombiner.VarLongArrayEncoder(); TreeMap<Key,Value> tm1 = new TreeMap<>(); tm1.put(newKey(1, 1, 1, 1, false), new Value("badValue")); newKeyValue(tm1, 1, 1, 1, 2, false, nal(3l, 4l, 5l), encoder); newKeyValue(tm1, 1, 1, 1, 3, false, nal(), encoder); SummingArrayCombiner summingArrayCombiner = new SummingArrayCombiner(); IteratorSetting iteratorSetting = new IteratorSetting(1, SummingArrayCombiner.class); SummingArrayCombiner.setEncodingType(iteratorSetting, SummingArrayCombiner.Type.VARLEN); Combiner.setColumns(iteratorSetting, Collections.singletonList(new IteratorSetting.Column("cf001"))); TypedValueCombiner.setLossyness(iteratorSetting, true); assertTrue(summingArrayCombiner.validateOptions(iteratorSetting.getOptions())); summingArrayCombiner.init(new SortedMapIterator(tm1), iteratorSetting.getOptions(), SCAN_IE); summingArrayCombiner.seek(new Range(), EMPTY_COL_FAMS, false); assertTrue(summingArrayCombiner.hasTop()); assertEquals(newKey(1, 1, 1, 3), summingArrayCombiner.getTopKey()); assertBytesEqual(encoder.encode(nal(3l, 4l, 5l)), summingArrayCombiner.getTopValue().get()); summingArrayCombiner.next(); assertFalse(summingArrayCombiner.hasTop()); TypedValueCombiner.setLossyness(iteratorSetting, false); assertTrue(summingArrayCombiner.validateOptions(iteratorSetting.getOptions())); summingArrayCombiner.init(new SortedMapIterator(tm1), iteratorSetting.getOptions(), SCAN_IE); try { summingArrayCombiner.seek(new Range(), EMPTY_COL_FAMS, false); Assert.fail("ValueFormatException should have been thrown"); } catch (ValueFormatException e) }