ReplicaMap { ReplicaInfo add(String bpid, ReplicaInfo replicaInfo) { checkBlockPool(bpid); checkBlock(replicaInfo); synchronized (mutex) { Map<Long, ReplicaInfo> m = map.get(bpid); if (m == null) { m = new HashMap<>(); map.put(bpid, m); } return m.put(replicaInfo.getBlockId(), replicaInfo); } } ReplicaMap(Object mutex);   }
@Test public void testAdd() { try { map.add(bpid, null); fail("Expected exception not thrown"); } catch (IllegalArgumentException expected) { } }