ObjIdConcurrentMap implements /* ConcurrentMap<K, V>, */ Serializable { Segment<V> segmentFor(int hash) { return segments[(hash >>> segmentShift) & segmentMask]; } ObjIdConcurrentMap(int initialCapacity, float loadFactor, int concurrencyLevel);  ObjIdConcurrentMap(int initialCapacity, float loadFactor);  ObjIdConcurrentMap(int initialCapacity);  ObjIdConcurrentMap(); boolean isEmpty(); int size(); V get(int key); boolean containsKey(int key); boolean containsValue(Object value); boolean contains(Object value); V put(int key, V value); V putIfAbsent(int key, V value); V remove(int key); boolean remove(int key, Object value); boolean replace(int key, V oldValue, V newValue); V replace(int key, V value); void clear();  }
@Test public void shouldBeMockable() throws Exception { ObjIdConcurrentMap mockObjIdConcurrentMap = mock(ObjIdConcurrentMap.class); Segment mockSegment = mock(Segment.class); when(mockObjIdConcurrentMap.segmentFor(anyInt())).thenReturn(mockSegment); assertThat(mockObjIdConcurrentMap.segmentFor(0)).isEqualTo(mockSegment); }