title: com.google.firebase.database.DatabaseException: Serializing Arrays is not supported, please use Lists instead
body: <p>I am trying to persist a custom object using the following code:</p>
  
  <pre><code>DatabaseReference databaseReference = FirebaseDatabase.getInstance().getReference();
  DatabaseReference curWorkoutExercisesRef = databaseReference.child("workouts")
              .child(mCurrentWorkout.getId())
              .child("workoutExercises");
  
  WorkoutExercise we = new WorkoutExercise(exercise);
  curWorkoutExercisesRef.push().setValue(we);
  </code></pre>
  
  <p>Here's my object:</p>
  
  <pre><code>public class WorkoutExercise {
  
      private String id;
      private Exercise exercise;
  
      public WorkoutExercise() {}
  
      // getters, setters, other methods 
      // ...
  }
  
  public class Exercise {
  
      private String id;
      private String title;
  
      private List&lt;BodyPart&gt; bodyParts;
  
      public Exercise() {}
  
      // getters, setters, other methods 
      // ...
  }
  
  public class BodyPart {
  
      private String id;
      private String name;
  
      public BodyPart() {}
  
      // getters, setters, other methods 
      // ...
  }
  </code></pre>
  
  <p>And every time I am getting this error - <code>com.google.firebase.database.DatabaseException: Serializing Arrays is not supported, please use Lists instead</code>. My objects don't contain any arrays so this error looks quite confusing. I found a way to fix this error - everything works fine if I add the <code>@Exclude</code> annotation to the <code>bodyParts</code> list from my <code>Exercise</code> class but it is obviously not what I am trying to achieve. </p>
  
  <p>So seems that Firebase is unable to persist objects containing inner lists? Are there any straightforward workarounds or best practices here? Thanks! </p>
  
  <p>P.S. I am using <code>firebase-database:9.2.1</code></p>