I am using the Mongo Aggregation Framework using the Java MongoDB driver, version 3.3. I have an aggregagtion pipeline, that is merely collection of type List
This is a rather old question, however I put my suggestion (for mongodb-driver 3.6.4) here as this is the most relevant post when googling on "mongodb java driver pretty print":
BsonDocument bsonDocument = bson.toBsonDocument(BsonDocument.class, MongoClient.getDefaultCodecRegistry());
JsonWriterSettings.Builder settingsBuilder = JsonWriterSettings.builder().indent(true);
System.out.println(bsonDocument.toJson(settingsBuilder.build());