### Question:
Int2FloatOpenHashMapWritable extends Int2FloatOpenHashMap implements Writable { public int dot(Int2FloatOpenHashMapWritable m) { int s = 0; for (Int2FloatMap.Entry e : m.int2FloatEntrySet()) { int key = e.getKey(); if (this.containsKey(key)) { s += this.get(key) * e.getValue(); } } return s; } Int2FloatOpenHashMapWritable(); @Override void readFields(DataInput in); void decode(); boolean hasBeenDecoded(); @Override void write(DataOutput out); byte[] serialize(); static Int2FloatOpenHashMapWritable create(DataInput in); static Int2FloatOpenHashMapWritable create(byte[] bytes); void plus(Int2FloatOpenHashMapWritable m); int dot(Int2FloatOpenHashMapWritable m); void increment(int key); void increment(int key, float n); static void setLazyDecodeFlag(boolean b); static boolean getLazyDecodeFlag(); int[] getKeys(); float[] getValues(); void lazyplus(Int2FloatOpenHashMapWritable m); Int2FloatMap.Entry[] getEntriesSortedByValue(); Int2FloatMap.Entry[] getEntriesSortedByValue(int k);  }### Answer:
@Test public void testDot() throws IOException { Int2FloatOpenHashMapWritable m1 = new Int2FloatOpenHashMapWritable(); m1.put(1, 2.0f); m1.put(2, 1.0f); m1.put(3, 3.0f); Int2FloatOpenHashMapWritable m2 = new Int2FloatOpenHashMapWritable(); m2.put(1, 1.0f); m2.put(2, 4.0f); m2.put(4, 5.0f); float s = m1.dot(m2); assertEquals(6.0f, s, 10e-6); }