### Question:
LazyHCatRecord extends HCatRecord { @Override public List<Object> getAll() { List<Object> r = new ArrayList<Object>(this.size()); for (int i = 0; i < this.size(); i++){ r.add(i, get(i)); } return r; } LazyHCatRecord(Object wrappedObject, ObjectInspector oi); @Override Object get(int fieldNum); @Override List<Object> getAll(); @Override void set(int fieldNum, Object value); @Override int size(); @Override void readFields(DataInput in); @Override void write(DataOutput out); @Override Object get(String fieldName, HCatSchema recordSchema); @Override void set(String fieldName, HCatSchema recordSchema, Object value); @Override void remove(int idx); @Override void copy(HCatRecord r); @Override String toString(); HCatRecord getWritable(); static final Logger LOG; }### Answer:
@Test public void testGetAll() throws Exception { HCatRecord r = new LazyHCatRecord(getHCatRecord(), getObjectInspector()); List<Object> list = r.getAll(); Assert.assertEquals(INT_CONST, ((Integer) list.get(0)).intValue()); Assert.assertEquals(LONG_CONST, ((Long) list.get(1)).longValue()); Assert.assertEquals(DOUBLE_CONST, ((Double) list.get(2)).doubleValue(), 0); Assert.assertEquals(STRING_CONST, (String) list.get(3)); }
@Test public void testGetAll() throws Exception { HCatRecord r = new LazyHCatRecord(getHCatRecord(), getObjectInspector()); List<Object> list = r.getAll(); Assert.assertEquals(INT_CONST, ((Integer) list.get(0)).intValue()); Assert.assertEquals(LONG_CONST, ((Long) list.get(1)).longValue()); Assert.assertEquals(DOUBLE_CONST, ((Double) list.get(2)).doubleValue(), 0); Assert.assertEquals(STRING_CONST, list.get(3)); }