I am using this method to create random numbers Adding to element value in xml in another method. some files that are same won't compare. because numbers I am inserting are random not unique anymore. How to insert same number if file1name equals file1name. else random numbers.
Random random = new Random();
    ArrayList<Integer> arrayList = new ArrayList<Integer>();
    while (arrayList.size() < 6) {
        int a = random.nextInt(49)+1; 
        if (!arrayList.contains(a)) {
            arrayList.add(a);
        }
    }
Thanks in advance! new still a lot to learn.
 
    