title: Circular reference issue with JSON-B
body: <p>I have two classes that reference each other. When I try to serialize the classes to Json I get a circular reference error. Can any one tell me how to correct this?</p>
  
  <p>I have a Folder class with a list of passwords:</p>
  
  <pre><code>public class Folder {
  
      private List&lt;Password&gt; items = new ArrayList&lt;&gt;();
      private String name;
  
      public Folder(String name) {
          this.name = name;
      }
  
      public void add(Password password) {
          items.add(password);
      }
  
      public List&lt;Password&gt; getItems() {
          return items;
      }
  
      public void setItems(List&lt;Password&gt; items) {
          this.items = items;
      }
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }       
  }
  </code></pre>
  
  <p>Then I have a Password class that references back to the Folder class:</p>
  
  <pre><code>public class Password {
  
      private String name;
      private Folder mFolder;
  
      public Password(String name, Folder folder) {
          this.name = name;
          folder.add(this);
          mFolder = folder;       
      }
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
      public Folder getmFolder() {
          return mFolder;
      }
  
      public void setmFolder(Folder mFolder) {
          this.mFolder = mFolder;
      }    
  }
  </code></pre>
  
  <p>and finally the Main class:</p>
  
  <pre><code>public class Main {
  
      public static void main(String[] args) throws IOException {
  
          Password password = new Password("Password", new Folder("Folder"));
  
          Jsonb jsonb = JsonbBuilder.create();        
          try (Writer writer = new StringWriter()) {          
              jsonb.toJson(password, writer);
              System.out.println(writer.toString());
          }
      }    
  }
  </code></pre>
  
  <p>The get the following exception:</p>
  
  <pre><code>at org.eclipse.yasson.internal.serializer.AbstractContainerSerializer.serialize(AbstractContainerSerializer.java:60)
      at org.eclipse.yasson.internal.serializer.AbstractContainerSerializer.serializerCaptor(AbstractContainerSerializer.java:91)
      at org.eclipse.yasson.internal.serializer.CollectionSerializer.serializeInternal(CollectionSerializer.java:76)
      at org.eclipse.yasson.internal.serializer.CollectionSerializer.serializeInternal(CollectionSerializer.java:35)
      at org.eclipse.yasson.internal.serializer.AbstractContainerSerializer.serialize(AbstractContainerSerializer.java:60)
      at org.eclipse.yasson.internal.serializer.AbstractContainerSerializer.serializerCaptor(AbstractContainerSerializer.java:91)
      at org.eclipse.yasson.internal.serializer.ObjectSerializer.marshallProperty(ObjectSerializer.java:92)
      at org.eclipse.yasson.internal.serializer.ObjectSerializer.serializeInternal(ObjectSerializer.java:59)
  </code></pre>