code: public SoyMsgBundle compact(SoyMsgBundle input) {
      ImmutableList.Builder<SoyMsg> builder = ImmutableList.builder();
      for (SoyMsg msg : input) {
        ImmutableList<SoyMsgPart> parts = compactParts(msg.getParts());
        builder.add(
            SoyMsg.builder()
                .setId(msg.getId())
                .setLocaleString(msg.getLocaleString())
                .setIsPlrselMsg(MsgPartUtils.hasPlrselPart(parts))
                .setParts(parts)
                .build());
      }
      return new RenderOnlySoyMsgBundleImpl(input.getLocaleString(), builder.build());
    }
docs: Returns a more memory-efficient version of the internal message bundle.
  
  <p>Only enough information is retained for rendering; not enough for message extraction. As a
  side effect, this SoyMsgBundleCompactor instance will also retain references to parts of the
  messages in order to reuse identical objects.