Presumably you want the key to the map to match on the value of the elements instead of the identity of the array. In that case you want some kind of object that defines equals
and hashCode
as you would expect. Easiest is to convert to a List<Integer>
, either an ArrayList
or better use Arrays.asList
. Better than that you can introduce a class that represents the data (similar to java.awt.Rectangle
but I recommend making the variables private final, and the class final too).