@Override
  public UserAccount readFromDb(final String userId) {
    var iterable = db
            .getCollection(CachingConstants.USER_ACCOUNT)
            .find(new Document(USER_ID, userId));
    if (iterable.first() == null) {
      return null;
    }
    Document doc = iterable.first();
    if (doc != null) {
      String userName = doc.getString(USER_NAME);
      String appInfo = doc.getString(ADD_INFO);
      return new UserAccount(userId, userName, appInfo);
    } else {
      return null;
    }
  }
@Test
  void readFromDb() {
    Document document = new Document(USER_ID, ID)
            .append(USER_NAME, NAME)
            .append(ADD_INFO, ADDITIONAL_INFO);
    MongoCollection<Document> mongoCollection = mock(MongoCollection.class);
    when(db.getCollection(CachingConstants.USER_ACCOUNT)).thenReturn(mongoCollection);

    FindIterable<Document> findIterable = mock(FindIterable.class);
    when(mongoCollection.find(any(Document.class))).thenReturn(findIterable);

    when(findIterable.first()).thenReturn(document);

    assertEquals(mongoDb.readFromDb(ID),userAccount);
  }