### Question:
VariableValues { public static double dotProduct(Map<? extends VariableReference, DoubleTensor> left, Map<? extends VariableReference, DoubleTensor> right) { double dotProduct = 0.0; for (VariableReference v : left.keySet()) { dotProduct += left.get(v).times(right.get(v)).sumNumber(); } return dotProduct; } 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 canDotProductTwoMapsOfValues() { double result = VariableValues.dotProduct(left, right); double expected = 1 * 5 + 2 * 6 + 3 * 7 + 4 * 8; assertEquals(expected, result, 1e-6); }