I have the following simple leaderboard app:

public class LeaderboardActivity extends AppCompatActivity {

    DrawerLayout drawerLayout;
    NavigationView navigationView;
    ActionBarDrawerToggle drawerToggle;
    private FirebaseAuth mAuth;
    private FirebaseFirestore db = FirebaseFirestore.getInstance();
    CollectionReference usersRef = db.collection("users");
    Query leaderboardQuery = usersRef.orderBy("score", Query.Direction.DESCENDING).limit(10);
    Query leaderboardLastest = usersRef.orderBy("score", Query.Direction.ASCENDING).limit(1);


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_leaderboard);

        mAuth = FirebaseAuth.getInstance();
        
        menuConfig();

        leaderboard();
    }

    //menu
    public void menuConfig() {
        drawerLayout = findViewById(R.id.drawer_layout);
        navigationView = findViewById(R.id.nav_view);
        drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, R.string.open, R.string.close);
        drawerLayout.addDrawerListener(drawerToggle);
        drawerToggle.syncState();
        Objects.requireNonNull(getSupportActionBar()).setDisplayHomeAsUpEnabled(true);
        navigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
            @Override
            public boolean onNavigationItemSelected(@NonNull MenuItem item) {
                int id = item.getItemId();
                navigationView.bringToFront();

                if (id == R.id.home) {
                    Toast.makeText(LeaderboardActivity.this, "Home pressed", Toast.LENGTH_SHORT).show();
                    Intent intent = new Intent(LeaderboardActivity.this, MainActivity.class);
                    startActivity(intent);
                } else if (id == R.id.leaderboard) {
                    Toast.makeText(LeaderboardActivity.this, "Contact pressed", Toast.LENGTH_SHORT).show();
                } else if (id == R.id.gallery) {
                    Toast.makeText(LeaderboardActivity.this, "Gallery pressed", Toast.LENGTH_SHORT).show();
                } else if (id == R.id.about) {
                    Toast.makeText(LeaderboardActivity.this, "About pressed", Toast.LENGTH_SHORT).show();
                } else if (id == R.id.login) {
                    Toast.makeText(LeaderboardActivity.this, "Login pressed", Toast.LENGTH_SHORT).show();
                } else if (id == R.id.share) {
                    Toast.makeText(LeaderboardActivity.this, "Share pressed", Toast.LENGTH_SHORT).show();
                } else if (id == R.id.rate_us) {
                    Toast.makeText(LeaderboardActivity.this, "Rate us pressed", Toast.LENGTH_SHORT).show();
                }

                // Close drawer after item is selected.
                drawerLayout.closeDrawer(GravityCompat.START);
                return false; // return true if you want to indicate the item was selected.
            }

        });

        AdView mAdView = findViewById(R.id.adView);
        AdRequest BannerAdRequest = new AdRequest.Builder().build();
        mAdView.loadAd(BannerAdRequest);
        mAdView.setVisibility(View.VISIBLE);

    }

    @Override
    public boolean onOptionsItemSelected(@NonNull MenuItem item) {
        if (drawerToggle.onOptionsItemSelected(item)) {
            return true;
        }
        // handle other menu items here if necessary

        return super.onOptionsItemSelected(item);
    }


    //FirebaseDB
    private void leaderboard() {
        leaderboardQuery.get().addOnCompleteListener(task -> {
            if (task.isSuccessful()) {
                LinearLayout leaderboardLayout = findViewById(R.id.leaderboardLayout);

                // Clear the layout if you rerun the query to prevent duplicating views
                leaderboardLayout.removeAllViews();

                boolean currentUserIsInTop = false; // Flag to check if current user is in top leaderboard
                String currentUserId = mAuth.getUid(); // Get current user id
                int rank = 1; // Rank counter

                // Iterate through the leaderboard results
                for (QueryDocumentSnapshot document : task.getResult()) {
                    String documentUserId = document.getId();
                    createLeaderboardEntry(document, leaderboardLayout, rank, currentUserId.equals(documentUserId));
                    rank++; // Increment rank number
                    if (currentUserId.equals(documentUserId)) {
                        currentUserIsInTop = true; // Current user is in the top leaderboard
                    }
                }

                // Add the current user’s rank if they’re not in the top leaderboard
                if (!currentUserIsInTop && currentUserId != null) {
                    usersRef.document(currentUserId).get().addOnSuccessListener(document -> {
                        if (document.exists()) {
                            placeholder(leaderboardLayout);
                            createLeaderboardEntry(document, leaderboardLayout, -1, true); // Passing -1 as rank to indicate it’s not a part of the top
                        } else {
                            Log.d("Leaderboard", "Current user document does not exist."); // Handle case where current user does not have a score
                        }
                    }).addOnFailureListener(e -> Log.w("Leaderboard", "Error getting current user document", e));
                }
            } else {
                Log.w("TagDB", "Error getting documents.", task.getException());
            }
        });
    }



    private void placeholder(LinearLayout leaderboardLayout) {
        TextView scoreView = new TextView(this);
        scoreView.setText("...");
        scoreView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
        scoreView.setGravity(Gravity.CENTER_HORIZONTAL);
        leaderboardLayout.addView(scoreView);
    }

    private void createLeaderboardEntry(DocumentSnapshot document, LinearLayout leaderboardLayout, int rank, boolean highlight) {
        TextView scoreView = new TextView(this);
        String nickname = document.getString("nickname");
        String score = document.getLong("score").toString();
        String text = rank > 0 ? rank + ". " : ""; // Add rank number if provided
        text += nickname != null ? nickname + " " + score : "Anonymous " + score;

        scoreView.setText(text);
        scoreView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
        scoreView.setGravity(Gravity.CENTER_HORIZONTAL);

        if (highlight) {
            // Highlight the current user; for example, by changing the text color
            scoreView.setTextColor(ContextCompat.getColor(this, R.color.highlight_color)); // Make sure to define highlight_color in your colors.xml
        }

        leaderboardLayout.addView(scoreView);
    }

}

I need to make some adjustments:
First, I need to find the placement of the current user in the ranking even if he's not in top10.
Second, I need to display the absolute last user with the worst score.
How can I do this?