### Question:
LazyHCatRecord extends HCatRecord { @Override public void copy(HCatRecord r) throws HCatException { throw new UnsupportedOperationException("not allowed to run copy() on LazyHCatRecord"); } 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 testCopy() throws Exception { HCatRecord r = new LazyHCatRecord(getHCatRecord(), getObjectInspector()); boolean sawException = false; try { r.copy(null); } catch (UnsupportedOperationException uoe) { sawException = true; } Assert.assertTrue(sawException); }