@Override
 public void write(Kryo kryo, Output output, MastershipTerm object) {
   kryo.writeClassAndObject(output, object.master());
   output.writeInt(object.termNumber());
 }
 @Override
 public MastershipTerm read(Kryo kryo, Input input, Class<MastershipTerm> type) {
   final NodeId node = (NodeId) kryo.readClassAndObject(input);
   final int term = input.readInt();
   return MastershipTerm.of(node, term);
 }