IntIndexToIndexMap implements IndexToIndexMap { @Override public void put(final int key, final int value) { if (key < 0) throw new IllegalArgumentException("Negative key"); if (value < 0) throw new IllegalArgumentException("Negative value"); final Integer previous = elements.put(key, value); if (previous != null) throw new IllegalArgumentException( "Key <" + key + "> was already bound to <" + previous + ">"); }  @Override void put(final int key, final int value); @Override long getSizeInBytes(); @Override void writeTo(
            @NotNull
            final OutputStream os); @Override String toString();  }
@Test(expected = IllegalArgumentException.class) public void negativeKey() { new IntIndexToIndexMap().put(-1, 0); }
@Test(expected = IllegalArgumentException.class) public void negativeValue() { new IntIndexToIndexMap().put(0, -1); }
@Test(expected = IllegalArgumentException.class) public void overwrite() { final IndexToIndexMap idx = new IntIndexToIndexMap(); idx.put(0, 0); idx.put(0, 0); }