private static @Nullable ListSelection<Change> getListSelection(@NotNull DataSnapshot snapshot) {
    Change[] selectedChanges = snapshot.get(SELECTED_CHANGES);
    if (selectedChanges != null) {
      return ListSelection.createAt(Arrays.asList(selectedChanges), 0).asExplicitSelection();
    }

    Change[] changes = snapshot.get(CHANGES);
    if (changes != null) {
      return ListSelection.createAt(Arrays.asList(changes), 0);
    }

    return null;
  }
private static @Nullable ListSelection<Change> getListSelection(@NotNull DataSnapshot snapshot)