Given a problem description, replicate the failure (Associate Android Developer Certification)

Let’s assume we are given following problem:

Caused by: java.lang.ArrayIndexOutOfBoundsException: length=3; index=5

We should replicate this problem:

        String[] names = {"Joe", "Bob", "Lily"};
        Toast.makeText(getApplicationContext(), names[5], Toast.LENGTH_LONG).show();

We can not know what problem will be and that’s why using Android Monitor and Googling be with us =)