Firebase getValue() not retrieving boolean correctly?
<p>I am having trouble with a firebase call that I want to compare if the value is simply true or false. Here is my attempt:</p>

<pre><code>   Firebase followingRef = currentUserPath.child("/following");
   followingRef.addChildEventListener(new ChildEventListener() {
        @Override
        public void onChildAdded(final DataSnapshot dataSnapshot, String s) {
            firebaseRef.child("people/" + dataSnapshot.getKey()).addListenerForSingleValueEvent(new ValueEventListener() {
                @Override
                public void onDataChange(DataSnapshot snapshot) {
                    Boolean isFollowing = (Boolean) dataSnapshot.getValue();
                    if(isFolloiwng) {
                        User user = snapshot.getValue(User.class);
                        user.setUserId(dataSnapshot.getKey());
                        application.getFollowingRecyclerViewAdapter().add(user, application.getFollowingRecyclerViewAdapter());
                    }
                }

                @Override
                public void onCancelled(FirebaseError firebaseError) {

                }
            });
        }
    ...//OnChildChanged,Moved,etc... no code in here
</code></pre>

<p>At the path I want to reference in <code>currentUserPath.child("following");</code> it looks like this:</p>

<p>EDIT: Replace Picture with actual JSON:</p>

<pre><code> "users" : {
    "10206287838487450" : {
      "following" : {
        "10208425049208936" : true,
        "107214969710378" : false,
        "1789986447904975" : true
      },
      "id" : "ae80f030-dea0-4909-944f-0e490847b6ab",
      "name" : "Stephen",
      "posts" : {
        "-KN_oJAgTNJHwJbqY3qk" : true,
        "-KN_oN9_Xmw5ULnBRYM7" : true,
        "-KN_obYGug9Tdrzufbqc" : true,
        "-KNefMk2nX0sOsUx0btx" : true
      },
      "userId" : "10206287838487450"
    },

  "people" : {
    "10206287838487450" : {
      "id" : "9e7ee838-a60a-4588-bc1c-93b98f74356d",
      "name" : "Bob",
      "userId" : "10206287838487450"
    },
    "10208425049208936" : {
      "id" : "fe6f97e3-0efb-4afb-a322-a1c586f75fb7",
      "name" : "Jack",
      "userId" : "10208425049208936"
    },
    "107214969710378" : {
      "id" : "ae80f030-dea0-4909-944f-0e490847b6ab",
      "name" : "Rick",
      "userId" : "107214969710378"
    },
    "108421236267392" : {
      "id" : "c72b35d9-380b-4552-8b05-7426d378fa14",
      "name" : "Tommy",
      "userId" : "108421236267392"
    },
    "1112460595485164" : {
      "id" : "383692f0-0aba-4d29-afb8-80beefe678c6",
      "name" : "Stanley",
      "userId" : "1112460595485164"
    },
    "1789986447904975" : {
      "id" : "1ae43255-c040-4b1e-959e-fcdf03e13a45",
      "name" : "Link",
      "userId" : "1789986447904975"
    }
  },
</code></pre>

<p>I'm very confused because every time I try to cast the <code>dataSnapshot.getValue()</code> to a Boolean, I always get <code>isFollowing = true</code> which is clearly  not correct because in my data, there is only 2 values that are true as seen above, not all 3.  The confusing thing is how come I can't retrieve the <code>Boolean</code> correctly. I have tried to do <code>Boolean isFollowing = (Boolean) dataSnapshot.getValue(Boolean.class)</code> also but this doesn't work. The Firebase documentation says that when retrieving data, a <code>Boolean</code> can be a type of data we can retrieve but I can't seem to retrieve it correctly. Any help would be appreciated. Thanks! </p>