public AbstractMacroBaseUnitTestCase() {
    // log4j:
    PropertyConfigurator.configure(
        AbstractMacroBaseUnitTestCase.class.getClassLoader().getResource("log4j.properties"));

    // CMIS Repository
    Map<String, ConfluenceCMISRepository> repoConfigs =
        new WeakHashMap<String, ConfluenceCMISRepository>();
    ConfluenceCMISRepository repoConfig =
        new ConfluenceCMISRepository(
            TEST_SERVER_NAME, TEST_REALM, TEST_USERNAME, TEST_PASSWORD, null);

    repoConfigs.put(TEST_SERVER_NAME, repoConfig);

    bandanaManager = mock(BandanaManager.class);
    when(bandanaManager.getValue((BandanaContext) anyObject(), anyString()))
        .thenReturn(repoConfigs);

    // CMIS
    ObjectId documentObjectId = mock(ObjectId.class);
    when(documentObjectId.getId()).thenReturn(TEST_DOCUMENT_ID);

    Document documentObject = getTestDocument();

    List<CmisObject> documentList = new ArrayList<CmisObject>();
    documentList.add(documentObject);

    ObjectId folderObjectId = mock(ObjectId.class);
    when(folderObjectId.getId()).thenReturn(TEST_FOLDER_ID);

    ItemIterable<CmisObject> children = mock(ItemIterable.class);
    when(children.getTotalNumItems()).thenReturn(1l);
    when(children.getHasMoreItems()).thenReturn(true).thenReturn(false);
    when(children.iterator()).thenReturn(documentList.iterator());

    Folder folderObject =
        createMockedCmisObject(
            new String[][] {
              {PropertyIds.NAME, "Name", "A folder"},
              {PropertyIds.BASE_TYPE_ID, "Base Type Id", "cmis:folder"},
              {PropertyIds.OBJECT_TYPE_ID, "Object Type Id", "cmis:folder"},
              {PropertyIds.OBJECT_ID, "Object Type Id", TEST_FOLDER_ID}
            },
            Folder.class);
    when(folderObject.getId()).thenReturn(TEST_FOLDER_ID);
    when(folderObject.getChildren()).thenReturn(children);

    Session session = mock(Session.class);

    when(session.createObjectId(TEST_DOCUMENT_ID)).thenReturn(documentObjectId);
    when(session.createObjectId(TEST_FOLDER_ID)).thenReturn(folderObjectId);
    when(session.getObject(documentObjectId)).thenReturn(documentObject);
    when(session.getObject(folderObjectId)).thenReturn(folderObject);

    confluenceCMISRepository = mock(ConfluenceCMISRepository.class);
    when(confluenceCMISRepository.getSession()).thenReturn(session);
  }
 public synchronized boolean equals(java.lang.Object obj) {
   if (!(obj instanceof Folder)) return false;
   Folder other = (Folder) obj;
   if (obj == null) return false;
   if (this == obj) return true;
   if (__equalsCalc != null) {
     return (__equalsCalc == obj);
   }
   __equalsCalc = obj;
   boolean _equals;
   _equals =
       super.equals(obj)
           && ((this.children == null && other.getChildren() == null)
               || (this.children != null
                   && java.util.Arrays.equals(this.children, other.getChildren())));
   __equalsCalc = null;
   return _equals;
 }