@SuppressWarnings("unchecked")
@Override
public void write(Kryo kryo, Output output, T object) {
ObjectMap<Object, Object> garphContext = kryo.getGraphContext();
if (Boolean.FALSE.equals(garphContext.get(KryoSerializationPreferences.WRITE_INVOCATION_AFFILIATION_DATA))) {
Map<Long, MutableInt> temp = object.getInvocationsParentsIdMap();
object.setInvocationsParentsIdMap(Collections.<Long, MutableInt> emptyMap());
super.write(kryo, output, object);
object.setInvocationsParentsIdMap(temp);
} else {
super.write(kryo, output, object);
}
}
}