UserImporter implements ProtectedPropertyImporter, ProtectedNodeImporter, UserConstants { @Override public void end(@NotNull Tree protectedParent) { currentMembership = null; } UserImporter(ConfigurationParameters config); @Override boolean init(@NotNull Session session, @NotNull Root root, @NotNull NamePathMapper namePathMapper,
            boolean isWorkspaceImport, int uuidBehavior,
            @NotNull ReferenceChangeTracker referenceTracker, @NotNull SecurityProvider securityProvider); @Override boolean handlePropInfo(@NotNull Tree parent, @NotNull PropInfo propInfo, @NotNull PropertyDefinition def); @Override void propertiesCompleted(@NotNull Tree protectedParent); @Override void processReferences(); @Override boolean start(@NotNull Tree protectedParent); @Override void startChildInfo(@NotNull NodeInfo childInfo, @NotNull List<PropInfo> propInfos); @Override void endChildInfo(); @Override void end(@NotNull Tree protectedParent);  }
@Test public void testEnd() throws Exception { init(); Tree groupTree = createGroupTree(); Tree memberRefList = groupTree.addChild(REP_MEMBERS_LIST); memberRefList.setProperty(JcrConstants.JCR_PRIMARYTYPE, NT_REP_MEMBER_REFERENCES_LIST); importer.start(memberRefList); Field f = UserImporter.class.getDeclaredField("currentMembership"); f.setAccessible(true); assertNotNull(f.get(importer)); importer.end(memberRefList); assertNull(f.get(importer)); }