@SuppressWarnings("unchecked")
	public Map<String, String> getSingleObject(String collectionName) {
		DBCursor cursor = mongoTemplate.getCollection(collectionName).find();
		if (cursor.count() != 1) {
			throw new IllegalStateException("Expected only one result but received " + cursor.count() + " entries");
		}
		DBObject dbObject = mongoTemplate.getCollection(collectionName).findOne();
		Map<String, String> result = null;
		if (dbObject != null) {
			result = dbObject.toMap();
		}
		return result;
	}
Returns a single object from the collection.

@param collectionName the name of the collection to query
@return A Map with the content of the result
@throws IllegalStateException if the number of objects in the collection is not one
spring-xd-test-fixtures/src/main/java/org/springframework/xd/test/fixtures/HdfsMongoDbJob.java