Consider this code
String[] colours1 = new String[]{"red", "green", "blue"};
String[] colours2 = new String[]{"red", "yellow", "blue"};
String[] colours3 = new String[]{"red", "green", "blue"};
List<String[]> distinct = Stream.of(colours1, colours2, colours3)
        .distinct() // Do something here to compare arrays better
        .collect(Collectors.toList());
I want the distinct list to contain only 2 elements colours1 and colours2 (as 1 and 3 are equivalent). However because the stream distinct() method performs equals comparison it still contains all 3 colours arrays. I want a custom distinct function where you can provide a comparator. In this case Objects#deepEquals would be sufficient. Is there a easy way to achieve this?
 
    