### Question:
ObjectId implements Bson, Comparable<ObjectId> { @Override public String toString() { return getClass().getSimpleName() + "[" + getHexData() + "]"; } ObjectId();  ObjectId(String hexString);  ObjectId(byte[] data); byte[] toByteArray(); @Override int compareTo(final ObjectId other); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); String getHexData();  }### Answer:
@Test void testToString() throws Exception { String expectedPattern = "^ObjectId\\[[a-f0-9]{" + 2 * BsonConstants.LENGTH_OBJECTID + "}\\]$"; assertThat(new ObjectId().toString()).matches(expectedPattern); }