### Question:
ThriftCacheValue { public T getValue(Class<T> clazz) throws BlurException { if (_data == null) { return null; } try { T t = clazz.newInstance(); t.read(new TCompactProtocol(new TMemoryInputTransport(_data))); return t; } catch (InstantiationException e) { throw new BException("Unknown error while trying to read from cache.", e); } catch (IllegalAccessException e) { throw new BException("Unknown error while trying to read from cache.", e); } catch (TException e) { throw new BException("Unknown error while trying to read from cache.", e); } } ThriftCacheValue(T t); static byte[] toBytes(T t); static byte[] trim(byte[] bs, int len); int size(); T getValue(Class<T> clazz); @Override int hashCode(); @Override boolean equals(Object obj);  }### Answer:
@Test public void test1() throws BlurException { ThriftCacheValue<BlurResults> thriftCacheValue = new ThriftCacheValue<BlurResults>(null); BlurResults results = thriftCacheValue.getValue(BlurResults.class); assertNull(results); }
@Test public void test2() throws BlurException { BlurResults blurResults = new BlurResults(); ThriftCacheValue<BlurResults> thriftCacheValue = new ThriftCacheValue<BlurResults>(blurResults); BlurResults results = thriftCacheValue.getValue(BlurResults.class); assertNotNull(results); assertEquals(blurResults, results); }