import java.util.Vector;

public class Verifier
{
    private static final String EXAMPLE1_FILE = "example1.txt";
    private static final int EXAMPLE1_STEPS = 8;
    private static final String EXAMPLE2_FILE = "example2.txt";
    private static final int EXAMPLE2_STEPS = 24;
    private static final String EXAMPLE3_FILE = "example3.txt";
    private static final int EXAMPLE3_STEPS = 32;
    private static final String EXAMPLE4_FILE = "example4.txt";
    private static final int EXAMPLE4_STEPS = 72;

    public Verifier(boolean debug)
    {
        _debug = debug;
    }

    public boolean verify()
    {
        Vector<String> input = Util.readMap(EXAMPLE1_FILE);
        Map theMap = new Map(input, _debug);

        System.out.println(theMap);

        Explorer exp = new Explorer(theMap, _debug);

        System.out.println("Number of keys and doors: " + theMap.numberOfKeys() + ", " + theMap.numberOfDoors());

        System.out.println("\nTraversing map ...");

        int steps = exp.findAllKeys();

        if (steps != EXAMPLE1_STEPS)
        {
            System.out.println("Error for " + EXAMPLE1_FILE + " - number of steps: " + steps);

            return false;
        }

        System.out.println("Verified. Number of steps to find all keys: " + steps);

        input = Util.readMap(EXAMPLE2_FILE);

        theMap = new Map(input, _debug);

        System.out.println("\n" + theMap);

        exp = new Explorer(theMap, _debug);

        System.out.println("Number of keys and doors: " + theMap.numberOfKeys() + ", " + theMap.numberOfDoors());

        System.out.println("\nTraversing map ...");

        steps = exp.findAllKeys();

        if (steps != EXAMPLE2_STEPS)
        {
            System.out.println("Error for " + EXAMPLE2_FILE + " - number of steps: " + steps);

            return false;
        }

        System.out.println("Verified. Number of steps to find all keys: " + steps);

        input = Util.readMap(EXAMPLE3_FILE);

        theMap = new Map(input, _debug);

        System.out.println("\n" + theMap);

        exp = new Explorer(theMap, _debug);

        System.out.println("Number of keys and doors: " + theMap.numberOfKeys() + ", " + theMap.numberOfDoors());

        System.out.println("\nTraversing map ...");

        steps = exp.findAllKeys();

        if (steps != EXAMPLE3_STEPS)
        {
            System.out.println("Error for " + EXAMPLE3_FILE + " - number of steps: " + steps);

            return false;
        }

        System.out.println("Verified. Number of steps to find all keys: " + steps);

        input = Util.readMap(EXAMPLE4_FILE);

        theMap = new Map(input, _debug);

        System.out.println("\n" + theMap);

        exp = new Explorer(theMap, _debug);

        System.out.println("Number of keys and doors: " + theMap.numberOfKeys() + ", " + theMap.numberOfDoors());

        System.out.println("\nTraversing map ...");

        steps = exp.findAllKeys();

        if (steps != EXAMPLE4_STEPS)
        {
            System.out.println("Error for " + EXAMPLE4_FILE + " - number of steps: " + steps);

            return false;
        }

        System.out.println("Verified. Number of steps to find all keys: " + steps);

        return true;
    }

    private boolean _debug;
}
import java.util.Vector;

public class Verifier
{
    private static final String EXAMPLE1_FILE = "example1.txt";
    private static final int EXAMPLE1_STEPS = 8;
    private static final String EXAMPLE2_FILE = "example2.txt";
    private static final int EXAMPLE2_STEPS = 24;
    private static final String EXAMPLE3_FILE = "example3.txt";
    private static final int EXAMPLE3_STEPS = 32;
    private static final String EXAMPLE4_FILE = "example4.txt";
    private static final int EXAMPLE4_STEPS = 72;

    public Verifier(boolean debug)
    {
        _debug = debug;
    }

    public boolean verify()
    {
        Vector<String> input = Util.readMap(EXAMPLE1_FILE);
        Map theMap = new Map(input, _debug);

        System.out.println(theMap);

        Explorer exp = new Explorer(theMap, _debug);

        System.out.println("Number of keys and doors: " + theMap.numberOfKeys() + ", " + theMap.numberOfDoors());

        System.out.println("\nTraversing map ...");

        int steps = exp.findAllKeys();

        if (steps != EXAMPLE1_STEPS)
        {
            System.out.println("Error for " + EXAMPLE1_FILE + " - number of steps: " + steps);

            return false;
        }

        System.out.println("Verified. Number of steps to find all keys: " + steps);

        return true;
    }

    private boolean _debug;
}
Update Verifier.java