title: Android function returns NULL while on firebase onDataChange shows it is not null
body: <p>I try to get values from Firebase and add it into the list. I do it the following way:</p>
  
  <pre><code>ArrayList&lt;Category&gt; categoriesList;
  
      public ArrayList&lt;Category&gt; getCategoryListFromFirebase() {
          Firebase firebase = new Firebase(Constants.FIREBASE_URL).child("categories");
          categoriesList = new ArrayList&lt;&gt;();
          firebase.addValueEventListener(new ValueEventListener() {
              @Override
              public void onDataChange(DataSnapshot dataSnapshot) {
                  for (DataSnapshot categories : dataSnapshot.getChildren()) {
                      Category cat = categories.getValue(Category.class);
                      categoriesList.add(cat);
                  }
              }
              @Override
              public void onCancelled(FirebaseError firebaseError) {
              }
          });
          return categoriesList;
      }
  </code></pre>
  
  <p>Function returns categoriesList null, but in a loop it shows it is adding object to categoriesList.</p>
  
  <p>How this can be solved?
  Thanks ))</p>