import java.util.Random;

public class RandomElementExample<E> {
    
    private Random random;
    private E[] values;
    
    public RandomElementExample(E[] values) {
        this.values = values;
        random = new Random();
    }
    
    
    public E getRandomValue() {
        return values[random.nextInt(values.length)];
    }
    
}