For the key (Integer) the compiler will handle this automatically for you and you can pass directly an int value.
For the Boolean array, you could handle this way with Java 8
Map<Integer, Double[]> foo = new HashMap<Integer, Double[]>();
double[] bar = new double[10];
//As you can see, 1 is passed directly and will be converted to Integer object.
foo.put(1, Arrays.stream(bar)
.boxed()
.toArray(Double[]::new));
the boxed
method of DoubleStream returns a Stream consisting of the elements of this stream, boxed to Double.
Then you get a Stream on which you can easily call toArray
to convert to a Double[]
.