### Question:
VariableValues { public static Map<VariableReference, DoubleTensor> times(Map<VariableReference, DoubleTensor> left, double right) { Map<VariableReference, DoubleTensor> result = new HashMap<>(); for (VariableReference v : left.keySet()) { result.put(v, left.get(v).times(right)); } return result; } private  VariableValues(); static double dotProduct(Map<? extends VariableReference, DoubleTensor> left, Map<? extends VariableReference, DoubleTensor> right); static Map<VariableReference, DoubleTensor> pow(Map<VariableReference, DoubleTensor> values, double exponent); static Map<VariableReference, DoubleTensor> divide(Map<VariableReference, DoubleTensor> left, double right); static Map<VariableReference, DoubleTensor> times(Map<VariableReference, DoubleTensor> left, double right); static Map<VariableReference, DoubleTensor> times(Map<VariableReference, DoubleTensor> left, Map<VariableReference, DoubleTensor> right); static Map<VariableReference, DoubleTensor> add(Map<VariableReference, DoubleTensor> left, Map<VariableReference, DoubleTensor> right); static Map<VariableReference, DoubleTensor> withShape(double value, Map<VariableReference, DoubleTensor> shapeLike); static Map<VariableReference, DoubleTensor> zeros(Map<VariableReference, DoubleTensor> shapeLike); static Map<VariableReference, DoubleTensor> ones(Map<VariableReference, DoubleTensor> shapeLike);  }### Answer:
@Test public void canTimesTwoMapsOfValues() { Map<VariableReference, DoubleTensor> result = VariableValues.times(left, right); DoubleTensor expectedA = DoubleTensor.create(5, 12); DoubleTensor expectedB = DoubleTensor.create(21, 32); assertEquals(expectedA, result.get(AReference)); assertEquals(expectedB, result.get(BReference)); }
@Test public void canTimesAMapOfValues() { Map<VariableReference, DoubleTensor> result = VariableValues.times(left, 2); DoubleTensor expectedA = DoubleTensor.create(2, 4); DoubleTensor expectedB = DoubleTensor.create(6, 8); assertEquals(expectedA, result.get(AReference)); assertEquals(expectedB, result.get(BReference)); }