### Question:
MongoMapping { public void addClassField(String classFieldName, String docFieldName, String fieldType) { try { newDocumentField(docFieldName, valueOf(fieldType.toUpperCase(Locale.getDefault()))); } catch (final IllegalArgumentException e) { throw new IllegalStateException("Declared '" + fieldType + "' for class field '" + classFieldName + "' is not supported by MongoMapping"); } if (classToDocument.containsKey(classFieldName)) { if (!classToDocument.get(classFieldName).equals(docFieldName)) { throw new IllegalStateException("The class field '" + classFieldName + "' is already registered in the mapping" + " with the document field '" + classToDocument.get(classFieldName) + " which differs from the new one '" + docFieldName + "'."); } } else { classToDocument.put(classFieldName, docFieldName); documentToClass.put(docFieldName, classFieldName); } }  void renameCollection(String oldName, String newName); String getCollectionName(); void setCollectionName(String collName); void addClassField(String classFieldName,
      String docFieldName, String fieldType); String getDocumentField(String field); static final Logger LOG; }### Answer:
@Test(expected = IllegalStateException.class) public void addConflictingFields1() { MongoMapping mapping = new MongoMapping(); mapping.addClassField("classFieldName", "top1", "int32"); mapping.addClassField("classFieldName", "top1.l2", "double"); }
@Test(expected = IllegalStateException.class) public void addConflictingFields2() { MongoMapping mapping = new MongoMapping(); mapping.addClassField("classFieldName", "top1", "int64"); mapping.addClassField("classFieldName", "top1", "string"); }
@Test(expected = IllegalStateException.class) public void addConflictingFields3() { MongoMapping mapping = new MongoMapping(); mapping.addClassField("classFieldName", "top1", "document"); mapping.addClassField("classFieldName", "top1.l2", "string"); mapping.addClassField("classFieldName", "top1.l2.l3", "double"); }