docs: private void writeObject(ObjectOutputStream out) throws IOException {
          final boolean trace = TraceComponent.isAnyTracingEnabled();
          if (trace && tc.isEntryEnabled())
              Tr.entry(this, tc, "writeObject",
                       new Object[] { "caller/invocation subjects:", callerSubject, invocationSubject, "jaasLoginContextEntry:", jaasLoginContextEntry });
  
          PutField fields = out.putFields();
  
          if (callerSubject != null && !subjectHelper.isUnauthenticated(callerSubject)) {
              fields.put(CALLER_PRINCIPAL, getWSPrincipal(callerSubject));
          }
  
          subjectsAreEqual = areSubjectsEqual(callerSubject, invocationSubject);
          fields.put(SUBJECTS_ARE_EQUAL, subjectsAreEqual);
  
          //only serialize invocation principal if it's different from the caller
          if (!subjectsAreEqual) {
              if (invocationSubject != null && !subjectHelper.isUnauthenticated(invocationSubject)) {
                  fields.put(INVOCATION_PRINCIPAL, getWSPrincipal(invocationSubject));
              }
          }
  
          if (jaasLoginContextEntry != null) {
              fields.put(JAAS_LOGIN_CONTEXT, jaasLoginContextEntry);
          }
  
          // Serialize Subject Cache key
          try {
              serializeSubjectCacheKey(fields);
          } catch (Exception e) {
              if (tc.isDebugEnabled())
                  Tr.debug(tc, "Unable to serialize Subject Cache Key: " + e.getMessage());
              if (tc.isWarningEnabled())
                  Tr.warning(tc, SEC_CONTEXT_UNABLE_TO_SERIALIZE);
          }
  
          out.writeFields();
  
          if (trace && tc.isEntryEnabled())
              Tr.exit(this, tc, "writeObject", new Object[] { "subjects are equal: ", subjectsAreEqual });
      }