text: Q:
  
  Improve memory usage: IntegerHashMap
  
  We use a HashMap<Integer, SomeType>() with more than a million entries.  I consider that large.  
  But integers are their own hash code.  Couldn't we save memory with a, say, IntegerHashMap<Integer, SomeType>() that uses a special Map.Entry, using int directly instead of a pointer to an Integer object? In our case, that would save 1000000x the memory required for an Integer object.
  Any faults in my line of thought?   Too special to be of general interest? (at least, there is an EnumHashMap)
  add1. The first generic parameter of IntegerHashMap is used to make it closely similar to the other Map implementations.  It could be dropped, of course.
  add2. The same should be possible with other maps and collections.  For example ToIntegerHashMap<KeyType, Integer>, IntegerHashSet<Integer>, etc.
  
  A:
  
  What you're looking for is a "Primitive collections" library.  They are usually much better with memory usage and performance.  One of the oldest/popular libraries was called "Trove".  However, it is a bit outdated now.  The main active libraries in use now are:
  
  Goldman Sach Collections
  Fast Util
  Koloboke
  
  See Benchmarks Here
  
  