### Question:
ThriftEventAdaptor extends Event { public static Priority convert(com.cloudera.flume.handlers.thrift.Priority p) { Preconditions.checkNotNull(p, "Prioirity argument must be valid."); switch (p) { case FATAL: return Priority.FATAL; case ERROR: return Priority.ERROR; case WARN: return Priority.WARN; case INFO: return Priority.INFO; case DEBUG: return Priority.DEBUG; case TRACE: return Priority.TRACE; default: throw new IllegalStateException("Unknown value " + p); } } ThriftEventAdaptor(ThriftFlumeEvent evt); @Override byte[] getBody(); @Override Priority getPriority(); @Override long getTimestamp(); static Priority convert(com.cloudera.flume.handlers.thrift.Priority p); static com.cloudera.flume.handlers.thrift.Priority convert(Priority p); @Override String toString(); @Override long getNanos(); @Override String getHost(); static ThriftFlumeEvent convert(Event e); @Override byte[] get(String attr); @Override Map<String, byte[]> getAttrs(); @Override void set(String attr, byte[] vArray); @Override void hierarchicalMerge(String prefix, Event e); @Override void merge(Event e);  }### Answer:
@Test public void testConvert() { ThriftFlumeEvent thriftEvent = ThriftEventAdaptor.convert(testEvent); Assert.assertNotNull(thriftEvent); Assert.assertNotNull(thriftEvent.host); Assert.assertNotNull(thriftEvent.timestamp); Assert.assertNotNull(thriftEvent.fields); Assert.assertNotNull(thriftEvent.priority); for (Entry<String, byte[]> entry : testEvent.getAttrs().entrySet()) { Assert.assertTrue(thriftEvent.fields.containsKey(entry.getKey())); Assert.assertTrue(Arrays.equals(thriftEvent.fields.get(entry.getKey()) .array(), entry.getValue())); } }