  @Test
  public void testInjective() throws NettyBsonReaderException {

    BsonType[] types = BsonType.values();
    Map<Byte, BsonType> foundBytes = new HashMap<>(types.length);
    for (BsonType value : types) {
      byte asByte = ParsingTools.getByte(value);
      BsonType old = foundBytes.put(asByte, value);

      assertNull(old + " and " + value + " has the same associated byte (" + asByte + ")", old);
    }
    assert foundBytes.size() == types.length : "The invariant of the test has been broken";
  }