I am trying to write a method in which a customer has to spend a certain amount of second with a teller.
If the amount of second has expired it should return that the teller is free and thus return a Boolean value true. If the amount of time has not yet passed it should return false and thus the teller is busy. But I am unsure how to do this.
These are my teller and customer classes I am not sure how write one of the methods.
This is the Customer class:
import java.util.Random;
public class Customer {
    //create a random number between 2 and 5 seconds it takes to process a customer through teller
    Random number = new Random();
    protected int arrivalTime; //determines the arrival time of a customer to a bank
    protected int processTime; //the amount of time the customer spend with the teller
    //a customer determines the arrival time of a customer
    public Customer(int at) {
        arrivalTime = at;
        processTime = number.nextInt(5 - 2 + 2) + 2; //the process time is between 2 and 5 seconds
    }
    public int getArrival() {
        return arrivalTime;
    }
    public int getProcess() {
        return processTime; //return the processTime
    }
    public boolean isDone() {
        //this is the method I am trying to create once the  process Time is expired
        //it will return true which means the teller is unoccupied
        //if the time is not expired it will return false and teller is occupied
        boolean expired = false;
        return expired;
    }
}
And this is the Teller class:
public class Teller {
    //variables
    boolean free; //determines if teller if free
    Customer rich; //a Customer object
    public Teller() {
        free = true; //the teller starts out unoccupied 
    }
    public void addCustomer(Customer c) { //a customer is being added to the teller
        rich = c;
        free = false; //the teller is occupied 
    }
    public boolean isFree() {
        if (rich.isDone() == true) {
            return true; //if the customer is finished at the teller the return true
        } else {
            return false;
        }
    }
}
 
     
     
    