You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ss...@apache.org on 2024/04/09 15:33:20 UTC

(sling-org-apache-sling-testing-jcr-mock) branch feature/SLING-12284-parent-60 created (now c545cb6)

This is an automated email from the ASF dual-hosted git repository.

sseifert pushed a change to branch feature/SLING-12284-parent-60
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-jcr-mock.git


      at c545cb6  SLING-12284 apply spotless code formatting

This branch includes the following new commits:

     new 9a550cd  SLING-12284 Update to Parent 60, Java 11 Minimum Version
     new c545cb6  SLING-12284 apply spotless code formatting

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(sling-org-apache-sling-testing-jcr-mock) 02/02: SLING-12284 apply spotless code formatting

Posted by ss...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sseifert pushed a commit to branch feature/SLING-12284-parent-60
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-jcr-mock.git

commit c545cb69a61481905327eceb0a82eba582903628
Author: Stefan Seifert <st...@users.noreply.github.com>
AuthorDate: Tue Apr 9 17:32:30 2024 +0200

    SLING-12284 apply spotless code formatting
---
 pom.xml                                            |   6 +-
 .../sling/testing/mock/jcr/AbstractItem.java       |  23 +--
 .../apache/sling/testing/mock/jcr/ItemData.java    |  11 +-
 .../apache/sling/testing/mock/jcr/ItemFilter.java  |   1 -
 .../sling/testing/mock/jcr/MockAuthorizable.java   |  57 ++++----
 .../mock/jcr/MockEventListenerIterator.java        |   7 +-
 .../apache/sling/testing/mock/jcr/MockGroup.java   |  48 +++---
 .../sling/testing/mock/jcr/MockItemDefinition.java |  27 ++--
 .../org/apache/sling/testing/mock/jcr/MockJcr.java |  74 ++++++----
 .../testing/mock/jcr/MockNamespaceRegistry.java    |   5 +-
 .../apache/sling/testing/mock/jcr/MockNode.java    |  84 ++++++-----
 .../sling/testing/mock/jcr/MockNodeDefinition.java |   8 +-
 .../mock/jcr/MockNodeDefinitionTemplate.java       |  27 ++--
 .../sling/testing/mock/jcr/MockNodeType.java       |  44 +++---
 .../testing/mock/jcr/MockNodeTypeManager.java      |  33 ++---
 .../testing/mock/jcr/MockNodeTypeTemplate.java     |  39 +++--
 .../sling/testing/mock/jcr/MockNodeTypes.java      |   1 -
 .../testing/mock/jcr/MockObservationManager.java   |  24 ++-
 .../testing/mock/jcr/MockPrincipalManager.java     |  41 +++---
 .../sling/testing/mock/jcr/MockProperty.java       |  49 +++----
 .../testing/mock/jcr/MockPropertyDefinition.java   |  27 ++--
 .../mock/jcr/MockPropertyDefinitionTemplate.java   |  30 ++--
 .../apache/sling/testing/mock/jcr/MockQuery.java   |  16 +-
 .../sling/testing/mock/jcr/MockQueryManager.java   |  21 +--
 .../sling/testing/mock/jcr/MockQueryResult.java    |  12 +-
 .../testing/mock/jcr/MockQueryResultHandler.java   |   1 -
 .../sling/testing/mock/jcr/MockRepository.java     |  15 +-
 .../org/apache/sling/testing/mock/jcr/MockRow.java |   8 +-
 .../apache/sling/testing/mock/jcr/MockSession.java |  89 +++++++-----
 .../mock/jcr/MockTemplateBuilderFactory.java       |  63 ++++----
 .../apache/sling/testing/mock/jcr/MockUser.java    |  39 ++---
 .../sling/testing/mock/jcr/MockUserManager.java    | 161 ++++++++++++---------
 .../sling/testing/mock/jcr/MockWorkspace.java      |  16 +-
 .../sling/testing/mock/jcr/ResourceUtil.java       |   7 +-
 .../sling/testing/mock/jcr/AbstractItemTest.java   |  20 ++-
 .../testing/mock/jcr/AbstractMockNodeTypeTest.java |  47 +++---
 .../apache/sling/testing/mock/jcr/LogCapture.java  |  29 ++--
 .../testing/mock/jcr/MockAuthorizableTest.java     |  61 ++++----
 .../sling/testing/mock/jcr/MockGroupTest.java      |  48 +++---
 .../mock/jcr/MockNodeOnlyRegisteredTypesTest.java  |  23 +--
 .../sling/testing/mock/jcr/MockNodeTest.java       |  96 ++++++------
 .../testing/mock/jcr/MockNodeTypeAllModeTest.java  |  39 ++---
 .../mock/jcr/MockNodeTypeManagerAllModeTest.java   |  51 ++++---
 .../testing/mock/jcr/MockNodeTypeManagerTest.java  |  58 ++++----
 .../sling/testing/mock/jcr/MockNodeTypeTest.java   |  53 +++----
 .../testing/mock/jcr/MockPrincipalManagerTest.java |  80 +++++-----
 .../sling/testing/mock/jcr/MockPropertyTest.java   | 115 ++++++++-------
 .../testing/mock/jcr/MockQueryManagerTest.java     |  33 ++---
 .../sling/testing/mock/jcr/MockRepositoryTest.java |  16 +-
 .../sling/testing/mock/jcr/MockSessionTest.java    |  45 +++---
 .../testing/mock/jcr/MockUserManagerTest.java      |  86 ++++++-----
 .../sling/testing/mock/jcr/MockUserTest.java       |  75 +++++-----
 .../sling/testing/mock/jcr/MockWorkspaceTest.java  |  11 +-
 .../sling/testing/mock/jcr/ResourceUtilTest.java   |   5 +-
 54 files changed, 1103 insertions(+), 1002 deletions(-)

diff --git a/pom.xml b/pom.xml
index e894405..62df13b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <!--
   Licensed to the Apache Software Foundation (ASF) under one
   or more contributor license agreements.  See the NOTICE file
@@ -37,10 +37,10 @@
     <scm>
         <connection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-jcr-mock.git</connection>
         <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-jcr-mock.git</developerConnection>
-        <url>https://github.com/apache/sling-org-apache-sling-testing-jcr-mock.git</url>
         <tag>HEAD</tag>
+        <url>https://github.com/apache/sling-org-apache-sling-testing-jcr-mock.git</url>
     </scm>
-    
+
     <properties>
         <project.build.outputTimestamp>2024-01-22T13:51:21Z</project.build.outputTimestamp>
         <oak.version>1.22.15</oak.version>
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/AbstractItem.java b/src/main/java/org/apache/sling/testing/mock/jcr/AbstractItem.java
index 09634ca..a389db4 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/AbstractItem.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/AbstractItem.java
@@ -18,14 +18,14 @@
  */
 package org.apache.sling.testing.mock.jcr;
 
-import java.util.Objects;
-
 import javax.jcr.Item;
 import javax.jcr.ItemNotFoundException;
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
+import java.util.Objects;
+
 import org.apache.commons.lang3.StringUtils;
 
 /**
@@ -57,7 +57,7 @@ abstract class AbstractItem implements Item {
     }
 
     @Override
-    public Session getSession()throws RepositoryException {
+    public Session getSession() throws RepositoryException {
         return this.session;
     }
 
@@ -111,18 +111,22 @@ abstract class AbstractItem implements Item {
         boolean same = false;
         // Both objects were acquired through Session objects that were created by the same Repository object.
         // Both objects were acquired through Session objects bound to the same repository workspace.
-        if (Objects.equals(getSession().getRepository(), otherItem.getSession().getRepository()) &&
-                Objects.equals(getSession().getWorkspace().getName(), otherItem.getSession().getWorkspace().getName())) {
+        if (Objects.equals(getSession().getRepository(), otherItem.getSession().getRepository())
+                && Objects.equals(
+                        getSession().getWorkspace().getName(),
+                        otherItem.getSession().getWorkspace().getName())) {
             // The objects are either both Node objects or both Property objects.
             if (isNode() && otherItem.isNode()) {
                 // they are Node objects, they must have the same identifier.
-                if (Objects.equals(((Node)this).getIdentifier(), ((Node)otherItem).getIdentifier())) {
+                if (Objects.equals(((Node) this).getIdentifier(), ((Node) otherItem).getIdentifier())) {
                     same = true;
                 }
-            } else if (!isNode() && !otherItem.isNode() &&
+            } else if (!isNode()
+                    && !otherItem.isNode()
+                    &&
                     // Property objects must have identical names and isSame is true of their parent nodes.
-                    Objects.equals(getName(), otherItem.getName()) &&
-                    getParent().isSame(otherItem.getParent())) {
+                    Objects.equals(getName(), otherItem.getName())
+                    && getParent().isSame(otherItem.getParent())) {
                 same = true;
             }
         }
@@ -140,5 +144,4 @@ abstract class AbstractItem implements Item {
     public void save() throws RepositoryException {
         throw new UnsupportedOperationException();
     }
-
 }
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/ItemData.java b/src/main/java/org/apache/sling/testing/mock/jcr/ItemData.java
index c52e7c1..2b076cb 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/ItemData.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/ItemData.java
@@ -18,13 +18,13 @@
  */
 package org.apache.sling.testing.mock.jcr;
 
-import java.util.UUID;
-
 import javax.jcr.Item;
 import javax.jcr.Session;
 import javax.jcr.Value;
 import javax.jcr.nodetype.NodeType;
 
+import java.util.UUID;
+
 /**
  * Holds node and property item data independently from session.
  */
@@ -135,8 +135,7 @@ class ItemData {
     public Item getItem(Session session) {
         if (isNode) {
             return new MockNode(this, session);
-        }
-        else {
+        } else {
             return new MockProperty(this, session);
         }
     }
@@ -157,7 +156,6 @@ class ItemData {
         this.isChanged = isChanged;
     }
 
-
     @Override
     public int hashCode() {
         return path.hashCode();
@@ -166,7 +164,7 @@ class ItemData {
     @Override
     public boolean equals(Object obj) {
         if (obj instanceof ItemData) {
-            return path.equals(((ItemData)obj).path);
+            return path.equals(((ItemData) obj).path);
         }
         return false;
     }
@@ -182,5 +180,4 @@ class ItemData {
     public static ItemData newProperty(String path) {
         return new ItemData(path, false, null, null);
     }
-
 }
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/ItemFilter.java b/src/main/java/org/apache/sling/testing/mock/jcr/ItemFilter.java
index cda6b42..9355628 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/ItemFilter.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/ItemFilter.java
@@ -26,5 +26,4 @@ import javax.jcr.RepositoryException;
 interface ItemFilter {
 
     boolean accept(ItemData item) throws RepositoryException;
-
 }
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/MockAuthorizable.java b/src/main/java/org/apache/sling/testing/mock/jcr/MockAuthorizable.java
index a03a18c..5c7cea1 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/MockAuthorizable.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/MockAuthorizable.java
@@ -1,33 +1,35 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.sling.testing.mock.jcr;
 
-import java.security.Principal;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
 import javax.jcr.Node;
 import javax.jcr.Property;
 import javax.jcr.PropertyIterator;
 import javax.jcr.RepositoryException;
 import javax.jcr.Value;
 
+import java.security.Principal;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
 import org.apache.jackrabbit.JcrConstants;
 import org.apache.jackrabbit.api.security.principal.PrincipalManager;
 import org.apache.jackrabbit.api.security.user.Authorizable;
@@ -42,16 +44,16 @@ import org.jetbrains.annotations.Nullable;
 abstract class MockAuthorizable implements Authorizable {
     // internal property names to filter out of the authorizable properties
     protected Set<String> notAuthorizablePropNames = new HashSet<>(Arrays.asList(
-            JcrConstants.JCR_PRIMARYTYPE,
-            UserConstants.REP_AUTHORIZABLE_ID,
-            UserConstants.REP_PRINCIPAL_NAME));
+            JcrConstants.JCR_PRIMARYTYPE, UserConstants.REP_AUTHORIZABLE_ID, UserConstants.REP_PRINCIPAL_NAME));
 
     protected String id;
     protected Principal principal;
     protected MockUserManager mockUserMgr;
     protected Node homeNode;
 
-    MockAuthorizable(@Nullable String id, @Nullable Principal principal,
+    MockAuthorizable(
+            @Nullable String id,
+            @Nullable Principal principal,
             @NotNull Node homeNode,
             @NotNull MockUserManager mockUserMgr) {
         this.principal = principal;
@@ -88,7 +90,7 @@ abstract class MockAuthorizable implements Authorizable {
         Set<Group> declaredMemberOf = new HashSet<>();
         Set<Authorizable> all = mockUserMgr.all(PrincipalManager.SEARCH_TYPE_GROUP);
         for (Authorizable authorizable : all) {
-            Group group = (Group)authorizable;
+            Group group = (Group) authorizable;
             if (group.isDeclaredMember(this)) {
                 declaredMemberOf.add(group);
             }
@@ -104,19 +106,20 @@ abstract class MockAuthorizable implements Authorizable {
     }
     /**
      * Drills down into nested groups to find all the members
-     * 
+     *
      * @param members the set to add the found people to
      * @param group the group to process
      * @param processedGroups the set of groups that have already been processed
      * @throws RepositoryException
      */
-    private void calcMemberOf(Set<Group> memberOf, Authorizable authorizable, Set<Authorizable> processedAuthorizables) throws RepositoryException {
+    private void calcMemberOf(Set<Group> memberOf, Authorizable authorizable, Set<Authorizable> processedAuthorizables)
+            throws RepositoryException {
         if (!processedAuthorizables.contains(authorizable)) {
             // mark as processed
             processedAuthorizables.add(authorizable);
 
             @NotNull Iterator<Group> declaredIt = authorizable.declaredMemberOf();
-            while(declaredIt.hasNext()) {
+            while (declaredIt.hasNext()) {
                 Group group = declaredIt.next();
                 memberOf.add(group);
 
@@ -125,7 +128,6 @@ abstract class MockAuthorizable implements Authorizable {
         }
     }
 
-
     @Override
     public void remove() throws RepositoryException {
         mockUserMgr.removeAuthorizable(this);
@@ -220,5 +222,4 @@ abstract class MockAuthorizable implements Authorizable {
     public @NotNull String getPath() throws RepositoryException {
         return homeNode.getPath();
     }
-
 }
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/MockEventListenerIterator.java b/src/main/java/org/apache/sling/testing/mock/jcr/MockEventListenerIterator.java
index b159c5c..3e4b339 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/MockEventListenerIterator.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/MockEventListenerIterator.java
@@ -18,11 +18,11 @@
  */
 package org.apache.sling.testing.mock.jcr;
 
-import java.util.Collection;
-
 import javax.jcr.observation.EventListener;
 import javax.jcr.observation.EventListenerIterator;
 
+import java.util.Collection;
+
 import org.apache.jackrabbit.commons.iterator.RangeIteratorAdapter;
 
 class MockEventListenerIterator extends RangeIteratorAdapter implements EventListenerIterator {
@@ -33,7 +33,6 @@ class MockEventListenerIterator extends RangeIteratorAdapter implements EventLis
 
     @Override
     public EventListener nextEventListener() {
-        return (EventListener)this.next();
+        return (EventListener) this.next();
     }
-
 }
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/MockGroup.java b/src/main/java/org/apache/sling/testing/mock/jcr/MockGroup.java
index dd75d54..f7d51c7 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/MockGroup.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/MockGroup.java
@@ -1,21 +1,26 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.sling.testing.mock.jcr;
 
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+
 import java.security.Principal;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -23,9 +28,6 @@ import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-
 import org.apache.jackrabbit.api.security.user.Authorizable;
 import org.apache.jackrabbit.api.security.user.Group;
 import org.jetbrains.annotations.NotNull;
@@ -37,7 +39,9 @@ import org.jetbrains.annotations.Nullable;
 class MockGroup extends MockAuthorizable implements Group {
     private Map<String, Authorizable> declaredMembers = new HashMap<>();
 
-    public MockGroup(@Nullable String id, @Nullable Principal principal,
+    public MockGroup(
+            @Nullable String id,
+            @Nullable Principal principal,
             @NotNull Node homeNode,
             @NotNull MockUserManager mockUserMgr) {
         super(id, principal, homeNode, mockUserMgr);
@@ -57,24 +61,25 @@ class MockGroup extends MockAuthorizable implements Group {
 
     /**
      * Drills down into nested groups to find all the members
-     * 
+     *
      * @param members the set to add the found people to
      * @param group the group to process
      * @param processedGroups the set of groups that have already been processed
      * @throws RepositoryException
      */
-    private void calcMembers(Set<Authorizable> members, Group group, Set<Group> processedGroups) throws RepositoryException {
+    private void calcMembers(Set<Authorizable> members, Group group, Set<Group> processedGroups)
+            throws RepositoryException {
         if (!processedGroups.contains(group)) {
             // mark as processed
             processedGroups.add(group);
 
             @NotNull Iterator<Authorizable> declaredIt = group.getDeclaredMembers();
-            while(declaredIt.hasNext()) {
+            while (declaredIt.hasNext()) {
                 Authorizable authorizable = declaredIt.next();
                 members.add(authorizable);
 
                 if (authorizable instanceof Group) {
-                    Group subgroup = (Group)authorizable;
+                    Group subgroup = (Group) authorizable;
                     calcMembers(members, subgroup, processedGroups);
                 }
             }
@@ -93,7 +98,7 @@ class MockGroup extends MockAuthorizable implements Group {
             // groups
             for (Authorizable m : declaredMembers.values()) {
                 if (m.isGroup()) {
-                    value = ((Group)m).isDeclaredMember(authorizable);
+                    value = ((Group) m).isDeclaredMember(authorizable);
                 }
                 if (value) {
                     break;
@@ -152,5 +157,4 @@ class MockGroup extends MockAuthorizable implements Group {
         builder.append("]");
         return builder.toString();
     }
-
 }
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/MockItemDefinition.java b/src/main/java/org/apache/sling/testing/mock/jcr/MockItemDefinition.java
index 6ec1ec3..3e4d82d 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/MockItemDefinition.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/MockItemDefinition.java
@@ -1,18 +1,20 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.sling.testing.mock.jcr;
 
@@ -76,5 +78,4 @@ abstract class MockItemDefinition implements ItemDefinition {
     public boolean isProtected() {
         return this.protectedStatus;
     }
-
 }
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/MockJcr.java b/src/main/java/org/apache/sling/testing/mock/jcr/MockJcr.java
index 76daaf2..cb6896c 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/MockJcr.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/MockJcr.java
@@ -18,10 +18,6 @@
  */
 package org.apache.sling.testing.mock.jcr;
 
-import java.io.Reader;
-import java.util.List;
-import java.util.Objects;
-
 import javax.jcr.NamespaceRegistry;
 import javax.jcr.Node;
 import javax.jcr.Repository;
@@ -33,6 +29,10 @@ import javax.jcr.nodetype.NodeTypeTemplate;
 import javax.jcr.query.QueryManager;
 import javax.jcr.security.AccessControlManager;
 
+import java.io.Reader;
+import java.util.List;
+import java.util.Objects;
+
 import org.apache.commons.lang3.StringUtils;
 import org.apache.jackrabbit.commons.cnd.CompactNodeTypeDefReader;
 import org.apache.jackrabbit.commons.cnd.ParseException;
@@ -90,10 +90,10 @@ public final class MockJcr {
      */
     public static @NotNull Session newSession(@Nullable String userId, @Nullable String workspaceName) {
         try {
-            return newRepository().login(
-                    new SimpleCredentials(Objects.toString(userId, DEFAULT_USER_ID), new char[0]),
-                    Objects.toString(workspaceName, DEFAULT_WORKSPACE)
-            );
+            return newRepository()
+                    .login(
+                            new SimpleCredentials(Objects.toString(userId, DEFAULT_USER_ID), new char[0]),
+                            Objects.toString(workspaceName, DEFAULT_WORKSPACE));
         } catch (RepositoryException ex) {
             throw new RuntimeException("Creating mocked JCR session failed.", ex);
         }
@@ -114,12 +114,11 @@ public final class MockJcr {
      * @param resultList Result list
      * @param simulateUnknownSize true to simulate the result iterator having an unknown size
      */
-    public static void setQueryResult(@NotNull final Session session, @NotNull final List<Node> resultList,
-            boolean simulateUnknownSize) {
+    public static void setQueryResult(
+            @NotNull final Session session, @NotNull final List<Node> resultList, boolean simulateUnknownSize) {
         setQueryResult(getQueryManager(session), resultList, simulateUnknownSize);
     }
 
-
     /**
      * Sets the expected result list for all queries executed with the given query manager.
      * @param queryManager Mocked query manager
@@ -135,7 +134,9 @@ public final class MockJcr {
      * @param resultList Result list
      * @param simulateUnknownSize true to simulate the result iterator having an unknown size
      */
-    public static void setQueryResult(@NotNull final QueryManager queryManager, @NotNull final List<Node> resultList,
+    public static void setQueryResult(
+            @NotNull final QueryManager queryManager,
+            @NotNull final List<Node> resultList,
             boolean simulateUnknownSize) {
         addQueryResultHandler(queryManager, query -> {
             MockQueryResult result = new MockQueryResult(resultList);
@@ -151,8 +152,11 @@ public final class MockJcr {
      * @param language Query language
      * @param resultList Result list
      */
-    public static void setQueryResult(@NotNull final Session session, @NotNull final String statement,
-            @NotNull final String language, @NotNull final List<Node> resultList) {
+    public static void setQueryResult(
+            @NotNull final Session session,
+            @NotNull final String statement,
+            @NotNull final String language,
+            @NotNull final List<Node> resultList) {
         setQueryResult(session, statement, language, resultList, false);
     }
 
@@ -164,8 +168,11 @@ public final class MockJcr {
      * @param resultList Result list
      * @param simulateUnknownSize true to simulate the result iterator having an unknown size
      */
-    public static void setQueryResult(@NotNull final Session session, @NotNull final String statement,
-            @NotNull final String language, @NotNull final List<Node> resultList,
+    public static void setQueryResult(
+            @NotNull final Session session,
+            @NotNull final String statement,
+            @NotNull final String language,
+            @NotNull final List<Node> resultList,
             boolean simulateUnknownSize) {
         setQueryResult(getQueryManager(session), statement, language, resultList, simulateUnknownSize);
     }
@@ -177,8 +184,11 @@ public final class MockJcr {
      * @param language Query language
      * @param resultList Result list
      */
-    public static void setQueryResult(@NotNull final QueryManager queryManager, @NotNull final String statement,
-            @NotNull final String language, @NotNull final List<Node> resultList) {
+    public static void setQueryResult(
+            @NotNull final QueryManager queryManager,
+            @NotNull final String statement,
+            @NotNull final String language,
+            @NotNull final List<Node> resultList) {
         setQueryResult(queryManager, statement, language, resultList, false);
     }
     /**
@@ -189,8 +199,11 @@ public final class MockJcr {
      * @param resultList Result list
      * @param simulateUnknownSize true to simulate the result iterator having an unknown size
      */
-    public static void setQueryResult(@NotNull final QueryManager queryManager, @NotNull final String statement,
-            @NotNull final String language, @NotNull final List<Node> resultList,
+    public static void setQueryResult(
+            @NotNull final QueryManager queryManager,
+            @NotNull final String statement,
+            @NotNull final String language,
+            @NotNull final List<Node> resultList,
             boolean simulateUnknownSize) {
         addQueryResultHandler(queryManager, query -> {
             if (StringUtils.equals(query.getStatement(), statement)
@@ -198,8 +211,7 @@ public final class MockJcr {
                 MockQueryResult mockQueryResult = new MockQueryResult(resultList);
                 mockQueryResult.setSimulateUnknownSize(simulateUnknownSize);
                 return mockQueryResult;
-            }
-            else {
+            } else {
                 return null;
             }
         });
@@ -210,7 +222,8 @@ public final class MockJcr {
      * @param session JCR session
      * @param resultHandler Mock query result handler
      */
-    public static void addQueryResultHandler(@NotNull final Session session, @NotNull final MockQueryResultHandler resultHandler) {
+    public static void addQueryResultHandler(
+            @NotNull final Session session, @NotNull final MockQueryResultHandler resultHandler) {
         addQueryResultHandler(getQueryManager(session), resultHandler);
     }
 
@@ -219,15 +232,15 @@ public final class MockJcr {
      * @param queryManager Mocked query manager
      * @param resultHandler Mock query result handler
      */
-    public static void addQueryResultHandler(@NotNull final QueryManager queryManager, @NotNull final MockQueryResultHandler resultHandler) {
-        ((MockQueryManager)queryManager).addResultHandler(resultHandler);
+    public static void addQueryResultHandler(
+            @NotNull final QueryManager queryManager, @NotNull final MockQueryResultHandler resultHandler) {
+        ((MockQueryManager) queryManager).addResultHandler(resultHandler);
     }
 
     private static @NotNull QueryManager getQueryManager(@NotNull Session session) {
         try {
             return session.getWorkspace().getQueryManager();
-        }
-        catch (RepositoryException ex) {
+        } catch (RepositoryException ex) {
             throw new RuntimeException("Unable to access query manager.", ex);
         }
     }
@@ -242,10 +255,11 @@ public final class MockJcr {
      * @throws ParseException Parse exception
      * @throws RepositoryException Repository exception
      */
-    public static void loadNodeTypeDefs(@NotNull Session session, @NotNull Reader reader) throws ParseException, RepositoryException {
+    public static void loadNodeTypeDefs(@NotNull Session session, @NotNull Reader reader)
+            throws ParseException, RepositoryException {
         // inform the manager to only consider the registered node types
         NodeTypeManager nodeTypeManager = session.getWorkspace().getNodeTypeManager();
-        ((MockNodeTypeManager)nodeTypeManager).setMode(ResolveMode.ONLY_REGISTERED);
+        ((MockNodeTypeManager) nodeTypeManager).setMode(ResolveMode.ONLY_REGISTERED);
 
         MockTemplateBuilderFactory factory = new MockTemplateBuilderFactory(session);
         CompactNodeTypeDefReader<NodeTypeTemplate, NamespaceRegistry> cndReader =
@@ -264,6 +278,6 @@ public final class MockJcr {
      * @param acm the access control manager to use for the session
      */
     public static void setAccessControlManager(@NotNull Session session, @Nullable AccessControlManager acm) {
-        ((MockSession)session).setAccessControlManager(acm);
+        ((MockSession) session).setAccessControlManager(acm);
     }
 }
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/MockNamespaceRegistry.java b/src/main/java/org/apache/sling/testing/mock/jcr/MockNamespaceRegistry.java
index 26763b2..37196c0 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/MockNamespaceRegistry.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/MockNamespaceRegistry.java
@@ -18,11 +18,11 @@
  */
 package org.apache.sling.testing.mock.jcr;
 
-import java.util.Set;
-
 import javax.jcr.NamespaceRegistry;
 import javax.jcr.RepositoryException;
 
+import java.util.Set;
+
 import org.apache.commons.collections4.BidiMap;
 import org.apache.commons.collections4.bidimap.TreeBidiMap;
 
@@ -68,5 +68,4 @@ class MockNamespaceRegistry implements NamespaceRegistry {
         Set<String> values = this.namespacePrefixMapping.values();
         return values.toArray(new String[values.size()]);
     }
-
 }
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/MockNode.java b/src/main/java/org/apache/sling/testing/mock/jcr/MockNode.java
index 485f56e..4b516e1 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/MockNode.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/MockNode.java
@@ -18,14 +18,6 @@
  */
 package org.apache.sling.testing.mock.jcr;
 
-import java.io.InputStream;
-import java.math.BigDecimal;
-import java.util.Arrays;
-import java.util.Calendar;
-import java.util.Objects;
-import java.util.regex.Pattern;
-import java.util.stream.Stream;
-
 import javax.jcr.Binary;
 import javax.jcr.Item;
 import javax.jcr.ItemNotFoundException;
@@ -47,6 +39,14 @@ import javax.jcr.nodetype.PropertyDefinition;
 import javax.jcr.version.Version;
 import javax.jcr.version.VersionHistory;
 
+import java.io.InputStream;
+import java.math.BigDecimal;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.Objects;
+import java.util.regex.Pattern;
+import java.util.stream.Stream;
+
 import org.apache.commons.lang3.StringUtils;
 import org.apache.jackrabbit.JcrConstants;
 import org.apache.jackrabbit.commons.ItemNameMatcher;
@@ -54,7 +54,6 @@ import org.apache.jackrabbit.commons.iterator.NodeIteratorAdapter;
 import org.apache.jackrabbit.commons.iterator.PropertyIteratorAdapter;
 import org.apache.sling.testing.mock.jcr.MockNodeTypeManager.ResolveMode;
 
-
 /**
  * Mock {@link Node} implementation
  */
@@ -84,7 +83,8 @@ class MockNode extends AbstractItem implements Node {
         getMockedSession().addItem(itemData);
         node.setProperty(JcrConstants.JCR_PRIMARYTYPE, primaryNodeTypeName);
 
-        if (((MockNodeTypeManager)getSession().getWorkspace().getNodeTypeManager()).isMode(ResolveMode.ONLY_REGISTERED)) {
+        if (((MockNodeTypeManager) getSession().getWorkspace().getNodeTypeManager())
+                .isMode(ResolveMode.ONLY_REGISTERED)) {
             // auto-add any autocreated children
             NodeDefinition[] childNodeDefinitions = nodeType.getChildNodeDefinitions();
             for (NodeDefinition nodeDefinition : childNodeDefinitions) {
@@ -123,7 +123,7 @@ class MockNode extends AbstractItem implements Node {
     /**
      * Sets a system generated value if the specified property definition is known
      * to need it.
-     * 
+     *
      * @param node the node to set property on
      * @param propDefinition the property definition to consider
      */
@@ -131,8 +131,8 @@ class MockNode extends AbstractItem implements Node {
             throws RepositoryException {
         String name = propDefinition.getName();
         String declaringNT = propDefinition.getDeclaringNodeType().getName();
-        if (JcrConstants.JCR_CREATED.equals(name) &&
-                (MIX_CREATED.equals(declaringNT) || JcrConstants.NT_VERSION.equals(declaringNT))) {
+        if (JcrConstants.JCR_CREATED.equals(name)
+                && (MIX_CREATED.equals(declaringNT) || JcrConstants.NT_VERSION.equals(declaringNT))) {
             // jcr:created property of a version or a mix:created
             node.setProperty(name, Calendar.getInstance());
         } else if (JCR_CREATEDBY.equals(name) && MIX_CREATED.equals(declaringNT)) {
@@ -187,7 +187,6 @@ class MockNode extends AbstractItem implements Node {
         return new NodeIteratorAdapter(items, items.getSize());
     }
 
-
     @Override
     public PropertyIterator getProperties() throws RepositoryException {
         RangeIterator items = getMockedSession().listChildren(getPath(), new ItemFilter() {
@@ -216,7 +215,7 @@ class MockNode extends AbstractItem implements Node {
         RangeIterator items = getMockedSession().listChildren(getPath(), new ItemFilter() {
             @Override
             public boolean accept(final ItemData item) throws RepositoryException {
-            return item.isProperty() && ItemNameMatcher.matches(item.getName(), nameGlobs);
+                return item.isProperty() && ItemNameMatcher.matches(item.getName(), nameGlobs);
             }
         });
         return new PropertyIteratorAdapter(items, items.getSize());
@@ -388,8 +387,7 @@ class MockNode extends AbstractItem implements Node {
     private void addItemOrRemoveIfValueNull(ItemData itemData, Object value) throws RepositoryException {
         if (value == null) {
             getMockedSession().removeItem(itemData.getPath());
-        }
-        else {
+        } else {
             getMockedSession().addItem(itemData);
         }
         this.itemData.setIsChanged(true);
@@ -405,7 +403,8 @@ class MockNode extends AbstractItem implements Node {
         boolean istype = this.itemData.getNodeType().isNodeType(nodeTypeName);
         if (!istype) {
             // SLING-11786 also check the mixin types
-            istype = Arrays.stream(getMixinNodeTypes()).anyMatch(nt -> nt.getName().equals(nodeTypeName));
+            istype = Arrays.stream(getMixinNodeTypes())
+                    .anyMatch(nt -> nt.getName().equals(nodeTypeName));
         }
         return istype;
     }
@@ -435,14 +434,14 @@ class MockNode extends AbstractItem implements Node {
     @Override
     public boolean equals(Object obj) {
         if (obj instanceof MockNode) {
-            return itemData.equals(((MockNode)obj).itemData);
+            return itemData.equals(((MockNode) obj).itemData);
         }
         return false;
     }
 
     @Override
     public NodeType[] getMixinNodeTypes() throws RepositoryException {
-        try{
+        try {
             Value[] mixinNames = getProperty(JcrConstants.JCR_MIXINTYPES).getValues();
             return Arrays.stream(mixinNames)
                     .map(value -> {
@@ -455,14 +454,17 @@ class MockNode extends AbstractItem implements Node {
                     .filter(Objects::nonNull)
                     .map(name -> {
                         try {
-                            return getSession().getWorkspace().getNodeTypeManager().getNodeType(name);
+                            return getSession()
+                                    .getWorkspace()
+                                    .getNodeTypeManager()
+                                    .getNodeType(name);
                         } catch (RepositoryException e) {
                             return null;
                         }
                     })
                     .filter(Objects::nonNull)
                     .toArray(NodeType[]::new);
-        } catch(PathNotFoundException e) {
+        } catch (PathNotFoundException e) {
             // if there are not already mixin types added, return empty array
             return new NodeType[0];
         }
@@ -471,13 +473,14 @@ class MockNode extends AbstractItem implements Node {
     @Override
     public void orderBefore(final String srcChildRelPath, final String destChildRelPath) throws RepositoryException {
         Item srcChild = srcChildRelPath == null ? null : getMockedSession().getItem(getPath() + "/" + srcChildRelPath);
-        Item destChild = destChildRelPath == null ? null : getMockedSession().getItem(getPath() + "/" + destChildRelPath);
+        Item destChild =
+                destChildRelPath == null ? null : getMockedSession().getItem(getPath() + "/" + destChildRelPath);
         getMockedSession().orderBefore(srcChild, destChild);
     }
 
     @Override
     public NodeDefinition getDefinition() throws RepositoryException {
-        if (((MockNodeTypeManager)getSession().getWorkspace().getNodeTypeManager()).isMode(ResolveMode.MOCK_ALL)) {
+        if (((MockNodeTypeManager) getSession().getWorkspace().getNodeTypeManager()).isMode(ResolveMode.MOCK_ALL)) {
             // for backward compatibility
             return new MockNodeDefinition();
         } else {
@@ -499,16 +502,18 @@ class MockNode extends AbstractItem implements Node {
             NodeType nt = parent.getPrimaryNodeType();
             NodeDefinition[] childNodeDefinitions = nt.getChildNodeDefinitions();
             nodeDef = Stream.of(childNodeDefinitions)
-                .filter(def -> name.equals(def.getName()))
-                .findFirst().orElse(null);
+                    .filter(def -> name.equals(def.getName()))
+                    .findFirst()
+                    .orElse(null);
             if (nodeDef == null) {
                 // try the mixins
                 NodeType[] mixinNodeTypes = parent.getMixinNodeTypes();
                 for (NodeType nodeType : mixinNodeTypes) {
                     childNodeDefinitions = nodeType.getChildNodeDefinitions();
                     nodeDef = Stream.of(childNodeDefinitions)
-                        .filter(def -> name.equals(def.getName()))
-                        .findFirst().orElse(null);
+                            .filter(def -> name.equals(def.getName()))
+                            .findFirst()
+                            .orElse(null);
                     if (nodeDef != null) {
                         break;
                     }
@@ -532,20 +537,23 @@ class MockNode extends AbstractItem implements Node {
     @Override
     public void addMixin(final String mixinName) throws RepositoryException {
         if (StringUtils.isNotBlank(mixinName)) {
-            if(!this.hasProperty(JcrConstants.JCR_MIXINTYPES)) {
-                String[] mixinNames = new String[]{mixinName};
+            if (!this.hasProperty(JcrConstants.JCR_MIXINTYPES)) {
+                String[] mixinNames = new String[] {mixinName};
                 setProperty(JcrConstants.JCR_MIXINTYPES, mixinNames);
             } else {
                 Value value = this.getSession().getValueFactory().createValue(mixinName);
                 Value[] newValues = Stream.concat(
-                        Arrays.stream(getProperty(JcrConstants.JCR_MIXINTYPES).getValues()),
-                        Stream.of(value)
-                ).toArray(Value[]::new);
+                                Arrays.stream(
+                                        getProperty(JcrConstants.JCR_MIXINTYPES).getValues()),
+                                Stream.of(value))
+                        .toArray(Value[]::new);
                 this.setProperty(JcrConstants.JCR_MIXINTYPES, newValues);
             }
 
-            if (((MockNodeTypeManager)getSession().getWorkspace().getNodeTypeManager()).isMode(ResolveMode.ONLY_REGISTERED)) {
-                NodeType mixinNodeType = getSession().getWorkspace().getNodeTypeManager().getNodeType(mixinName);
+            if (((MockNodeTypeManager) getSession().getWorkspace().getNodeTypeManager())
+                    .isMode(ResolveMode.ONLY_REGISTERED)) {
+                NodeType mixinNodeType =
+                        getSession().getWorkspace().getNodeTypeManager().getNodeType(mixinName);
                 // auto-add any autocreated children
                 NodeDefinition[] childNodeDefinitions = mixinNodeType.getChildNodeDefinitions();
                 for (NodeDefinition nodeDefinition : childNodeDefinitions) {
@@ -622,7 +630,7 @@ class MockNode extends AbstractItem implements Node {
     }
 
     @Override
-    public Version checkin() throws RepositoryException  {
+    public Version checkin() throws RepositoryException {
         throw new UnsupportedOperationException();
     }
 
@@ -702,7 +710,8 @@ class MockNode extends AbstractItem implements Node {
     }
 
     @Override
-    public void restore(final Version version, final String relPath, final boolean removeExisting) throws RepositoryException {
+    public void restore(final Version version, final String relPath, final boolean removeExisting)
+            throws RepositoryException {
         throw new UnsupportedOperationException();
     }
 
@@ -765,5 +774,4 @@ class MockNode extends AbstractItem implements Node {
     public void accept(ItemVisitor visitor) throws RepositoryException {
         visitor.visit(this);
     }
-
 }
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/MockNodeDefinition.java b/src/main/java/org/apache/sling/testing/mock/jcr/MockNodeDefinition.java
index 570c846..8393b41 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/MockNodeDefinition.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/MockNodeDefinition.java
@@ -18,14 +18,14 @@
  */
 package org.apache.sling.testing.mock.jcr;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import javax.jcr.RepositoryException;
 import javax.jcr.nodetype.NodeDefinition;
 import javax.jcr.nodetype.NodeType;
 import javax.jcr.nodetype.NodeTypeManager;
 
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * Mock {@link NodeDefinition} implementation.
  */
@@ -38,6 +38,7 @@ class MockNodeDefinition extends MockItemDefinition implements NodeDefinition {
         // for backward compatibility
         this(null, null);
     }
+
     public MockNodeDefinition(String declaringNodeTypeName, NodeTypeManager ntMgr) {
         super(declaringNodeTypeName, ntMgr);
     }
@@ -82,5 +83,4 @@ class MockNodeDefinition extends MockItemDefinition implements NodeDefinition {
     public String getDefaultPrimaryTypeName() {
         return this.defaultPrimaryTypeName;
     }
-
 }
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/MockNodeDefinitionTemplate.java b/src/main/java/org/apache/sling/testing/mock/jcr/MockNodeDefinitionTemplate.java
index 65bd3b9..e636d84 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/MockNodeDefinitionTemplate.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/MockNodeDefinitionTemplate.java
@@ -1,18 +1,20 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.sling.testing.mock.jcr;
 
@@ -87,5 +89,4 @@ class MockNodeDefinitionTemplate extends MockNodeDefinition implements NodeDefin
     public void setDeclaringNodeType(String declaringNodeTypeName) {
         this.declaringNodeTypeName = declaringNodeTypeName;
     }
-
 }
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/MockNodeType.java b/src/main/java/org/apache/sling/testing/mock/jcr/MockNodeType.java
index 38e7abe..de18537 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/MockNodeType.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/MockNodeType.java
@@ -18,14 +18,6 @@
  */
 package org.apache.sling.testing.mock.jcr;
 
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.stream.Stream;
-
 import javax.jcr.RepositoryException;
 import javax.jcr.Value;
 import javax.jcr.nodetype.NodeDefinition;
@@ -35,6 +27,14 @@ import javax.jcr.nodetype.NodeTypeIterator;
 import javax.jcr.nodetype.NodeTypeManager;
 import javax.jcr.nodetype.PropertyDefinition;
 
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Stream;
+
 import org.apache.commons.lang3.StringUtils;
 import org.apache.jackrabbit.JcrConstants;
 import org.apache.jackrabbit.commons.iterator.NodeTypeIteratorAdapter;
@@ -91,7 +91,6 @@ class MockNodeType implements NodeType {
         return StringUtils.equals(getName(), JcrConstants.NT_UNSTRUCTURED);
     }
 
-
     // --- unsupported operations ---
     @Override
     public boolean canAddChildNode(final String childNodeName) {
@@ -160,13 +159,15 @@ class MockNodeType implements NodeType {
         if (ntd != null && ntMgr != null) {
             String[] supertypeNames = ntd.getDeclaredSupertypeNames();
             // lookup the NodeTypes from the manager
-            return Stream.of(supertypeNames).map(n -> {
-                try {
-                    return ntMgr.getNodeType(n);
-                } catch (RepositoryException e) {
-                    throw new RuntimeException("Getting declared supertype failed.", e);
-                }
-            }).toArray(NodeType[]::new);
+            return Stream.of(supertypeNames)
+                    .map(n -> {
+                        try {
+                            return ntMgr.getNodeType(n);
+                        } catch (RepositoryException e) {
+                            throw new RuntimeException("Getting declared supertype failed.", e);
+                        }
+                    })
+                    .toArray(NodeType[]::new);
         }
         throw new UnsupportedOperationException();
     }
@@ -253,7 +254,7 @@ class MockNodeType implements NodeType {
 
     @Override
     public NodeTypeIterator getDeclaredSubtypes() {
-        if (ntMgr != null && ((MockNodeTypeManager)ntMgr).isMode(ResolveMode.MOCK_ALL)) {
+        if (ntMgr != null && ((MockNodeTypeManager) ntMgr).isMode(ResolveMode.MOCK_ALL)) {
             throw new UnsupportedOperationException();
         }
         List<NodeType> subtypes = new ArrayList<>();
@@ -262,7 +263,8 @@ class MockNodeType implements NodeType {
                 NodeTypeIterator allNodeTypes = ntMgr.getAllNodeTypes();
                 while (allNodeTypes.hasNext()) {
                     NodeType nextNodeType = allNodeTypes.nextNodeType();
-                    boolean issubtype = Stream.of(nextNodeType.getDeclaredSupertypes()).anyMatch(nt -> nt.getName().equals(getName()));
+                    boolean issubtype = Stream.of(nextNodeType.getDeclaredSupertypes())
+                            .anyMatch(nt -> nt.getName().equals(getName()));
                     if (issubtype) {
                         subtypes.add(nextNodeType);
                     }
@@ -276,7 +278,7 @@ class MockNodeType implements NodeType {
 
     @Override
     public NodeTypeIterator getSubtypes() {
-        if (ntMgr != null && ((MockNodeTypeManager)ntMgr).isMode(ResolveMode.MOCK_ALL)) {
+        if (ntMgr != null && ((MockNodeTypeManager) ntMgr).isMode(ResolveMode.MOCK_ALL)) {
             throw new UnsupportedOperationException();
         }
         List<NodeType> subtypes = new ArrayList<>();
@@ -285,7 +287,8 @@ class MockNodeType implements NodeType {
                 NodeTypeIterator allNodeTypes = ntMgr.getAllNodeTypes();
                 while (allNodeTypes.hasNext()) {
                     NodeType nextNodeType = allNodeTypes.nextNodeType();
-                    boolean issubtype = Stream.of(nextNodeType.getSupertypes()).anyMatch(nt -> nt.getName().equals(getName()));
+                    boolean issubtype = Stream.of(nextNodeType.getSupertypes())
+                            .anyMatch(nt -> nt.getName().equals(getName()));
                     if (issubtype) {
                         subtypes.add(nextNodeType);
                     }
@@ -329,5 +332,4 @@ class MockNodeType implements NodeType {
         builder.append("]");
         return builder.toString();
     }
-
 }
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/MockNodeTypeManager.java b/src/main/java/org/apache/sling/testing/mock/jcr/MockNodeTypeManager.java
index 2610ed0..9f5c988 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/MockNodeTypeManager.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/MockNodeTypeManager.java
@@ -18,12 +18,6 @@
  */
 package org.apache.sling.testing.mock.jcr;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
 import javax.jcr.RepositoryException;
 import javax.jcr.nodetype.NoSuchNodeTypeException;
 import javax.jcr.nodetype.NodeDefinitionTemplate;
@@ -35,6 +29,12 @@ import javax.jcr.nodetype.NodeTypeManager;
 import javax.jcr.nodetype.NodeTypeTemplate;
 import javax.jcr.nodetype.PropertyDefinitionTemplate;
 
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
 import org.apache.jackrabbit.commons.iterator.NodeTypeIteratorAdapter;
 
 /**
@@ -53,7 +53,7 @@ class MockNodeTypeManager implements NodeTypeManager {
 
     /**
      * Sets how the node types are resolved
-     * 
+     *
      * @param mode the mode to use
      */
     public void setMode(ResolveMode mode) {
@@ -102,8 +102,7 @@ class MockNodeTypeManager implements NodeTypeManager {
             throw new UnsupportedOperationException();
         }
 
-        List<NodeType> mixins = registeredNTs.values().stream()
-                .collect(Collectors.toList());
+        List<NodeType> mixins = registeredNTs.values().stream().collect(Collectors.toList());
         return new NodeTypeIteratorAdapter(mixins);
     }
 
@@ -113,9 +112,8 @@ class MockNodeTypeManager implements NodeTypeManager {
             throw new UnsupportedOperationException();
         }
 
-        List<NodeType> notMixins = registeredNTs.values().stream()
-                .filter(nt -> !nt.isMixin())
-                .collect(Collectors.toList());
+        List<NodeType> notMixins =
+                registeredNTs.values().stream().filter(nt -> !nt.isMixin()).collect(Collectors.toList());
         return new NodeTypeIteratorAdapter(notMixins);
     }
 
@@ -125,9 +123,8 @@ class MockNodeTypeManager implements NodeTypeManager {
             throw new UnsupportedOperationException();
         }
 
-        List<NodeType> mixins = registeredNTs.values().stream()
-            .filter(NodeType::isMixin)
-            .collect(Collectors.toList());
+        List<NodeType> mixins =
+                registeredNTs.values().stream().filter(NodeType::isMixin).collect(Collectors.toList());
         return new NodeTypeIteratorAdapter(mixins);
     }
 
@@ -175,11 +172,12 @@ class MockNodeTypeManager implements NodeTypeManager {
     }
 
     @Override
-    public NodeTypeIterator registerNodeTypes(NodeTypeDefinition[] ntds, boolean allowUpdate) throws RepositoryException {
+    public NodeTypeIterator registerNodeTypes(NodeTypeDefinition[] ntds, boolean allowUpdate)
+            throws RepositoryException {
         if (ResolveMode.MOCK_ALL.equals(this.mode)) {
             throw new UnsupportedOperationException();
         }
-        List<NodeType> registered = new ArrayList<>(); 
+        List<NodeType> registered = new ArrayList<>();
         for (NodeTypeDefinition ntd : ntds) {
             if (!allowUpdate && registeredNTs.containsKey(ntd.getName())) {
                 throw new NodeTypeExistsException(String.format(NODETYPE_ALREADY_EXISTS, ntd.getName()));
@@ -214,5 +212,4 @@ class MockNodeTypeManager implements NodeTypeManager {
             registeredNTs.remove(name);
         }
     }
-
 }
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/MockNodeTypeTemplate.java b/src/main/java/org/apache/sling/testing/mock/jcr/MockNodeTypeTemplate.java
index acaaec4..8a2fa6c 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/MockNodeTypeTemplate.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/MockNodeTypeTemplate.java
@@ -1,24 +1,23 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.sling.testing.mock.jcr;
 
-import java.util.LinkedList;
-import java.util.List;
-
 import javax.jcr.nodetype.ConstraintViolationException;
 import javax.jcr.nodetype.NodeDefinition;
 import javax.jcr.nodetype.NodeDefinitionTemplate;
@@ -28,6 +27,9 @@ import javax.jcr.nodetype.NodeTypeTemplate;
 import javax.jcr.nodetype.PropertyDefinition;
 import javax.jcr.nodetype.PropertyDefinitionTemplate;
 
+import java.util.LinkedList;
+import java.util.List;
+
 /**
  *
  */
@@ -114,8 +116,7 @@ class MockNodeTypeTemplate implements NodeTypeTemplate {
         if (propertyDefinitionTemplates == null) {
             return null; // NOSONAR
         } else {
-            return propertyDefinitionTemplates.toArray(
-                    new PropertyDefinition[propertyDefinitionTemplates.size()]);
+            return propertyDefinitionTemplates.toArray(new PropertyDefinition[propertyDefinitionTemplates.size()]);
         }
     }
 
@@ -124,8 +125,7 @@ class MockNodeTypeTemplate implements NodeTypeTemplate {
         if (nodeDefinitionTemplates == null) {
             return null; // NOSONAR
         } else {
-            return nodeDefinitionTemplates.toArray(
-                    new NodeDefinition[nodeDefinitionTemplates.size()]);
+            return nodeDefinitionTemplates.toArray(new NodeDefinition[nodeDefinitionTemplates.size()]);
         }
     }
 
@@ -179,5 +179,4 @@ class MockNodeTypeTemplate implements NodeTypeTemplate {
         }
         return nodeDefinitionTemplates;
     }
-
 }
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/MockNodeTypes.java b/src/main/java/org/apache/sling/testing/mock/jcr/MockNodeTypes.java
index 1b081b6..5e91ab0 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/MockNodeTypes.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/MockNodeTypes.java
@@ -45,5 +45,4 @@ public final class MockNodeTypes {
      * Node type NT_FILE
      */
     public static final NodeType NT_FILE = new MockNodeType(JcrConstants.NT_FILE);
-
 }
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/MockObservationManager.java b/src/main/java/org/apache/sling/testing/mock/jcr/MockObservationManager.java
index af522b4..21efd5f 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/MockObservationManager.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/MockObservationManager.java
@@ -18,14 +18,14 @@
  */
 package org.apache.sling.testing.mock.jcr;
 
-import java.util.Collections;
-
 import javax.jcr.RepositoryException;
 import javax.jcr.observation.EventJournal;
 import javax.jcr.observation.EventListener;
 import javax.jcr.observation.EventListenerIterator;
 import javax.jcr.observation.ObservationManager;
 
+import java.util.Collections;
+
 import org.apache.jackrabbit.api.observation.JackrabbitEventFilter;
 import org.apache.jackrabbit.api.observation.JackrabbitObservationManager;
 
@@ -35,8 +35,14 @@ import org.apache.jackrabbit.api.observation.JackrabbitObservationManager;
 class MockObservationManager implements ObservationManager, JackrabbitObservationManager {
 
     @Override
-    public void addEventListener(final EventListener listener, final int eventTypes, final String absPath,
-            final boolean isDeep, final String[] uuid, final String[] nodeTypeName, final boolean noLocal)
+    public void addEventListener(
+            final EventListener listener,
+            final int eventTypes,
+            final String absPath,
+            final boolean isDeep,
+            final String[] uuid,
+            final String[] nodeTypeName,
+            final boolean noLocal)
             throws RepositoryException {
         // do nothing
     }
@@ -68,10 +74,14 @@ class MockObservationManager implements ObservationManager, JackrabbitObservatio
     }
 
     @Override
-    public EventJournal getEventJournal(final int eventTypes, final String absPath, final boolean isDeep,
-            final String[] uuid, final String[] nodeTypeName) throws RepositoryException {
+    public EventJournal getEventJournal(
+            final int eventTypes,
+            final String absPath,
+            final boolean isDeep,
+            final String[] uuid,
+            final String[] nodeTypeName)
+            throws RepositoryException {
         // always return null
         return null;
     }
-
 }
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/MockPrincipalManager.java b/src/main/java/org/apache/sling/testing/mock/jcr/MockPrincipalManager.java
index 49ad0e5..2103065 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/MockPrincipalManager.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/MockPrincipalManager.java
@@ -1,29 +1,31 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.sling.testing.mock.jcr;
 
+import javax.jcr.RepositoryException;
+
 import java.security.Principal;
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Set;
 
-import javax.jcr.RepositoryException;
-
 import org.apache.jackrabbit.api.security.principal.PrincipalIterator;
 import org.apache.jackrabbit.api.security.principal.PrincipalManager;
 import org.apache.jackrabbit.api.security.user.Authorizable;
@@ -57,8 +59,9 @@ public class MockPrincipalManager implements PrincipalManager {
     public @NotNull PrincipalIterator findPrincipals(@Nullable String simpleFilter, int searchType) {
         Set<Principal> principals = new HashSet<>();
         try {
-            @NotNull Iterator<Authorizable> authorizables = mockUserManager.findAuthorizables(
-                    UserConstants.REP_PRINCIPAL_NAME, simpleFilter, searchType);
+            @NotNull
+            Iterator<Authorizable> authorizables =
+                    mockUserManager.findAuthorizables(UserConstants.REP_PRINCIPAL_NAME, simpleFilter, searchType);
             while (authorizables.hasNext()) {
                 Authorizable next = authorizables.next();
                 principals.add(next.getPrincipal());
@@ -82,7 +85,7 @@ public class MockPrincipalManager implements PrincipalManager {
         Set<Principal> groups = new HashSet<>();
         try {
             @Nullable Authorizable authorizable = mockUserManager.getAuthorizable(principal);
-            if (authorizable  != null) {
+            if (authorizable != null) {
                 @NotNull Iterator<Group> memberOf = authorizable.memberOf();
                 while (memberOf.hasNext()) {
                     groups.add(memberOf.next().getPrincipal());
@@ -139,9 +142,8 @@ public class MockPrincipalManager implements PrincipalManager {
 
         @Override
         public @NotNull Principal nextPrincipal() {
-            return (Principal)next();
+            return (Principal) next();
         }
-
     }
 
     @Override
@@ -157,5 +159,4 @@ public class MockPrincipalManager implements PrincipalManager {
         }
         return value;
     }
-
 }
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/MockProperty.java b/src/main/java/org/apache/sling/testing/mock/jcr/MockProperty.java
index ae2ab11..0249057 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/MockProperty.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/MockProperty.java
@@ -18,11 +18,6 @@
  */
 package org.apache.sling.testing.mock.jcr;
 
-import java.io.InputStream;
-import java.math.BigDecimal;
-import java.util.Arrays;
-import java.util.Calendar;
-
 import javax.jcr.Binary;
 import javax.jcr.ItemVisitor;
 import javax.jcr.Node;
@@ -35,6 +30,11 @@ import javax.jcr.ValueFormatException;
 import javax.jcr.nodetype.NodeType;
 import javax.jcr.nodetype.PropertyDefinition;
 
+import java.io.InputStream;
+import java.math.BigDecimal;
+import java.util.Arrays;
+import java.util.Calendar;
+
 import org.apache.jackrabbit.value.BinaryValue;
 
 /**
@@ -46,9 +46,9 @@ class MockProperty extends AbstractItem implements Property {
         super(itemData, session);
         if (this.itemData.getValues() == null) {
             try {
-                this.itemData.setValues(new Value[] { getSession().getValueFactory().createValue("") });
-            }
-            catch (RepositoryException ex) {
+                this.itemData.setValues(
+                        new Value[] {getSession().getValueFactory().createValue("")});
+            } catch (RepositoryException ex) {
                 throw new RuntimeException("Initializing property failed.", ex);
             }
         }
@@ -56,8 +56,8 @@ class MockProperty extends AbstractItem implements Property {
 
     private Value internalGetValue() throws RepositoryException {
         if (this.itemData.isMultiple()) {
-            throw new ValueFormatException(this
-                    + " is a multi-valued property, so it's values can only be retrieved as an array");
+            throw new ValueFormatException(
+                    this + " is a multi-valued property, so it's values can only be retrieved as an array");
         } else {
             return this.itemData.getValues()[0];
         }
@@ -82,7 +82,7 @@ class MockProperty extends AbstractItem implements Property {
         if (removePropertyIfValueNull(newValue)) {
             return;
         }
-        this.itemData.setValues(new Value[] { newValue });
+        this.itemData.setValues(new Value[] {newValue});
         this.itemData.setMultiple(false);
     }
 
@@ -91,7 +91,7 @@ class MockProperty extends AbstractItem implements Property {
         if (removePropertyIfValueNull(newValues)) {
             return;
         }
-        Value[] values =  Arrays.copyOf(newValues, newValues.length);
+        Value[] values = Arrays.copyOf(newValues, newValues.length);
         this.itemData.setValues(values);
         this.itemData.setMultiple(true);
     }
@@ -101,7 +101,7 @@ class MockProperty extends AbstractItem implements Property {
         if (removePropertyIfValueNull(newValue)) {
             return;
         }
-        this.itemData.setValues(new Value[] { getSession().getValueFactory().createValue(newValue) });
+        this.itemData.setValues(new Value[] {getSession().getValueFactory().createValue(newValue)});
         this.itemData.setMultiple(false);
     }
 
@@ -123,19 +123,19 @@ class MockProperty extends AbstractItem implements Property {
         if (removePropertyIfValueNull(newValue)) {
             return;
         }
-        this.itemData.setValues(new Value[] { new BinaryValue(newValue) });
+        this.itemData.setValues(new Value[] {new BinaryValue(newValue)});
         this.itemData.setMultiple(false);
     }
 
     @Override
     public void setValue(final long newValue) throws RepositoryException {
-        this.itemData.setValues(new Value[] { getSession().getValueFactory().createValue(newValue) });
+        this.itemData.setValues(new Value[] {getSession().getValueFactory().createValue(newValue)});
         this.itemData.setMultiple(false);
     }
 
     @Override
     public void setValue(final double newValue) throws RepositoryException {
-        this.itemData.setValues(new Value[] { getSession().getValueFactory().createValue(newValue) });
+        this.itemData.setValues(new Value[] {getSession().getValueFactory().createValue(newValue)});
         this.itemData.setMultiple(false);
     }
 
@@ -144,13 +144,13 @@ class MockProperty extends AbstractItem implements Property {
         if (removePropertyIfValueNull(newValue)) {
             return;
         }
-        this.itemData.setValues(new Value[] { getSession().getValueFactory().createValue(newValue) });
+        this.itemData.setValues(new Value[] {getSession().getValueFactory().createValue(newValue)});
         this.itemData.setMultiple(false);
     }
 
     @Override
     public void setValue(final boolean newValue) throws RepositoryException {
-        this.itemData.setValues(new Value[] { getSession().getValueFactory().createValue(newValue) });
+        this.itemData.setValues(new Value[] {getSession().getValueFactory().createValue(newValue)});
         this.itemData.setMultiple(false);
     }
 
@@ -159,7 +159,7 @@ class MockProperty extends AbstractItem implements Property {
         if (removePropertyIfValueNull(newValue)) {
             return;
         }
-        this.itemData.setValues(new Value[] { getSession().getValueFactory().createValue(newValue) });
+        this.itemData.setValues(new Value[] {getSession().getValueFactory().createValue(newValue)});
         this.itemData.setMultiple(false);
     }
 
@@ -168,7 +168,7 @@ class MockProperty extends AbstractItem implements Property {
         if (removePropertyIfValueNull(newValue)) {
             return;
         }
-        this.itemData.setValues(new Value[] { new BinaryValue(newValue) });
+        this.itemData.setValues(new Value[] {new BinaryValue(newValue)});
         this.itemData.setMultiple(false);
     }
 
@@ -177,7 +177,7 @@ class MockProperty extends AbstractItem implements Property {
         if (removePropertyIfValueNull(newValue)) {
             return;
         }
-        this.itemData.setValues(new Value[] { getSession().getValueFactory().createValue(newValue) });
+        this.itemData.setValues(new Value[] {getSession().getValueFactory().createValue(newValue)});
         this.itemData.setMultiple(false);
     }
 
@@ -240,8 +240,7 @@ class MockProperty extends AbstractItem implements Property {
     public int getType() throws RepositoryException {
         if (this.itemData.getValues().length > 0) {
             return this.itemData.getValues()[0].getType();
-        }
-        else {
+        } else {
             return PropertyType.UNDEFINED;
         }
     }
@@ -291,7 +290,7 @@ class MockProperty extends AbstractItem implements Property {
     @Override
     public boolean equals(Object obj) {
         if (obj instanceof MockProperty) {
-            return itemData.equals(((MockProperty)obj).itemData);
+            return itemData.equals(((MockProperty) obj).itemData);
         }
         return false;
     }
@@ -374,7 +373,5 @@ class MockProperty extends AbstractItem implements Property {
         public String[] getAvailableQueryOperators() {
             throw new UnsupportedOperationException();
         }
-
     }
-
 }
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/MockPropertyDefinition.java b/src/main/java/org/apache/sling/testing/mock/jcr/MockPropertyDefinition.java
index cc5ad90..a8ac14c 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/MockPropertyDefinition.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/MockPropertyDefinition.java
@@ -1,18 +1,20 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.sling.testing.mock.jcr;
 
@@ -70,5 +72,4 @@ class MockPropertyDefinition extends MockItemDefinition implements PropertyDefin
     public boolean isQueryOrderable() {
         return queryOrderable;
     }
-
 }
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/MockPropertyDefinitionTemplate.java b/src/main/java/org/apache/sling/testing/mock/jcr/MockPropertyDefinitionTemplate.java
index b79939a..9e2b83a 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/MockPropertyDefinitionTemplate.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/MockPropertyDefinitionTemplate.java
@@ -1,18 +1,20 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.sling.testing.mock.jcr;
 
@@ -31,7 +33,8 @@ class MockPropertyDefinitionTemplate extends MockPropertyDefinition implements P
         super(declaringNodeTypeName, ntMgr);
     }
 
-    public MockPropertyDefinitionTemplate(String declaringNodeTypeName, NodeTypeManager ntMgr, PropertyDefinition propDef) {
+    public MockPropertyDefinitionTemplate(
+            String declaringNodeTypeName, NodeTypeManager ntMgr, PropertyDefinition propDef) {
         this(declaringNodeTypeName, ntMgr);
         // copy ctor
         this.type = propDef.getRequiredType();
@@ -106,5 +109,4 @@ class MockPropertyDefinitionTemplate extends MockPropertyDefinition implements P
     public void setDeclaringNodeType(String declaringNodeTypeName) {
         this.declaringNodeTypeName = declaringNodeTypeName;
     }
-
 }
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/MockQuery.java b/src/main/java/org/apache/sling/testing/mock/jcr/MockQuery.java
index 566fa39..83208f5 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/MockQuery.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/MockQuery.java
@@ -18,17 +18,17 @@
  */
 package org.apache.sling.testing.mock.jcr;
 
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.Value;
 import javax.jcr.query.Query;
 import javax.jcr.query.QueryResult;
 
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
 import org.osgi.annotation.versioning.ConsumerType;
 
 /**
@@ -43,7 +43,7 @@ public final class MockQuery implements Query {
 
     private long limit;
     private long offset;
-    private Map<String,Value> variables = new HashMap<String, Value>();
+    private Map<String, Value> variables = new HashMap<String, Value>();
 
     MockQuery(MockQueryManager queryManager, String statement, String language) {
         this.queryManager = queryManager;
@@ -86,7 +86,7 @@ public final class MockQuery implements Query {
 
     @Override
     public void bindValue(String varName, Value value) throws RepositoryException {
-        variables.put(varName,  value);
+        variables.put(varName, value);
     }
 
     @Override
@@ -99,7 +99,6 @@ public final class MockQuery implements Query {
         return Collections.unmodifiableMap(variables);
     }
 
-
     // --- unsupported operations ---
 
     @Override
@@ -111,5 +110,4 @@ public final class MockQuery implements Query {
     public Node storeAsNode(String absPath) throws RepositoryException {
         throw new UnsupportedOperationException();
     }
-
 }
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/MockQueryManager.java b/src/main/java/org/apache/sling/testing/mock/jcr/MockQueryManager.java
index 83bb8a3..b0bcfdf 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/MockQueryManager.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/MockQueryManager.java
@@ -18,12 +18,6 @@
  */
 package org.apache.sling.testing.mock.jcr;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.query.InvalidQueryException;
@@ -32,6 +26,12 @@ import javax.jcr.query.QueryManager;
 import javax.jcr.query.QueryResult;
 import javax.jcr.query.qom.QueryObjectModelFactory;
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
 import org.apache.commons.lang3.StringUtils;
 
 /**
@@ -42,12 +42,8 @@ class MockQueryManager implements QueryManager {
     private List<MockQueryResultHandler> resultHandlers = new ArrayList<MockQueryResultHandler>();
 
     @SuppressWarnings("deprecation")
-    private static final List<String> SUPPORTED_QUERY_LANGUAGES = Stream.of(
-      Query.JCR_SQL2,
-      Query.JCR_JQOM,
-      Query.XPATH,
-      Query.SQL
-    ).collect(Collectors.toList());
+    private static final List<String> SUPPORTED_QUERY_LANGUAGES =
+            Stream.of(Query.JCR_SQL2, Query.JCR_JQOM, Query.XPATH, Query.SQL).collect(Collectors.toList());
 
     @Override
     public Query createQuery(String statement, String language) throws RepositoryException {
@@ -88,5 +84,4 @@ class MockQueryManager implements QueryManager {
     public Query getQuery(Node node) throws RepositoryException {
         throw new UnsupportedOperationException();
     }
-
 }
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/MockQueryResult.java b/src/main/java/org/apache/sling/testing/mock/jcr/MockQueryResult.java
index f0099ae..bd6fcf0 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/MockQueryResult.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/MockQueryResult.java
@@ -18,15 +18,15 @@
  */
 package org.apache.sling.testing.mock.jcr;
 
-import java.util.Collections;
-import java.util.List;
-
 import javax.jcr.Node;
 import javax.jcr.NodeIterator;
 import javax.jcr.RepositoryException;
 import javax.jcr.query.QueryResult;
 import javax.jcr.query.RowIterator;
 
+import java.util.Collections;
+import java.util.List;
+
 import org.apache.jackrabbit.commons.iterator.NodeIteratorAdapter;
 import org.apache.jackrabbit.commons.iterator.RowIteratorAdapter;
 import org.osgi.annotation.versioning.ProviderType;
@@ -63,9 +63,8 @@ public final class MockQueryResult implements QueryResult {
 
     @Override
     public RowIterator getRows() throws RepositoryException {
-        return new RowIteratorAdapter(nodes.stream()
-                .map(node -> new MockRow(columnNames, node))
-                .iterator());
+        return new RowIteratorAdapter(
+                nodes.stream().map(node -> new MockRow(columnNames, node)).iterator());
     }
 
     @Override
@@ -81,5 +80,4 @@ public final class MockQueryResult implements QueryResult {
     public String[] getSelectorNames() throws RepositoryException {
         return new String[0];
     }
-
 }
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/MockQueryResultHandler.java b/src/main/java/org/apache/sling/testing/mock/jcr/MockQueryResultHandler.java
index b941804..0dfcba8 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/MockQueryResultHandler.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/MockQueryResultHandler.java
@@ -33,5 +33,4 @@ public interface MockQueryResultHandler {
      *   If not, null is returned and other handlers are asked to provide a result.
      */
     MockQueryResult executeQuery(MockQuery query);
-
 }
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/MockRepository.java b/src/main/java/org/apache/sling/testing/mock/jcr/MockRepository.java
index 1945093..2893b4e 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/MockRepository.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/MockRepository.java
@@ -18,10 +18,6 @@
  */
 package org.apache.sling.testing.mock.jcr;
 
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Objects;
-
 import javax.jcr.Credentials;
 import javax.jcr.NamespaceRegistry;
 import javax.jcr.Repository;
@@ -32,6 +28,10 @@ import javax.jcr.Value;
 import javax.jcr.nodetype.NodeTypeManager;
 import javax.jcr.observation.ObservationManager;
 
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Objects;
+
 import org.apache.commons.lang3.ArrayUtils;
 
 /**
@@ -71,9 +71,11 @@ class MockRepository implements Repository {
     public Session login(final Credentials credentials, final String workspaceName) throws RepositoryException {
         String userId = null;
         if (credentials instanceof SimpleCredentials) {
-            userId = ((SimpleCredentials)credentials).getUserID();
+            userId = ((SimpleCredentials) credentials).getUserID();
         }
-        return new MockSession(this, items,
+        return new MockSession(
+                this,
+                items,
                 Objects.toString(userId, MockJcr.DEFAULT_USER_ID),
                 Objects.toString(workspaceName, MockJcr.DEFAULT_WORKSPACE));
     }
@@ -119,5 +121,4 @@ class MockRepository implements Repository {
     NodeTypeManager getNodeTypeManager() {
         return nodeTypeManager;
     }
-
 }
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/MockRow.java b/src/main/java/org/apache/sling/testing/mock/jcr/MockRow.java
index 7fc3d6a..4e6f593 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/MockRow.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/MockRow.java
@@ -18,8 +18,6 @@
  */
 package org.apache.sling.testing.mock.jcr;
 
-import java.util.List;
-
 import javax.jcr.ItemNotFoundException;
 import javax.jcr.Node;
 import javax.jcr.PathNotFoundException;
@@ -27,6 +25,8 @@ import javax.jcr.RepositoryException;
 import javax.jcr.Value;
 import javax.jcr.query.Row;
 
+import java.util.List;
+
 /**
  * Mock implementation of {@link Row}.
  */
@@ -46,8 +46,7 @@ class MockRow implements Row {
         for (int i = 0; i < values.length; i++) {
             try {
                 values[i] = getValue(columnNames.get(i));
-            }
-            catch (PathNotFoundException ex) {
+            } catch (PathNotFoundException ex) {
                 values[i] = null;
             }
         }
@@ -88,5 +87,4 @@ class MockRow implements Row {
     public double getScore(String selectorName) throws RepositoryException {
         return 0;
     }
-
 }
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/MockSession.java b/src/main/java/org/apache/sling/testing/mock/jcr/MockSession.java
index b461638..0f1e681 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/MockSession.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/MockSession.java
@@ -18,18 +18,6 @@
  */
 package org.apache.sling.testing.mock.jcr;
 
-import static java.util.Objects.requireNonNull;
-
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.regex.Pattern;
-
 import javax.jcr.Credentials;
 import javax.jcr.Item;
 import javax.jcr.ItemExistsException;
@@ -46,6 +34,16 @@ import javax.jcr.Workspace;
 import javax.jcr.retention.RetentionManager;
 import javax.jcr.security.AccessControlManager;
 
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.regex.Pattern;
+
 import org.apache.commons.lang3.StringUtils;
 import org.apache.jackrabbit.api.JackrabbitSession;
 import org.apache.jackrabbit.api.security.principal.PrincipalManager;
@@ -55,6 +53,8 @@ import org.apache.jackrabbit.value.ValueFactoryImpl;
 import org.jetbrains.annotations.NotNull;
 import org.xml.sax.ContentHandler;
 
+import static java.util.Objects.requireNonNull;
+
 /**
  * Mock {@link Session} implementation. This instance holds the JCR data in a
  * simple ordered map.
@@ -71,8 +71,8 @@ class MockSession implements Session, JackrabbitSession {
     private MockUserManager userManager;
     private AccessControlManager accessControlManager = null;
 
-    public MockSession(MockRepository repository, Map<String, ItemData> items,
-            String userId, String workspaceName) throws RepositoryException {
+    public MockSession(MockRepository repository, Map<String, ItemData> items, String userId, String workspaceName)
+            throws RepositoryException {
         this.repository = repository;
         this.workspace = new MockWorkspace(repository, this, workspaceName);
         this.userManager = new MockUserManager(this);
@@ -104,8 +104,7 @@ class MockSession implements Session, JackrabbitSession {
         if (itemData != null) {
             if (itemData.isNode()) {
                 return new MockNode(itemData, this);
-            }
-            else {
+            } else {
                 return new MockProperty(itemData, this);
             }
         } else {
@@ -218,7 +217,7 @@ class MockSession implements Session, JackrabbitSession {
     RangeIterator listChildren(final String parentPath, final ItemFilter filter) throws RepositoryException {
         List<Item> children = new ArrayList<Item>();
 
-        //remove trailing slash or make root path / empty string
+        // remove trailing slash or make root path / empty string
         final String path = parentPath.replaceFirst("/$", "");
 
         // build regex pattern for all child paths of parent
@@ -270,7 +269,6 @@ class MockSession implements Session, JackrabbitSession {
         }
     }
 
-
     @Override
     public boolean hasPendingChanges() throws RepositoryException {
         checkLive();
@@ -350,9 +348,9 @@ class MockSession implements Session, JackrabbitSession {
         // do nothing
         checkLive();
 
-        if (!keepChanges){
-            //if reverting change instruction has been requested,
-            //warn upper user this won't happen
+        if (!keepChanges) {
+            // if reverting change instruction has been requested,
+            // warn upper user this won't happen
             throw new UnsupportedOperationException();
         }
     }
@@ -383,7 +381,6 @@ class MockSession implements Session, JackrabbitSession {
         return new String[0];
     }
 
-
     // --- unsupported operations ---
     @Override
     public void addLockToken(final String lt) {
@@ -391,31 +388,42 @@ class MockSession implements Session, JackrabbitSession {
     }
 
     @Override
-    public void exportDocumentView(final String absPath, final ContentHandler contentHandler, final boolean skipBinary,
-            final boolean noRecurse) throws RepositoryException {
+    public void exportDocumentView(
+            final String absPath,
+            final ContentHandler contentHandler,
+            final boolean skipBinary,
+            final boolean noRecurse)
+            throws RepositoryException {
         throw new UnsupportedOperationException();
     }
 
     @Override
-    public void exportDocumentView(final String absPath, final OutputStream out, final boolean skipBinary,
-            final boolean noRecurse) throws RepositoryException {
+    public void exportDocumentView(
+            final String absPath, final OutputStream out, final boolean skipBinary, final boolean noRecurse)
+            throws RepositoryException {
         throw new UnsupportedOperationException();
     }
 
     @Override
-    public void exportSystemView(final String absPath, final ContentHandler contentHandler, final boolean skipBinary,
-            final boolean noRecurse) throws RepositoryException {
+    public void exportSystemView(
+            final String absPath,
+            final ContentHandler contentHandler,
+            final boolean skipBinary,
+            final boolean noRecurse)
+            throws RepositoryException {
         throw new UnsupportedOperationException();
     }
 
     @Override
-    public void exportSystemView(final String absPath, final OutputStream out, final boolean skipBinary,
-            final boolean noRecurse) throws RepositoryException {
+    public void exportSystemView(
+            final String absPath, final OutputStream out, final boolean skipBinary, final boolean noRecurse)
+            throws RepositoryException {
         throw new UnsupportedOperationException();
     }
 
     @Override
-    public ContentHandler getImportContentHandler(final String parentAbsPath, final int uuidBehavior) throws RepositoryException {
+    public ContentHandler getImportContentHandler(final String parentAbsPath, final int uuidBehavior)
+            throws RepositoryException {
         throw new UnsupportedOperationException();
     }
 
@@ -430,7 +438,8 @@ class MockSession implements Session, JackrabbitSession {
     }
 
     @Override
-    public void importXML(final String parentAbsPath, final InputStream in, final int uuidBehavior) throws RepositoryException {
+    public void importXML(final String parentAbsPath, final InputStream in, final int uuidBehavior)
+            throws RepositoryException {
         throw new UnsupportedOperationException();
     }
 
@@ -445,8 +454,10 @@ class MockSession implements Session, JackrabbitSession {
             throw new RepositoryException("The destination path must not have an index on its final element");
         }
 
-        if (nodeExists(destAbsPath) &&
-                !"true".equals(getRepository().getDescriptor(Repository.NODE_TYPE_MANAGEMENT_SAME_NAME_SIBLINGS_SUPPORTED))) {
+        if (nodeExists(destAbsPath)
+                && !"true"
+                        .equals(getRepository()
+                                .getDescriptor(Repository.NODE_TYPE_MANAGEMENT_SAME_NAME_SIBLINGS_SUPPORTED))) {
             throw new ItemExistsException("The destination path already exists");
         }
         String destParentPath = ResourceUtil.getParent(destAbsPath);
@@ -502,7 +513,8 @@ class MockSession implements Session, JackrabbitSession {
     }
 
     @Override
-    public boolean hasCapability(final String methodName, final Object target, final Object[] arguments) throws RepositoryException {
+    public boolean hasCapability(final String methodName, final Object target, final Object[] arguments)
+            throws RepositoryException {
         throw new UnsupportedOperationException();
     }
 
@@ -511,7 +523,6 @@ class MockSession implements Session, JackrabbitSession {
         throw new UnsupportedOperationException();
     }
 
-
     // --- jackrabbit session operations ---
 
     @Override
@@ -542,14 +553,12 @@ class MockSession implements Session, JackrabbitSession {
     }
 
     @Override
-    public PrincipalManager getPrincipalManager()
-            throws RepositoryException {
+    public PrincipalManager getPrincipalManager() throws RepositoryException {
         return principalManager;
     }
 
     @Override
-    public UserManager getUserManager()
-            throws RepositoryException {
+    public UserManager getUserManager() throws RepositoryException {
         return userManager;
     }
 
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/MockTemplateBuilderFactory.java b/src/main/java/org/apache/sling/testing/mock/jcr/MockTemplateBuilderFactory.java
index 021921e..2a991a5 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/MockTemplateBuilderFactory.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/MockTemplateBuilderFactory.java
@@ -1,24 +1,23 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.sling.testing.mock.jcr;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import javax.jcr.NamespaceRegistry;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
@@ -31,8 +30,10 @@ import javax.jcr.nodetype.NodeTypeManager;
 import javax.jcr.nodetype.NodeTypeTemplate;
 import javax.jcr.nodetype.PropertyDefinitionTemplate;
 
-import org.apache.jackrabbit.commons.cnd.DefinitionBuilderFactory;
+import java.util.ArrayList;
+import java.util.List;
 
+import org.apache.jackrabbit.commons.cnd.DefinitionBuilderFactory;
 
 /**
  * This is a fork of the {@link TemplateBuilderFactory} that changes the implementation
@@ -53,8 +54,8 @@ class MockTemplateBuilderFactory extends DefinitionBuilderFactory<NodeTypeTempla
     private final ValueFactory valueFactory;
     private NamespaceRegistry namespaceRegistry;
 
-    public MockTemplateBuilderFactory(NodeTypeManager nodeTypeManager, ValueFactory valueFactory,
-            NamespaceRegistry namespaceRegistry) {
+    public MockTemplateBuilderFactory(
+            NodeTypeManager nodeTypeManager, ValueFactory valueFactory, NamespaceRegistry namespaceRegistry) {
 
         this.nodeTypeManager = nodeTypeManager;
         this.valueFactory = valueFactory;
@@ -72,7 +73,10 @@ class MockTemplateBuilderFactory extends DefinitionBuilderFactory<NodeTypeTempla
      * @throws RepositoryException If an error occurs.
      */
     public MockTemplateBuilderFactory(Session session) throws RepositoryException {
-        this(session.getWorkspace().getNodeTypeManager(), session.getValueFactory(), session.getWorkspace().getNamespaceRegistry());
+        this(
+                session.getWorkspace().getNodeTypeManager(),
+                session.getValueFactory(),
+                session.getWorkspace().getNamespaceRegistry());
     }
 
     @Override
@@ -110,8 +114,7 @@ class MockTemplateBuilderFactory extends DefinitionBuilderFactory<NodeTypeTempla
         }
 
         @Override
-        public AbstractNodeDefinitionBuilder<NodeTypeTemplate> newNodeDefinitionBuilder()
-                throws RepositoryException {
+        public AbstractNodeDefinitionBuilder<NodeTypeTemplate> newNodeDefinitionBuilder() throws RepositoryException {
 
             return new NodeDefinitionTemplateBuilder(this);
         }
@@ -148,19 +151,16 @@ class MockTemplateBuilderFactory extends DefinitionBuilderFactory<NodeTypeTempla
         public void setPrimaryItemName(String name) throws ConstraintViolationException {
             template.setPrimaryItemName(name);
         }
-
     }
 
-    public class PropertyDefinitionTemplateBuilder extends
-            AbstractPropertyDefinitionBuilder<NodeTypeTemplate> {
+    public class PropertyDefinitionTemplateBuilder extends AbstractPropertyDefinitionBuilder<NodeTypeTemplate> {
 
         private final NodeTypeTemplateBuilder ntd;
         private final PropertyDefinitionTemplate template;
         private final List<Value> values = new ArrayList<>();
         private final List<String> constraints = new ArrayList<>();
 
-        public PropertyDefinitionTemplateBuilder(NodeTypeTemplateBuilder ntd)
-                throws RepositoryException {
+        public PropertyDefinitionTemplateBuilder(NodeTypeTemplateBuilder ntd) throws RepositoryException {
 
             super();
             this.ntd = ntd;
@@ -186,7 +186,7 @@ class MockTemplateBuilderFactory extends DefinitionBuilderFactory<NodeTypeTempla
         @Override
         public void setDeclaringNodeType(String name) {
             if (template instanceof MockPropertyDefinitionTemplate) {
-                ((MockPropertyDefinitionTemplate)template).setDeclaringNodeType(name);
+                ((MockPropertyDefinitionTemplate) template).setDeclaringNodeType(name);
             }
         }
 
@@ -208,7 +208,6 @@ class MockTemplateBuilderFactory extends DefinitionBuilderFactory<NodeTypeTempla
             List<PropertyDefinitionTemplate> templates = ntd.template.getPropertyDefinitionTemplates();
             templates.add(template);
         }
-
     }
 
     public class NodeDefinitionTemplateBuilder extends AbstractNodeDefinitionBuilder<NodeTypeTemplate> {
@@ -216,8 +215,7 @@ class MockTemplateBuilderFactory extends DefinitionBuilderFactory<NodeTypeTempla
         private final NodeDefinitionTemplate template;
         private final List<String> requiredPrimaryTypes = new ArrayList<>();
 
-        public NodeDefinitionTemplateBuilder(NodeTypeTemplateBuilder ntd)
-                throws RepositoryException {
+        public NodeDefinitionTemplateBuilder(NodeTypeTemplateBuilder ntd) throws RepositoryException {
 
             super();
             this.ntd = ntd;
@@ -243,7 +241,7 @@ class MockTemplateBuilderFactory extends DefinitionBuilderFactory<NodeTypeTempla
         @Override
         public void setDeclaringNodeType(String name) {
             if (template instanceof MockNodeDefinitionTemplate) {
-                ((MockNodeDefinitionTemplate)template).setDeclaringNodeType(name);
+                ((MockNodeDefinitionTemplate) template).setDeclaringNodeType(name);
             }
         }
 
@@ -253,8 +251,7 @@ class MockTemplateBuilderFactory extends DefinitionBuilderFactory<NodeTypeTempla
             template.setMandatory(super.isMandatory);
             template.setOnParentVersion(super.onParent);
             template.setProtected(super.isProtected);
-            template.setRequiredPrimaryTypeNames(requiredPrimaryTypes
-                    .toArray(new String[requiredPrimaryTypes.size()]));
+            template.setRequiredPrimaryTypeNames(requiredPrimaryTypes.toArray(new String[requiredPrimaryTypes.size()]));
             template.setSameNameSiblings(super.allowSns);
 
             @SuppressWarnings("unchecked")
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/MockUser.java b/src/main/java/org/apache/sling/testing/mock/jcr/MockUser.java
index 3645b03..d7e5637 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/MockUser.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/MockUser.java
@@ -1,30 +1,32 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.sling.testing.mock.jcr;
 
-import java.io.UnsupportedEncodingException;
-import java.security.NoSuchAlgorithmException;
-import java.security.Principal;
-
 import javax.jcr.Credentials;
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.SimpleCredentials;
 
+import java.io.UnsupportedEncodingException;
+import java.security.NoSuchAlgorithmException;
+import java.security.Principal;
+
 import org.apache.jackrabbit.api.security.user.Impersonation;
 import org.apache.jackrabbit.api.security.user.User;
 import org.apache.jackrabbit.oak.spi.security.principal.SystemUserPrincipal;
@@ -42,7 +44,9 @@ import org.slf4j.LoggerFactory;
 class MockUser extends MockAuthorizable implements User {
     private Logger logger = LoggerFactory.getLogger(getClass());
 
-    public MockUser(@Nullable String id, @Nullable Principal principal,
+    public MockUser(
+            @Nullable String id,
+            @Nullable Principal principal,
             @NotNull Node homeNode,
             @NotNull MockUserManager mockUserMgr) {
         super(id, principal, homeNode, mockUserMgr);
@@ -152,5 +156,4 @@ class MockUser extends MockAuthorizable implements User {
         builder.append("]");
         return builder.toString();
     }
-
 }
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/MockUserManager.java b/src/main/java/org/apache/sling/testing/mock/jcr/MockUserManager.java
index ca21b11..31a44e3 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/MockUserManager.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/MockUserManager.java
@@ -1,21 +1,29 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.sling.testing.mock.jcr;
 
+import javax.jcr.Node;
+import javax.jcr.Property;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.Value;
+
 import java.security.Principal;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -24,12 +32,6 @@ import java.util.Map;
 import java.util.Set;
 import java.util.stream.Collectors;
 
-import javax.jcr.Node;
-import javax.jcr.Property;
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-import javax.jcr.Value;
-
 import org.apache.jackrabbit.api.security.principal.PrincipalManager;
 import org.apache.jackrabbit.api.security.user.Authorizable;
 import org.apache.jackrabbit.api.security.user.AuthorizableExistsException;
@@ -81,15 +83,21 @@ public class MockUserManager implements UserManager {
                     @Override
                     protected void entering(Node node, int level) throws RepositoryException {
                         if (node.isNodeType(UserConstants.NT_REP_USER)) {
-                            String userID = node.getProperty(UserConstants.REP_AUTHORIZABLE_ID).getString();
-                            authorizables.computeIfAbsent(userID, id -> new MockUser(id, null, node, MockUserManager.this));
+                            String userID = node.getProperty(UserConstants.REP_AUTHORIZABLE_ID)
+                                    .getString();
+                            authorizables.computeIfAbsent(
+                                    userID, id -> new MockUser(id, null, node, MockUserManager.this));
                         } else if (node.isNodeType(UserConstants.NT_REP_SYSTEM_USER)) {
-                            String userID = node.getProperty(UserConstants.REP_AUTHORIZABLE_ID).getString();
+                            String userID = node.getProperty(UserConstants.REP_AUTHORIZABLE_ID)
+                                    .getString();
                             SystemUserPrincipal p = () -> userID;
-                            authorizables.computeIfAbsent(userID, id -> new MockUser(id, p, node, MockUserManager.this));
+                            authorizables.computeIfAbsent(
+                                    userID, id -> new MockUser(id, p, node, MockUserManager.this));
                         } else if (node.isNodeType(UserConstants.NT_REP_GROUP)) {
-                            String userID = node.getProperty(UserConstants.REP_AUTHORIZABLE_ID).getString();
-                            authorizables.computeIfAbsent(userID, id -> new MockGroup(id, null, node, MockUserManager.this));
+                            String userID = node.getProperty(UserConstants.REP_AUTHORIZABLE_ID)
+                                    .getString();
+                            authorizables.computeIfAbsent(
+                                    userID, id -> new MockGroup(id, null, node, MockUserManager.this));
                         }
                     }
 
@@ -137,21 +145,21 @@ public class MockUserManager implements UserManager {
     }
 
     Set<Authorizable> all(int searchType) throws RepositoryException { // NOSONAR
-       return authorizables.values().stream()
-               .filter(a -> {
-                   boolean match;
-                   if (PrincipalManager.SEARCH_TYPE_ALL == searchType) {
-                       match = true;
-                   } else if (PrincipalManager.SEARCH_TYPE_GROUP == searchType) {
-                       match = a.isGroup();
-                   } else if (PrincipalManager.SEARCH_TYPE_NOT_GROUP == searchType) {
-                       match = !a.isGroup();
-                   } else {
-                       match = false;
-                   }
-                   return match;
-               })
-               .collect(Collectors.toSet());
+        return authorizables.values().stream()
+                .filter(a -> {
+                    boolean match;
+                    if (PrincipalManager.SEARCH_TYPE_ALL == searchType) {
+                        match = true;
+                    } else if (PrincipalManager.SEARCH_TYPE_GROUP == searchType) {
+                        match = a.isGroup();
+                    } else if (PrincipalManager.SEARCH_TYPE_NOT_GROUP == searchType) {
+                        match = !a.isGroup();
+                    } else {
+                        match = false;
+                    }
+                    return match;
+                })
+                .collect(Collectors.toSet());
     }
 
     @Override
@@ -181,12 +189,14 @@ public class MockUserManager implements UserManager {
     }
 
     @Override
-    public @NotNull Group createGroup(@NotNull String groupID, @NotNull Principal principal, @Nullable String intermediatePath)
+    public @NotNull Group createGroup(
+            @NotNull String groupID, @NotNull Principal principal, @Nullable String intermediatePath)
             throws RepositoryException {
         return maybeCreateGroup(groupID, principal, intermediatePath);
     }
 
-    private @NotNull Group maybeCreateGroup(@Nullable String groupID, @Nullable Principal principal, @Nullable String intermediatePath)
+    private @NotNull Group maybeCreateGroup(
+            @Nullable String groupID, @Nullable Principal principal, @Nullable String intermediatePath)
             throws RepositoryException {
         if (authorizables.containsKey(groupID)) {
             throw new AuthorizableExistsException("Group already exists");
@@ -197,7 +207,7 @@ public class MockUserManager implements UserManager {
         }
 
         Node node = ensureAuthorizablePathExists(intermediatePath, principalName, UserConstants.NT_REP_GROUP);
-        return (Group)authorizables.computeIfAbsent(groupID, id -> new MockGroup(id, principal, node, this));
+        return (Group) authorizables.computeIfAbsent(groupID, id -> new MockGroup(id, principal, node, this));
     }
 
     /**
@@ -227,7 +237,9 @@ public class MockUserManager implements UserManager {
      * @deprecated use {@link #ensureAuthorizablePathExists(String, String, String)} instead
      */
     @Deprecated(forRemoval = true, since = "1.4.0")
-    protected Node ensureAuthorizablePathExists(@Nullable String intermediatePath, @NotNull String principalName, boolean isGroup) throws RepositoryException {
+    protected Node ensureAuthorizablePathExists(
+            @Nullable String intermediatePath, @NotNull String principalName, boolean isGroup)
+            throws RepositoryException {
         if (intermediatePath == null) {
             if (isGroup) {
                 intermediatePath = "/home/groups"; // NOSONAR
@@ -248,7 +260,9 @@ public class MockUserManager implements UserManager {
      * @return Existing or created node
      * @throws RepositoryException Repository exception
      */
-    protected Node ensureAuthorizablePathExists(@NotNull String intermediatePath, @NotNull String principalName, @NotNull String authorizableNodeType) throws RepositoryException {
+    protected Node ensureAuthorizablePathExists(
+            @NotNull String intermediatePath, @NotNull String principalName, @NotNull String authorizableNodeType)
+            throws RepositoryException {
         // ensure the resource at the path exists
         String[] segments = intermediatePath.split("/");
         Node node = session.getRootNode();
@@ -279,19 +293,26 @@ public class MockUserManager implements UserManager {
     }
 
     @Override
-    public @NotNull User createUser(@NotNull String userID, @Nullable String password)
-            throws RepositoryException {
+    public @NotNull User createUser(@NotNull String userID, @Nullable String password) throws RepositoryException {
         return maybeCreateUser(userID, password, null, null);
     }
 
     @Override
-    public @NotNull User createUser(@NotNull String userID, @Nullable String password, @NotNull Principal principal,
-            @Nullable String intermediatePath) throws RepositoryException {
+    public @NotNull User createUser(
+            @NotNull String userID,
+            @Nullable String password,
+            @NotNull Principal principal,
+            @Nullable String intermediatePath)
+            throws RepositoryException {
         return maybeCreateUser(userID, password, principal, intermediatePath);
     }
 
-    private @NotNull User maybeCreateUser(@Nullable String userID, @Nullable String password, @Nullable Principal principal,
-            @Nullable String intermediatePath) throws RepositoryException {
+    private @NotNull User maybeCreateUser(
+            @Nullable String userID,
+            @Nullable String password,
+            @Nullable Principal principal,
+            @Nullable String intermediatePath)
+            throws RepositoryException {
         if (authorizables.containsKey(userID)) {
             throw new AuthorizableExistsException("User already exists");
         }
@@ -306,7 +327,7 @@ public class MockUserManager implements UserManager {
             }
         }
         Node node = ensureAuthorizablePathExists(intermediatePath, principalName, authorizableNodeType);
-        User user = (User)authorizables.computeIfAbsent(userID, id -> new MockUser(id, principal, node, this));
+        User user = (User) authorizables.computeIfAbsent(userID, id -> new MockUser(id, principal, node, this));
         if (password != null) {
             user.changePassword(password);
         }
@@ -325,17 +346,17 @@ public class MockUserManager implements UserManager {
     }
 
     @Override
-    public @NotNull Iterator<Authorizable> findAuthorizables(@NotNull String relPath, @Nullable String value, int searchType)
-            throws RepositoryException {
+    public @NotNull Iterator<Authorizable> findAuthorizables(
+            @NotNull String relPath, @Nullable String value, int searchType) throws RepositoryException {
         Set<Authorizable> matches = new HashSet<>();
         for (Authorizable authorizable : authorizables.values()) {
             if (UserManager.SEARCH_TYPE_GROUP == searchType) {
                 if (!authorizable.isGroup()) {
-                    continue; //not a group, so skip it
+                    continue; // not a group, so skip it
                 }
             } else if (UserManager.SEARCH_TYPE_USER == searchType) {
                 if (authorizable.isGroup()) {
-                    continue; //not a user, so skip it
+                    continue; // not a user, so skip it
                 }
             } else if (UserManager.SEARCH_TYPE_AUTHORIZABLE != searchType) {
                 continue; // some other invalid value?
@@ -344,7 +365,7 @@ public class MockUserManager implements UserManager {
             if (property != null) {
                 if (value == null) {
                     // found a match?
-                   matches.add(authorizable);
+                    matches.add(authorizable);
                 } else {
                     for (Value value2 : property) {
                         if (value.equals(value2.getString())) {
@@ -385,22 +406,20 @@ public class MockUserManager implements UserManager {
     }
 
     @Override
-    public @Nullable Authorizable getAuthorizableByPath(@NotNull String path)
-            throws RepositoryException {
+    public @Nullable Authorizable getAuthorizableByPath(@NotNull String path) throws RepositoryException {
         return authorizables.values().stream()
-            .filter(a -> {
-                try {
-                    return path.equals(a.getPath());
-                } catch (RepositoryException e) {
-                    // ignore and log
-                    if (logger.isDebugEnabled()) {
-                        logger.debug("Failed to match authorizable path", e);
+                .filter(a -> {
+                    try {
+                        return path.equals(a.getPath());
+                    } catch (RepositoryException e) {
+                        // ignore and log
+                        if (logger.isDebugEnabled()) {
+                            logger.debug("Failed to match authorizable path", e);
+                        }
+                        return false;
                     }
-                    return false;
-                }
-            })
-            .findFirst()
-            .orElse(null);
+                })
+                .findFirst()
+                .orElse(null);
     }
-
 }
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/MockWorkspace.java b/src/main/java/org/apache/sling/testing/mock/jcr/MockWorkspace.java
index c64eaca..3ea600c 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/MockWorkspace.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/MockWorkspace.java
@@ -18,8 +18,6 @@
  */
 package org.apache.sling.testing.mock.jcr;
 
-import java.io.InputStream;
-
 import javax.jcr.NamespaceRegistry;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
@@ -31,6 +29,8 @@ import javax.jcr.query.QueryManager;
 import javax.jcr.version.Version;
 import javax.jcr.version.VersionManager;
 
+import java.io.InputStream;
+
 import org.xml.sax.ContentHandler;
 
 /**
@@ -95,8 +95,9 @@ class MockWorkspace implements Workspace {
     }
 
     @Override
-    public void clone(final String srcWorkspace, final String srcAbsPath, final String destAbsPath,
-            final boolean removeExisting) throws RepositoryException {
+    public void clone(
+            final String srcWorkspace, final String srcAbsPath, final String destAbsPath, final boolean removeExisting)
+            throws RepositoryException {
         throw new UnsupportedOperationException();
     }
 
@@ -126,12 +127,14 @@ class MockWorkspace implements Workspace {
     }
 
     @Override
-    public ContentHandler getImportContentHandler(final String parentAbsPath, final int uuidBehavior) throws RepositoryException {
+    public ContentHandler getImportContentHandler(final String parentAbsPath, final int uuidBehavior)
+            throws RepositoryException {
         throw new UnsupportedOperationException();
     }
 
     @Override
-    public void importXML(final String parentAbsPath, final InputStream in, final int uuidBehavior) throws RepositoryException {
+    public void importXML(final String parentAbsPath, final InputStream in, final int uuidBehavior)
+            throws RepositoryException {
         throw new UnsupportedOperationException();
     }
 
@@ -149,5 +152,4 @@ class MockWorkspace implements Workspace {
     public void deleteWorkspace(final String name) throws RepositoryException {
         throw new UnsupportedOperationException();
     }
-
 }
diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/ResourceUtil.java b/src/main/java/org/apache/sling/testing/mock/jcr/ResourceUtil.java
index f1488bb..470c2b3 100644
--- a/src/main/java/org/apache/sling/testing/mock/jcr/ResourceUtil.java
+++ b/src/main/java/org/apache/sling/testing/mock/jcr/ResourceUtil.java
@@ -175,13 +175,13 @@ class ResourceUtil {
      * @since 2.2
      */
     public static String getParent(final String path, final int level) {
-        if ( level < 0 ) {
+        if (level < 0) {
             throw new IllegalArgumentException("level must be non-negative");
         }
         String result = path;
-        for(int i=0; i<level; i++) {
+        for (int i = 0; i < level; i++) {
             result = getParent(result);
-            if ( result == null ) {
+            if (result == null) {
                 break;
             }
         }
@@ -215,5 +215,4 @@ class ResourceUtil {
         // find the last slash
         return path.substring(path.lastIndexOf('/') + 1);
     }
-
 }
diff --git a/src/test/java/org/apache/sling/testing/mock/jcr/AbstractItemTest.java b/src/test/java/org/apache/sling/testing/mock/jcr/AbstractItemTest.java
index 205d77d..253615f 100644
--- a/src/test/java/org/apache/sling/testing/mock/jcr/AbstractItemTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/jcr/AbstractItemTest.java
@@ -18,11 +18,6 @@
  */
 package org.apache.sling.testing.mock.jcr;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertThrows;
-import static org.junit.Assert.assertTrue;
-
 import javax.jcr.ItemNotFoundException;
 import javax.jcr.Node;
 import javax.jcr.Property;
@@ -32,6 +27,11 @@ import javax.jcr.Session;
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThrows;
+import static org.junit.Assert.assertTrue;
+
 public abstract class AbstractItemTest {
 
     protected Session session;
@@ -71,14 +71,12 @@ public abstract class AbstractItemTest {
 
     @Test
     public void testGetAncestorNegative() throws RepositoryException {
-        assertThrows(ItemNotFoundException.class,
-                () -> this.node11.getAncestor(-1));
+        assertThrows(ItemNotFoundException.class, () -> this.node11.getAncestor(-1));
     }
 
     @Test
     public void testGetAncestorTooDeep() throws RepositoryException {
-        assertThrows(ItemNotFoundException.class,
-                () -> this.node11.getAncestor(3));
+        assertThrows(ItemNotFoundException.class, () -> this.node11.getAncestor(3));
     }
 
     @Test
@@ -100,7 +98,7 @@ public abstract class AbstractItemTest {
         assertFalse(this.node1.isNew());
 
         // not-new node can now be 'modified' after changes
-        ((MockNode)this.node1).itemData.setIsChanged(true);
+        ((MockNode) this.node1).itemData.setIsChanged(true);
         assertTrue(this.node1.isModified());
         assertFalse(this.node1.isNew());
     }
@@ -109,9 +107,9 @@ public abstract class AbstractItemTest {
     public void testIsSameForNodeComparedToProp() throws RepositoryException {
         assertFalse(this.node1.isSame(this.prop1));
     }
+
     @Test
     public void testIsSameForPropComparedToNode() throws RepositoryException {
         assertFalse(this.prop1.isSame(this.node1));
     }
-
 }
diff --git a/src/test/java/org/apache/sling/testing/mock/jcr/AbstractMockNodeTypeTest.java b/src/test/java/org/apache/sling/testing/mock/jcr/AbstractMockNodeTypeTest.java
index 37b8732..fea5db4 100644
--- a/src/test/java/org/apache/sling/testing/mock/jcr/AbstractMockNodeTypeTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/jcr/AbstractMockNodeTypeTest.java
@@ -1,29 +1,23 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.sling.testing.mock.jcr;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThrows;
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.Value;
@@ -31,6 +25,8 @@ import javax.jcr.nodetype.NodeType;
 import javax.jcr.nodetype.NodeTypeDefinition;
 import javax.jcr.nodetype.NodeTypeManager;
 
+import java.io.IOException;
+
 import org.apache.jackrabbit.JcrConstants;
 import org.apache.jackrabbit.commons.cnd.ParseException;
 import org.apache.jackrabbit.value.ValueFactoryImpl;
@@ -38,6 +34,12 @@ import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mockito;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThrows;
+import static org.junit.Assert.assertTrue;
+
 /**
  *
  */
@@ -124,7 +126,9 @@ public abstract class AbstractMockNodeTypeTest {
     @Test
     public void testCanAddChildNodeStringString() throws RepositoryException {
         NodeType ntFolder = nodeTypeManager.getNodeType(JcrConstants.NT_UNSTRUCTURED);
-        assertThrows(UnsupportedOperationException.class, () -> ntFolder.canAddChildNode("child1", JcrConstants.NT_UNSTRUCTURED));
+        assertThrows(
+                UnsupportedOperationException.class,
+                () -> ntFolder.canAddChildNode("child1", JcrConstants.NT_UNSTRUCTURED));
     }
 
     /**
@@ -251,5 +255,4 @@ public abstract class AbstractMockNodeTypeTest {
         assertNotNull(string);
         assertTrue(string.contains(JcrConstants.NT_FOLDER));
     }
-
 }
diff --git a/src/test/java/org/apache/sling/testing/mock/jcr/LogCapture.java b/src/test/java/org/apache/sling/testing/mock/jcr/LogCapture.java
index be27de1..b5c3e3d 100644
--- a/src/test/java/org/apache/sling/testing/mock/jcr/LogCapture.java
+++ b/src/test/java/org/apache/sling/testing/mock/jcr/LogCapture.java
@@ -18,22 +18,21 @@
  */
 package org.apache.sling.testing.mock.jcr;
 
-import static org.junit.Assert.fail;
-
 import java.util.function.Predicate;
 import java.util.stream.Stream;
 
-import org.slf4j.LoggerFactory;
-
 import ch.qos.logback.classic.Level;
 import ch.qos.logback.classic.Logger;
 import ch.qos.logback.classic.LoggerContext;
 import ch.qos.logback.classic.spi.ILoggingEvent;
 import ch.qos.logback.core.read.ListAppender;
+import org.slf4j.LoggerFactory;
 
-/** 
- * Capture logs for testing 
- * 
+import static org.junit.Assert.fail;
+
+/**
+ * Capture logs for testing
+ *
  * Initially cloned from: https://github.com/apache/sling-org-apache-sling-graphql-core/blob/0b1c1dd72ed04324ea84d2227c3223ec65b0b21e/src/test/java/org/apache/sling/graphql/core/util/LogCapture.java
  */
 public class LogCapture extends ListAppender<ILoggingEvent> implements AutoCloseable {
@@ -50,7 +49,7 @@ public class LogCapture extends ListAppender<ILoggingEvent> implements AutoClose
     }
 
     public void setLoggerLevel(Level newLevel) {
-        ((ch.qos.logback.classic.Logger)logger).setLevel(newLevel);
+        ((ch.qos.logback.classic.Logger) logger).setLevel(newLevel);
     }
 
     @Override
@@ -64,9 +63,10 @@ public class LogCapture extends ListAppender<ILoggingEvent> implements AutoClose
         return this.list.stream().anyMatch(p);
     }
 
-    public void assertContains(Level atLevel, String ... substrings) {
+    public void assertContains(Level atLevel, String... substrings) {
         Stream.of(substrings).forEach(substring -> {
-            if (!anyMatch(event -> event.getLevel() == atLevel && event.getFormattedMessage().contains(substring))) {
+            if (!anyMatch(event ->
+                    event.getLevel() == atLevel && event.getFormattedMessage().contains(substring))) {
                 if (verboseFailure) {
                     fail(String.format("No log message contains [%s] in log%n%s", substring, this.list.toString()));
                 } else {
@@ -76,16 +76,17 @@ public class LogCapture extends ListAppender<ILoggingEvent> implements AutoClose
         });
     }
 
-    public void assertNotContains(Level atLevel, String ... substrings) {
+    public void assertNotContains(Level atLevel, String... substrings) {
         Stream.of(substrings).forEach(substring -> {
-            if (anyMatch(event -> event.getLevel() == atLevel && event.getFormattedMessage().contains(substring))) {
+            if (anyMatch(event ->
+                    event.getLevel() == atLevel && event.getFormattedMessage().contains(substring))) {
                 if (verboseFailure) {
-                    fail(String.format("Unexpected log message contains [%s] in log%n%s", substring, this.list.toString()));
+                    fail(String.format(
+                            "Unexpected log message contains [%s] in log%n%s", substring, this.list.toString()));
                 } else {
                     fail(String.format("Unexpacted log message contains [%s]", substring));
                 }
             }
         });
     }
-
 }
diff --git a/src/test/java/org/apache/sling/testing/mock/jcr/MockAuthorizableTest.java b/src/test/java/org/apache/sling/testing/mock/jcr/MockAuthorizableTest.java
index be49984..b8ba370 100644
--- a/src/test/java/org/apache/sling/testing/mock/jcr/MockAuthorizableTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/jcr/MockAuthorizableTest.java
@@ -1,38 +1,34 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.sling.testing.mock.jcr;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.security.Principal;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.UnsupportedRepositoryOperationException;
 import javax.jcr.Value;
 import javax.jcr.ValueFactory;
 
+import java.security.Principal;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
 import org.apache.jackrabbit.api.security.user.Authorizable;
 import org.apache.jackrabbit.api.security.user.Group;
 import org.apache.jackrabbit.api.security.user.UserManager;
@@ -42,6 +38,12 @@ import org.jetbrains.annotations.Nullable;
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
 /**
  *
  */
@@ -212,9 +214,7 @@ public abstract class MockAuthorizableTest<T extends Authorizable> {
      */
     @Test
     public void testSetPropertyStringValueArray() throws RepositoryException {
-        authorizable.setProperty("relPath", new Value [] {
-                vf.createValue("value1"),
-                vf.createValue("value2")});
+        authorizable.setProperty("relPath", new Value[] {vf.createValue("value1"), vf.createValue("value2")});
         Value[] property = authorizable.getProperty("relPath");
         assertNotNull(property);
         assertEquals(2, property.length);
@@ -222,18 +222,14 @@ public abstract class MockAuthorizableTest<T extends Authorizable> {
         assertEquals("value2", property[1].getString());
 
         // nested prop
-        authorizable.setProperty("relPath2/prop2", new Value [] {
-                vf.createValue("value2"),
-                vf.createValue("value3") });
+        authorizable.setProperty("relPath2/prop2", new Value[] {vf.createValue("value2"), vf.createValue("value3")});
         property = authorizable.getProperty("relPath2/prop2");
         assertNotNull(property);
         assertEquals(2, property.length);
         assertEquals("value2", property[0].getString());
 
         // second nested prop where intermediate subnode already exists
-        authorizable.setProperty("relPath2/prop3", new Value [] {
-                vf.createValue("value3"),
-                vf.createValue("value4")});
+        authorizable.setProperty("relPath2/prop3", new Value[] {vf.createValue("value3"), vf.createValue("value4")});
         property = authorizable.getProperty("relPath2/prop3");
         assertNotNull(property);
         assertEquals(2, property.length);
@@ -277,5 +273,4 @@ public abstract class MockAuthorizableTest<T extends Authorizable> {
     public void testToString() {
         assertNotNull(authorizable.toString());
     }
-
 }
diff --git a/src/test/java/org/apache/sling/testing/mock/jcr/MockGroupTest.java b/src/test/java/org/apache/sling/testing/mock/jcr/MockGroupTest.java
index 57ae042..b7af412 100644
--- a/src/test/java/org/apache/sling/testing/mock/jcr/MockGroupTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/jcr/MockGroupTest.java
@@ -1,33 +1,31 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.sling.testing.mock.jcr;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.UnsupportedRepositoryOperationException;
 
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Set;
 
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-import javax.jcr.UnsupportedRepositoryOperationException;
-
 import org.apache.jackrabbit.api.security.user.Authorizable;
 import org.apache.jackrabbit.api.security.user.AuthorizableExistsException;
 import org.apache.jackrabbit.api.security.user.Group;
@@ -36,6 +34,10 @@ import org.apache.jackrabbit.oak.spi.security.user.UserConstants;
 import org.jetbrains.annotations.NotNull;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 /**
  *
  */
@@ -111,6 +113,7 @@ public class MockGroupTest extends MockAuthorizableTest<Group> {
         assertTrue(membersSet.contains(member1));
         assertTrue(membersSet.contains(member2));
     }
+
     @Test
     public void testGetMembersWithNestedGroups() throws RepositoryException {
         @NotNull Group member1 = userManager.createGroup("member1");
@@ -192,7 +195,8 @@ public class MockGroupTest extends MockAuthorizableTest<Group> {
     public void testAddMembers() throws AuthorizableExistsException, RepositoryException {
         @NotNull Group member1 = userManager.createGroup("member1");
         @NotNull User member2 = userManager.createUser("member2", "pwd");
-        @NotNull Set<String> added = authorizable.addMembers(member1.getID(), member2.getID(), member1.getID(), "invalid");
+        @NotNull
+        Set<String> added = authorizable.addMembers(member1.getID(), member2.getID(), member1.getID(), "invalid");
         assertEquals(2, added.size());
 
         @NotNull Iterator<Authorizable> declaredMembers = authorizable.getDeclaredMembers();
@@ -244,8 +248,8 @@ public class MockGroupTest extends MockAuthorizableTest<Group> {
         assertEquals("/home/groups/group1", authorizable.getPath());
         assertTrue(session.nodeExists(authorizable.getPath()));
         Node node = session.getNode(authorizable.getPath());
-        assertEquals(authorizable.getID(), 
+        assertEquals(
+                authorizable.getID(),
                 node.getProperty(UserConstants.REP_PRINCIPAL_NAME).getString());
     }
-
 }
diff --git a/src/test/java/org/apache/sling/testing/mock/jcr/MockNodeOnlyRegisteredTypesTest.java b/src/test/java/org/apache/sling/testing/mock/jcr/MockNodeOnlyRegisteredTypesTest.java
index b56e456..9016c59 100644
--- a/src/test/java/org/apache/sling/testing/mock/jcr/MockNodeOnlyRegisteredTypesTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/jcr/MockNodeOnlyRegisteredTypesTest.java
@@ -18,26 +18,26 @@
  */
 package org.apache.sling.testing.mock.jcr;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.Reader;
-
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.nodetype.NodeDefinition;
 import javax.jcr.nodetype.NodeType;
 
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Reader;
+
 import org.apache.jackrabbit.JcrConstants;
 import org.apache.jackrabbit.commons.cnd.ParseException;
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
 public class MockNodeOnlyRegisteredTypesTest {
     protected Session session;
     protected Node rootNode;
@@ -62,6 +62,7 @@ public class MockNodeOnlyRegisteredTypesTest {
         assertTrue(auto1.hasProperty("prop2"));
         assertTrue(auto1.hasNode("child1"));
     }
+
     @Test
     public void testAutocreatedItemsForMixin() throws RepositoryException {
         Node auto1 = this.node1.addNode("auto1");
@@ -100,7 +101,8 @@ public class MockNodeOnlyRegisteredTypesTest {
         assertEquals(JcrConstants.NT_FOLDER, def3child1DefaultPrimaryType.getName());
 
         // verify the child definition was defined in the primary type
-        NodeType mixAutoCreatedChildAndProp = this.session.getWorkspace().getNodeTypeManager().getNodeType("mix:autocreatedChildAndProp");
+        NodeType mixAutoCreatedChildAndProp =
+                this.session.getWorkspace().getNodeTypeManager().getNodeType("mix:autocreatedChildAndProp");
         assertEquals(mixAutoCreatedChildAndProp, definition3.getDeclaringNodeType());
 
         NodeType[] def3child1RequiredPrimaryTypes = definition3.getRequiredPrimaryTypes();
@@ -108,5 +110,4 @@ public class MockNodeOnlyRegisteredTypesTest {
         assertEquals(1, def3child1RequiredPrimaryTypes.length);
         assertEquals(JcrConstants.NT_BASE, def3child1RequiredPrimaryTypes[0].getName());
     }
-
 }
diff --git a/src/test/java/org/apache/sling/testing/mock/jcr/MockNodeTest.java b/src/test/java/org/apache/sling/testing/mock/jcr/MockNodeTest.java
index e9976f9..f889ab9 100644
--- a/src/test/java/org/apache/sling/testing/mock/jcr/MockNodeTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/jcr/MockNodeTest.java
@@ -18,23 +18,6 @@
  */
 package org.apache.sling.testing.mock.jcr;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThrows;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
 import javax.jcr.ItemNotFoundException;
 import javax.jcr.Node;
 import javax.jcr.NodeIterator;
@@ -46,11 +29,28 @@ import javax.jcr.Session;
 import javax.jcr.nodetype.NoSuchNodeTypeException;
 import javax.jcr.util.TraversingItemVisitor;
 
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.jackrabbit.JcrConstants;
 import org.apache.jackrabbit.commons.cnd.ParseException;
 import org.junit.Assert;
 import org.junit.Test;
 
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThrows;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 public class MockNodeTest extends AbstractItemTest {
 
     @Test
@@ -69,7 +69,7 @@ public class MockNodeTest extends AbstractItemTest {
         assertEquals(1, nodes.getSize());
         assertEquals(this.node11, nodes.nextNode());
 
-        nodes = this.node1.getNodes(new String[]{"node*"});
+        nodes = this.node1.getNodes(new String[] {"node*"});
         assertEquals(1, nodes.getSize());
         assertEquals(this.node11, nodes.nextNode());
 
@@ -91,7 +91,7 @@ public class MockNodeTest extends AbstractItemTest {
         assertEquals(1, properties.getSize());
         assertEquals(this.prop1, properties.next());
 
-        properties = this.node1.getProperties(new String[]{"prop*"});
+        properties = this.node1.getProperties(new String[] {"prop*"});
         assertEquals(1, properties.getSize());
         assertEquals(this.prop1, properties.next());
 
@@ -111,7 +111,8 @@ public class MockNodeTest extends AbstractItemTest {
     @Test
     public void testPrimaryType() throws RepositoryException {
         assertEquals("nt:unstructured", this.node1.getPrimaryNodeType().getName());
-        assertEquals("nt:unstructured", this.node1.getProperty("jcr:primaryType").getString());
+        assertEquals(
+                "nt:unstructured", this.node1.getProperty("jcr:primaryType").getString());
         final PropertyIterator properties = this.node1.getProperties();
         while (properties.hasNext()) {
             final Property property = properties.nextProperty();
@@ -185,8 +186,9 @@ public class MockNodeTest extends AbstractItemTest {
         node1.addMixin("mix:referenceable");
         node1.addMixin("mix:taggable");
         assertEquals(2, node1.getMixinNodeTypes().length);
-        assertEquals("mix:taggable" ,node1.getMixinNodeTypes()[1].getName());
+        assertEquals("mix:taggable", node1.getMixinNodeTypes()[1].getName());
     }
+
     @Test
     public void testGetMixinNodeNoMixinTypes() throws RepositoryException {
         assertEquals(0, node1.getMixinNodeTypes().length);
@@ -214,19 +216,16 @@ public class MockNodeTest extends AbstractItemTest {
         foo.addNode("two");
         foo.addNode("three");
         session.save();
-        assertArrayEquals("Expected nodes order mismatch",
-                new String[] {"one", "two", "three"},
-                getNodeNames(foo.getNodes()));
+        assertArrayEquals(
+                "Expected nodes order mismatch", new String[] {"one", "two", "three"}, getNodeNames(foo.getNodes()));
         foo.orderBefore("three", "two");
         session.save();
-        assertArrayEquals("Expected nodes order mismatch",
-                new String[] {"one", "three", "two"},
-                getNodeNames(foo.getNodes()));
+        assertArrayEquals(
+                "Expected nodes order mismatch", new String[] {"one", "three", "two"}, getNodeNames(foo.getNodes()));
         foo.orderBefore("one", null);
         session.save();
-        assertArrayEquals("Expected nodes order mismatch",
-                new String[] {"three", "two", "one"},
-                getNodeNames(foo.getNodes()));
+        assertArrayEquals(
+                "Expected nodes order mismatch", new String[] {"three", "two", "one"}, getNodeNames(foo.getNodes()));
     }
 
     /**
@@ -241,17 +240,20 @@ public class MockNodeTest extends AbstractItemTest {
         foo.addNode("child10");
         foo.addNode("child1");
         session.save();
-        assertArrayEquals("Expected nodes order mismatch",
+        assertArrayEquals(
+                "Expected nodes order mismatch",
                 new String[] {"child100", "child10", "child1"},
                 getNodeNames(foo.getNodes()));
         foo.orderBefore("child10", "child100");
         session.save();
-        assertArrayEquals("Expected nodes order mismatch",
+        assertArrayEquals(
+                "Expected nodes order mismatch",
                 new String[] {"child10", "child100", "child1"},
                 getNodeNames(foo.getNodes()));
         foo.orderBefore("child10", null);
         session.save();
-        assertArrayEquals("Expected nodes order mismatch",
+        assertArrayEquals(
+                "Expected nodes order mismatch",
                 new String[] {"child100", "child1", "child10"},
                 getNodeNames(foo.getNodes()));
     }
@@ -266,9 +268,9 @@ public class MockNodeTest extends AbstractItemTest {
     public static List<Node> getUnprotectedChildNodes(Node src) throws RepositoryException {
         List<Node> result = new LinkedList<>();
         NodeIterator iterator = src.getNodes();
-        while(iterator.hasNext()) {
+        while (iterator.hasNext()) {
             Node node = iterator.nextNode();
-            if(!node.getDefinition().isProtected()) {
+            if (!node.getDefinition().isProtected()) {
                 result.add(node);
             }
         }
@@ -280,18 +282,20 @@ public class MockNodeTest extends AbstractItemTest {
         List<String> names = new LinkedList<>();
         nodeIterator.forEachRemaining(node -> {
             try {
-                names.add(((Node)node).getName());
+                names.add(((Node) node).getName());
             } catch (RepositoryException e) {
                 Assert.fail(e.getMessage());
             }
         });
         return names.toArray(new String[names.size()]);
     }
-    
+
     @Test
     public void addMixinTest() throws RepositoryException {
         node1.addMixin("mix:referenceable");
-        assertEquals("mix:referenceable", node1.getProperty(JcrConstants.JCR_MIXINTYPES).getValues()[0].getString());
+        assertEquals(
+                "mix:referenceable",
+                node1.getProperty(JcrConstants.JCR_MIXINTYPES).getValues()[0].getString());
     }
 
     @Test
@@ -312,8 +316,10 @@ public class MockNodeTest extends AbstractItemTest {
         node1.addMixin("mix:taggable");
         node1.addMixin("mix:mixin");
         node1.removeMixin("mix:taggable");
-        assertEquals(1 , node1.getProperty(JcrConstants.JCR_MIXINTYPES).getValues().length);
-        assertEquals("mix:mixin" , node1.getProperty(JcrConstants.JCR_MIXINTYPES).getValues()[0].getString());
+        assertEquals(1, node1.getProperty(JcrConstants.JCR_MIXINTYPES).getValues().length);
+        assertEquals(
+                "mix:mixin",
+                node1.getProperty(JcrConstants.JCR_MIXINTYPES).getValues()[0].getString());
     }
 
     @Test
@@ -425,7 +431,8 @@ public class MockNodeTest extends AbstractItemTest {
      * SLING-11874 auto-set created/lastModified prop values when appropriate
      */
     @Test
-    public void testAddNodeCreatesSystemGeneratedAutoPropertyValues() throws RepositoryException, IOException, ParseException {
+    public void testAddNodeCreatesSystemGeneratedAutoPropertyValues()
+            throws RepositoryException, IOException, ParseException {
         loadNodeTypes();
         Node foo = this.session.getRootNode().addNode("foo", JcrConstants.NT_HIERARCHYNODE);
         Node versionFoo = this.session.getRootNode().addNode("versionFoo", JcrConstants.NT_VERSION);
@@ -440,7 +447,8 @@ public class MockNodeTest extends AbstractItemTest {
      * SLING-11874 auto-set created/lastModified prop values when appropriate
      */
     @Test
-    public void testAddMixinCreatesSystemGeneratedAutoPropertyValues() throws RepositoryException, IOException, ParseException {
+    public void testAddMixinCreatesSystemGeneratedAutoPropertyValues()
+            throws RepositoryException, IOException, ParseException {
         loadNodeTypes();
 
         Node foo = this.session.getRootNode().addNode("foo", JcrConstants.NT_UNSTRUCTURED);
@@ -465,7 +473,8 @@ public class MockNodeTest extends AbstractItemTest {
      * SLING-11874 To test created and lastModified props are not autocreated when not declared in their mixins
      */
     @Test
-    public void testAddNodeDoesNotCreateNonMixinCreatedAndLastModified() throws RepositoryException, IOException, ParseException {
+    public void testAddNodeDoesNotCreateNonMixinCreatedAndLastModified()
+            throws RepositoryException, IOException, ParseException {
         loadNodeTypes();
 
         Node foo = this.session.getRootNode().addNode("foo", "nt:nonMixinCreatedAndLastModified");
@@ -475,5 +484,4 @@ public class MockNodeTest extends AbstractItemTest {
         assertFalse(foo.hasProperty(JcrConstants.JCR_LASTMODIFIED));
         assertFalse(foo.hasProperty("jcr:lastModifiedBy"));
     }
-
 }
diff --git a/src/test/java/org/apache/sling/testing/mock/jcr/MockNodeTypeAllModeTest.java b/src/test/java/org/apache/sling/testing/mock/jcr/MockNodeTypeAllModeTest.java
index 2b28bbf..532b617 100644
--- a/src/test/java/org/apache/sling/testing/mock/jcr/MockNodeTypeAllModeTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/jcr/MockNodeTypeAllModeTest.java
@@ -1,34 +1,36 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.sling.testing.mock.jcr;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertThrows;
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-
 import javax.jcr.RepositoryException;
 import javax.jcr.nodetype.NodeType;
 
+import java.io.IOException;
+
 import org.apache.jackrabbit.JcrConstants;
 import org.apache.jackrabbit.commons.cnd.ParseException;
 import org.junit.Test;
 
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThrows;
+import static org.junit.Assert.assertTrue;
+
 /**
  *
  */
@@ -166,5 +168,4 @@ public class MockNodeTypeAllModeTest extends AbstractMockNodeTypeTest {
         NodeType ntFolder = nodeTypeManager.getNodeType(JcrConstants.NT_FOLDER);
         assertThrows(UnsupportedOperationException.class, () -> ntFolder.isQueryable());
     }
-
 }
diff --git a/src/test/java/org/apache/sling/testing/mock/jcr/MockNodeTypeManagerAllModeTest.java b/src/test/java/org/apache/sling/testing/mock/jcr/MockNodeTypeManagerAllModeTest.java
index 5c1e375..39702b8 100644
--- a/src/test/java/org/apache/sling/testing/mock/jcr/MockNodeTypeManagerAllModeTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/jcr/MockNodeTypeManagerAllModeTest.java
@@ -1,39 +1,41 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.sling.testing.mock.jcr;
 
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThrows;
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.nodetype.NodeType;
 import javax.jcr.nodetype.NodeTypeDefinition;
 import javax.jcr.nodetype.NodeTypeManager;
 
+import java.io.IOException;
+
 import org.apache.jackrabbit.JcrConstants;
 import org.apache.jackrabbit.commons.cnd.ParseException;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mockito;
 
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThrows;
+import static org.junit.Assert.assertTrue;
+
 /**
  * Tests the MockNodeTypeManager when in the MOCK_ALL mode
  */
@@ -132,7 +134,9 @@ public class MockNodeTypeManagerAllModeTest {
     public void testRegisterNodeType() throws RepositoryException {
         MockNodeTypeTemplate testDef = new MockNodeTypeTemplate();
         testDef.setName(JcrConstants.NT_FOLDER);
-        assertThrows(UnsupportedOperationException.class, () -> nodeTypeManager.registerNodeType((NodeTypeDefinition) testDef, false));
+        assertThrows(
+                UnsupportedOperationException.class,
+                () -> nodeTypeManager.registerNodeType((NodeTypeDefinition) testDef, false));
     }
 
     /**
@@ -142,7 +146,9 @@ public class MockNodeTypeManagerAllModeTest {
     public void testRegisterNodeTypes() throws RepositoryException {
         MockNodeTypeTemplate testDef1 = new MockNodeTypeTemplate();
         testDef1.setName(JcrConstants.NT_FOLDER);
-        assertThrows(UnsupportedOperationException.class, () -> nodeTypeManager.registerNodeTypes(new NodeTypeDefinition[] {testDef1}, false));
+        assertThrows(
+                UnsupportedOperationException.class,
+                () -> nodeTypeManager.registerNodeTypes(new NodeTypeDefinition[] {testDef1}, false));
     }
 
     /**
@@ -158,7 +164,8 @@ public class MockNodeTypeManagerAllModeTest {
      */
     @Test
     public void testUnregisterNodeTypes() throws RepositoryException {
-        assertThrows(UnsupportedOperationException.class, () -> nodeTypeManager.unregisterNodeTypes(new String[] {NT_INVALID}));
+        assertThrows(
+                UnsupportedOperationException.class,
+                () -> nodeTypeManager.unregisterNodeTypes(new String[] {NT_INVALID}));
     }
-
 }
diff --git a/src/test/java/org/apache/sling/testing/mock/jcr/MockNodeTypeManagerTest.java b/src/test/java/org/apache/sling/testing/mock/jcr/MockNodeTypeManagerTest.java
index c1ae478..8e90eb5 100644
--- a/src/test/java/org/apache/sling/testing/mock/jcr/MockNodeTypeManagerTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/jcr/MockNodeTypeManagerTest.java
@@ -1,31 +1,23 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.sling.testing.mock.jcr;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThrows;
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.Reader;
-
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.nodetype.NoSuchNodeTypeException;
@@ -36,12 +28,22 @@ import javax.jcr.nodetype.NodeTypeIterator;
 import javax.jcr.nodetype.NodeTypeManager;
 import javax.jcr.nodetype.NodeTypeTemplate;
 
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Reader;
+
 import org.apache.jackrabbit.JcrConstants;
 import org.apache.jackrabbit.commons.cnd.ParseException;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mockito;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThrows;
+import static org.junit.Assert.assertTrue;
+
 /**
  * Tests the MockNodeTypeManager when in the ONLY_REGISTERED mode
  *
@@ -160,7 +162,9 @@ public class MockNodeTypeManagerTest {
         testDef.setName(JcrConstants.NT_FOLDER);
 
         // update not allowed
-        assertThrows(NodeTypeExistsException.class, () -> nodeTypeManager.registerNodeType((NodeTypeDefinition) testDef, false));
+        assertThrows(
+                NodeTypeExistsException.class,
+                () -> nodeTypeManager.registerNodeType((NodeTypeDefinition) testDef, false));
 
         // update allowed
         nodeTypeManager.registerNodeType((NodeTypeDefinition) testDef, true);
@@ -184,7 +188,9 @@ public class MockNodeTypeManagerTest {
         testDef2.setName(NT_INVALID);
 
         // update not allowed
-        assertThrows(NodeTypeExistsException.class, () -> nodeTypeManager.registerNodeTypes(new NodeTypeDefinition[] {testDef1, testDef2}, false));
+        assertThrows(
+                NodeTypeExistsException.class,
+                () -> nodeTypeManager.registerNodeTypes(new NodeTypeDefinition[] {testDef1, testDef2}, false));
 
         // update allowed
         nodeTypeManager.registerNodeTypes(new NodeTypeDefinition[] {testDef1, testDef2}, true);
@@ -208,10 +214,10 @@ public class MockNodeTypeManagerTest {
      */
     @Test
     public void testUnregisterNodeTypes() throws RepositoryException {
-        assertThrows(NoSuchNodeTypeException.class, () -> nodeTypeManager.unregisterNodeTypes(new String[] {NT_INVALID}));
+        assertThrows(
+                NoSuchNodeTypeException.class, () -> nodeTypeManager.unregisterNodeTypes(new String[] {NT_INVALID}));
 
         nodeTypeManager.unregisterNodeTypes(new String[] {JcrConstants.NT_FOLDER});
         assertFalse(nodeTypeManager.hasNodeType(JcrConstants.NT_FOLDER));
     }
-
 }
diff --git a/src/test/java/org/apache/sling/testing/mock/jcr/MockNodeTypeTest.java b/src/test/java/org/apache/sling/testing/mock/jcr/MockNodeTypeTest.java
index 94f3096..3795a38 100644
--- a/src/test/java/org/apache/sling/testing/mock/jcr/MockNodeTypeTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/jcr/MockNodeTypeTest.java
@@ -1,25 +1,28 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.sling.testing.mock.jcr;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import javax.jcr.RepositoryException;
+import javax.jcr.nodetype.NodeDefinition;
+import javax.jcr.nodetype.NodeType;
+import javax.jcr.nodetype.NodeTypeIterator;
+import javax.jcr.nodetype.PropertyDefinition;
 
 import java.io.IOException;
 import java.io.InputStreamReader;
@@ -28,16 +31,15 @@ import java.util.HashSet;
 import java.util.Set;
 import java.util.stream.Stream;
 
-import javax.jcr.RepositoryException;
-import javax.jcr.nodetype.NodeDefinition;
-import javax.jcr.nodetype.NodeType;
-import javax.jcr.nodetype.NodeTypeIterator;
-import javax.jcr.nodetype.PropertyDefinition;
-
 import org.apache.jackrabbit.JcrConstants;
 import org.apache.jackrabbit.commons.cnd.ParseException;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
 /**
  *
  */
@@ -79,7 +81,8 @@ public class MockNodeTypeTest extends AbstractMockNodeTypeTest {
         assertEquals(JcrConstants.JCR_CONTENT, childNodeDefinitions[0].getName());
 
         // test inheritence from supertype
-        NodeType autocreatedChildAndPropExt = this.session.getWorkspace().getNodeTypeManager().getNodeType("nt:autocreatedChildAndPropExt");
+        NodeType autocreatedChildAndPropExt =
+                this.session.getWorkspace().getNodeTypeManager().getNodeType("nt:autocreatedChildAndPropExt");
         childNodeDefinitions = autocreatedChildAndPropExt.getChildNodeDefinitions();
         assertEquals(2, childNodeDefinitions.length);
         assertTrue(Stream.of(childNodeDefinitions).anyMatch(cd -> "child1".equals(cd.getName())));
@@ -155,7 +158,8 @@ public class MockNodeTypeTest extends AbstractMockNodeTypeTest {
         assertEquals(JcrConstants.JCR_MIXINTYPES, propertyDefinitions[3].getName());
 
         // test inheritence from supertype
-        NodeType autocreatedChildAndPropExt = this.session.getWorkspace().getNodeTypeManager().getNodeType("nt:autocreatedChildAndPropExt");
+        NodeType autocreatedChildAndPropExt =
+                this.session.getWorkspace().getNodeTypeManager().getNodeType("nt:autocreatedChildAndPropExt");
         propertyDefinitions = autocreatedChildAndPropExt.getPropertyDefinitions();
         assertEquals(5, propertyDefinitions.length);
         assertTrue(Stream.of(propertyDefinitions).anyMatch(pd -> "prop1".equals(pd.getName())));
@@ -263,5 +267,4 @@ public class MockNodeTypeTest extends AbstractMockNodeTypeTest {
         NodeType ntFolder = nodeTypeManager.getNodeType(JcrConstants.NT_FOLDER);
         assertTrue(ntFolder.isQueryable());
     }
-
 }
diff --git a/src/test/java/org/apache/sling/testing/mock/jcr/MockPrincipalManagerTest.java b/src/test/java/org/apache/sling/testing/mock/jcr/MockPrincipalManagerTest.java
index a2a5961..9ea5bf3 100644
--- a/src/test/java/org/apache/sling/testing/mock/jcr/MockPrincipalManagerTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/jcr/MockPrincipalManagerTest.java
@@ -1,37 +1,31 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.sling.testing.mock.jcr;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyInt;
-import static org.mockito.ArgumentMatchers.anyString;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
 
 import java.security.Principal;
 import java.util.HashSet;
 import java.util.Set;
 
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-
+import ch.qos.logback.classic.Level;
 import org.apache.jackrabbit.api.security.principal.PrincipalIterator;
 import org.apache.jackrabbit.api.security.principal.PrincipalManager;
 import org.apache.jackrabbit.api.security.user.AuthorizableExistsException;
@@ -43,7 +37,14 @@ import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mockito;
 
-import ch.qos.logback.classic.Level;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.anyString;
 
 /**
  *
@@ -57,7 +58,7 @@ public class MockPrincipalManagerTest {
     public void before() throws RepositoryException {
         session = MockJcr.newSession();
         userManager = new MockUserManager(session);
-        principalManager = new MockPrincipalManager((MockUserManager)userManager);
+        principalManager = new MockPrincipalManager((MockUserManager) userManager);
     }
 
     /**
@@ -88,7 +89,8 @@ public class MockPrincipalManagerTest {
         @NotNull User user1 = userManager.createUser("user1", "pwd", () -> "user1", "/home/users/path1");
         @NotNull Group group1 = userManager.createGroup("group1", () -> "group1", "/home/groups/path1");
 
-        @NotNull PrincipalIterator principals = principalManager.findPrincipals("other", PrincipalManager.SEARCH_TYPE_ALL);
+        @NotNull
+        PrincipalIterator principals = principalManager.findPrincipals("other", PrincipalManager.SEARCH_TYPE_ALL);
         assertFalse(principals.hasNext());
 
         principals = principalManager.findPrincipals("user1", PrincipalManager.SEARCH_TYPE_NOT_GROUP);
@@ -99,10 +101,13 @@ public class MockPrincipalManagerTest {
         assertTrue(principals.hasNext());
         assertEquals(group1.getPrincipal(), principals.nextPrincipal());
     }
+
     @Test
     public void testFindPrincipalsStringIntCatchRepositoryException() throws Exception {
-        MockUserManager mockUserManager = Mockito.spy((MockUserManager)userManager);
-        Mockito.doThrow(RepositoryException.class).when(mockUserManager).findAuthorizables(anyString(), anyString(), anyInt());
+        MockUserManager mockUserManager = Mockito.spy((MockUserManager) userManager);
+        Mockito.doThrow(RepositoryException.class)
+                .when(mockUserManager)
+                .findAuthorizables(anyString(), anyString(), anyInt());
         // replace the field with our mocked variant
         principalManager.mockUserManager = mockUserManager;
 
@@ -112,7 +117,8 @@ public class MockPrincipalManagerTest {
             capture.setLoggerLevel(Level.WARN);
 
             // this should log an warning message
-            @NotNull PrincipalIterator principals = principalManager.findPrincipals("other", PrincipalManager.SEARCH_TYPE_ALL);
+            @NotNull
+            PrincipalIterator principals = principalManager.findPrincipals("other", PrincipalManager.SEARCH_TYPE_ALL);
             assertFalse(principals.hasNext());
 
             // verify the msg was not logged
@@ -125,7 +131,8 @@ public class MockPrincipalManagerTest {
             capture.setLoggerLevel(Level.DEBUG);
 
             // this should log an warning message
-            @NotNull PrincipalIterator principals = principalManager.findPrincipals("other", PrincipalManager.SEARCH_TYPE_ALL);
+            @NotNull
+            PrincipalIterator principals = principalManager.findPrincipals("other", PrincipalManager.SEARCH_TYPE_ALL);
             assertFalse(principals.hasNext());
 
             // verify the msg was logged
@@ -171,9 +178,10 @@ public class MockPrincipalManagerTest {
         groupMembership = principalManager.getGroupMembership(() -> "other");
         assertFalse(groupMembership.hasNext());
     }
+
     @Test
     public void testGetGroupMembershipCatchRepositoryException() throws Exception {
-        MockUserManager mockUserManager = Mockito.spy((MockUserManager)userManager);
+        MockUserManager mockUserManager = Mockito.spy((MockUserManager) userManager);
         Mockito.doThrow(RepositoryException.class).when(mockUserManager).getAuthorizable(any(Principal.class));
         // replace the field with our mocked variant
         principalManager.mockUserManager = mockUserManager;
@@ -219,9 +227,10 @@ public class MockPrincipalManagerTest {
         assertNotNull(principal);
         assertEquals("user1", principal.getName());
     }
+
     @Test
     public void testGetPrincipalCatchRepositoryException() throws Exception {
-        MockUserManager mockUserManager = Mockito.spy((MockUserManager)userManager);
+        MockUserManager mockUserManager = Mockito.spy((MockUserManager) userManager);
         Mockito.doThrow(RepositoryException.class).when(mockUserManager).getAuthorizable(anyString());
         // replace the field with our mocked variant
         principalManager.mockUserManager = mockUserManager;
@@ -284,9 +293,10 @@ public class MockPrincipalManagerTest {
         assertEquals(1, principalsSet.size());
         assertEquals("user1", principalsSet.iterator().next().getName());
     }
+
     @Test
     public void testGetPrincipalsCatchRepositoryException() throws Exception {
-        MockUserManager mockUserManager = Mockito.spy((MockUserManager)userManager);
+        MockUserManager mockUserManager = Mockito.spy((MockUserManager) userManager);
         Mockito.doThrow(RepositoryException.class).when(mockUserManager).all(anyInt());
         // replace the field with our mocked variant
         principalManager.mockUserManager = mockUserManager;
@@ -330,9 +340,10 @@ public class MockPrincipalManagerTest {
         userManager.createUser("user1", "pwd");
         assertTrue(principalManager.hasPrincipal("user1"));
     }
+
     @Test
     public void testHasPrincipalCatchRepositoryException() throws Exception {
-        MockUserManager mockUserManager = Mockito.spy((MockUserManager)userManager);
+        MockUserManager mockUserManager = Mockito.spy((MockUserManager) userManager);
         Mockito.doThrow(RepositoryException.class).when(mockUserManager).getAuthorizable(anyString());
         // replace the field with our mocked variant
         principalManager.mockUserManager = mockUserManager;
@@ -361,5 +372,4 @@ public class MockPrincipalManagerTest {
             capture.assertContains(Level.DEBUG, "Failed to determine principal exists");
         }
     }
-
 }
diff --git a/src/test/java/org/apache/sling/testing/mock/jcr/MockPropertyTest.java b/src/test/java/org/apache/sling/testing/mock/jcr/MockPropertyTest.java
index 2fad327..319ffa6 100644
--- a/src/test/java/org/apache/sling/testing/mock/jcr/MockPropertyTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/jcr/MockPropertyTest.java
@@ -18,20 +18,6 @@
  */
 package org.apache.sling.testing.mock.jcr;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertThrows;
-import static org.junit.Assert.assertTrue;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.List;
-
 import javax.jcr.Node;
 import javax.jcr.Property;
 import javax.jcr.PropertyType;
@@ -42,10 +28,24 @@ import javax.jcr.Value;
 import javax.jcr.ValueFormatException;
 import javax.jcr.util.TraversingItemVisitor;
 
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.List;
+
 import org.apache.commons.io.IOUtils;
 import org.apache.jackrabbit.value.BinaryValue;
 import org.junit.Test;
 
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThrows;
+import static org.junit.Assert.assertTrue;
+
 public class MockPropertyTest extends AbstractItemTest {
 
     @Test
@@ -84,7 +84,7 @@ public class MockPropertyTest extends AbstractItemTest {
     public void testStringSetNullViaNode() throws RepositoryException {
         this.node1.setProperty("prop1", "value1");
 
-        this.node1.setProperty("prop1", (String)null);
+        this.node1.setProperty("prop1", (String) null);
         assertFalse(this.node1.hasProperty("prop1"));
     }
 
@@ -92,13 +92,13 @@ public class MockPropertyTest extends AbstractItemTest {
     public void testStringSetNullViaProp() throws RepositoryException {
         this.node1.setProperty("prop1", "value1");
 
-        this.node1.getProperty("prop1").setValue((String)null);
+        this.node1.getProperty("prop1").setValue((String) null);
         assertFalse(this.node1.hasProperty("prop1"));
     }
 
     @Test
     public void testStringArray() throws RepositoryException {
-        String[] value1 = new String[] { "aaa", "bbb" };
+        String[] value1 = new String[] {"aaa", "bbb"};
         this.node1.setProperty("prop1", value1);
         Property prop1 = this.node1.getProperty("prop1");
 
@@ -107,7 +107,7 @@ public class MockPropertyTest extends AbstractItemTest {
             assertEquals("value #" + i, value1[i], values[i].getString());
         }
 
-        String[] value2 = new String[] { "cc" };
+        String[] value2 = new String[] {"cc"};
         prop1.setValue(value2);
         values = prop1.getValues();
         for (int i = 0; i < values.length; i++) {
@@ -116,24 +116,24 @@ public class MockPropertyTest extends AbstractItemTest {
 
         assertTrue(prop1.isMultiple());
         assertTrue(prop1.getDefinition().isMultiple());
-        assertArrayEquals(new long[] { 2 }, prop1.getLengths());
+        assertArrayEquals(new long[] {2}, prop1.getLengths());
     }
 
     @Test
     public void testStringArraySetNullViaNode() throws RepositoryException {
-        String[] value1 = new String[] { "aaa", "bbb" };
+        String[] value1 = new String[] {"aaa", "bbb"};
         this.node1.setProperty("prop1", value1);
 
-        this.node1.setProperty("prop1", (String[])null);
+        this.node1.setProperty("prop1", (String[]) null);
         assertFalse(this.node1.hasProperty("prop1"));
     }
 
     @Test
     public void testStringArraySetNullViaProp() throws RepositoryException {
-        String[] value1 = new String[] { "aaa", "bbb" };
+        String[] value1 = new String[] {"aaa", "bbb"};
         this.node1.setProperty("prop1", value1);
 
-        this.node1.getProperty("prop1").setValue((String[])null);
+        this.node1.getProperty("prop1").setValue((String[]) null);
         assertFalse(this.node1.hasProperty("prop1"));
     }
 
@@ -189,7 +189,7 @@ public class MockPropertyTest extends AbstractItemTest {
     public void testBigDecimalSetNullViaNode() throws RepositoryException {
         this.node1.setProperty("prop1", new BigDecimal("1.5"));
 
-        this.node1.setProperty("prop1", (BigDecimal)null);
+        this.node1.setProperty("prop1", (BigDecimal) null);
         assertFalse(this.node1.hasProperty("prop1"));
     }
 
@@ -197,7 +197,7 @@ public class MockPropertyTest extends AbstractItemTest {
     public void testBigDecimalSetNullViaProp() throws RepositoryException {
         this.node1.setProperty("prop1", new BigDecimal("1.5"));
 
-        this.node1.getProperty("prop1").setValue((BigDecimal)null);
+        this.node1.getProperty("prop1").setValue((BigDecimal) null);
         assertFalse(this.node1.hasProperty("prop1"));
     }
 
@@ -223,7 +223,7 @@ public class MockPropertyTest extends AbstractItemTest {
         Calendar value1 = Calendar.getInstance();
         this.node1.setProperty("prop1", value1);
 
-        this.node1.setProperty("prop1", (Calendar)null);
+        this.node1.setProperty("prop1", (Calendar) null);
         assertFalse(this.node1.hasProperty("prop1"));
     }
 
@@ -232,54 +232,56 @@ public class MockPropertyTest extends AbstractItemTest {
         Calendar value1 = Calendar.getInstance();
         this.node1.setProperty("prop1", value1);
 
-        this.node1.getProperty("prop1").setValue((Calendar)null);
+        this.node1.getProperty("prop1").setValue((Calendar) null);
         assertFalse(this.node1.hasProperty("prop1"));
     }
 
     @Test
     public void testBinary() throws RepositoryException, IOException {
-        byte[] value1 = new byte[] { 0x01, 0x01, 0x03 };
+        byte[] value1 = new byte[] {0x01, 0x01, 0x03};
 
         this.node1.setProperty("prop1", new BinaryValue(value1).getBinary());
         Property prop1 = this.node1.getProperty("prop1");
         assertArrayEquals(value1, IOUtils.toByteArray(prop1.getBinary().getStream()));
-        assertArrayEquals(value1, IOUtils.toByteArray(prop1.getValue().getBinary().getStream()));
+        assertArrayEquals(
+                value1, IOUtils.toByteArray(prop1.getValue().getBinary().getStream()));
 
-        byte[] value2 = new byte[] { 0x04, 0x05, 0x06 };
+        byte[] value2 = new byte[] {0x04, 0x05, 0x06};
 
         prop1.setValue(new BinaryValue(value2).getBinary());
         assertArrayEquals(value2, IOUtils.toByteArray(prop1.getBinary().getStream()));
-        assertArrayEquals(value2, IOUtils.toByteArray(prop1.getValue().getBinary().getStream()));
+        assertArrayEquals(
+                value2, IOUtils.toByteArray(prop1.getValue().getBinary().getStream()));
     }
 
     @Test
     public void testBinarySetNullViaNode() throws RepositoryException {
-        byte[] value1 = new byte[] { 0x01, 0x01, 0x03 };
+        byte[] value1 = new byte[] {0x01, 0x01, 0x03};
         this.node1.setProperty("prop1", new BinaryValue(value1).getBinary());
 
-        this.node1.setProperty("prop1", (BinaryValue)null);
+        this.node1.setProperty("prop1", (BinaryValue) null);
         assertFalse(this.node1.hasProperty("prop1"));
     }
 
     @Test
     public void testBinarySetNullViaProp() throws RepositoryException {
-        byte[] value1 = new byte[] { 0x01, 0x01, 0x03 };
+        byte[] value1 = new byte[] {0x01, 0x01, 0x03};
         this.node1.setProperty("prop1", new BinaryValue(value1).getBinary());
 
-        this.node1.getProperty("prop1").setValue((BinaryValue)null);
+        this.node1.getProperty("prop1").setValue((BinaryValue) null);
         assertFalse(this.node1.hasProperty("prop1"));
     }
 
     @SuppressWarnings("deprecation")
     @Test
     public void testInputStream() throws RepositoryException, IOException {
-        byte[] value1 = new byte[] { 0x01, 0x01, 0x03 };
+        byte[] value1 = new byte[] {0x01, 0x01, 0x03};
 
         this.node1.setProperty("prop1", new ByteArrayInputStream(value1));
         Property prop1 = this.node1.getProperty("prop1");
         assertArrayEquals(value1, IOUtils.toByteArray(prop1.getStream()));
 
-        byte[] value2 = new byte[] { 0x04, 0x05, 0x06 };
+        byte[] value2 = new byte[] {0x04, 0x05, 0x06};
 
         prop1.setValue(new ByteArrayInputStream(value2));
         assertArrayEquals(value2, IOUtils.toByteArray(prop1.getValue().getStream()));
@@ -288,20 +290,20 @@ public class MockPropertyTest extends AbstractItemTest {
     @SuppressWarnings("deprecation")
     @Test
     public void testInputStreamSetNullViaNode() throws RepositoryException {
-        byte[] value1 = new byte[] { 0x01, 0x01, 0x03 };
+        byte[] value1 = new byte[] {0x01, 0x01, 0x03};
         this.node1.setProperty("prop1", new ByteArrayInputStream(value1));
 
-        this.node1.setProperty("prop1", (InputStream)null);
+        this.node1.setProperty("prop1", (InputStream) null);
         assertFalse(this.node1.hasProperty("prop1"));
     }
 
     @SuppressWarnings("deprecation")
     @Test
     public void testInputStreamSetNullViaProp() throws RepositoryException {
-        byte[] value1 = new byte[] { 0x01, 0x01, 0x03 };
+        byte[] value1 = new byte[] {0x01, 0x01, 0x03};
         this.node1.setProperty("prop1", new ByteArrayInputStream(value1));
 
-        this.node1.getProperty("prop1").setValue((InputStream)null);
+        this.node1.getProperty("prop1").setValue((InputStream) null);
         assertFalse(this.node1.hasProperty("prop1"));
     }
 
@@ -325,7 +327,7 @@ public class MockPropertyTest extends AbstractItemTest {
     public void testValueSetNullViaNode() throws RepositoryException {
         this.node1.setProperty("prop1", this.session.getValueFactory().createValue("value1"));
 
-        this.node1.setProperty("prop1", (Value)null);
+        this.node1.setProperty("prop1", (Value) null);
         assertFalse(this.node1.hasProperty("prop1"));
     }
 
@@ -333,14 +335,16 @@ public class MockPropertyTest extends AbstractItemTest {
     public void testValueSetNullViaProp() throws RepositoryException {
         this.node1.setProperty("prop1", this.session.getValueFactory().createValue("value1"));
 
-        this.node1.getProperty("prop1").setValue((Value)null);
+        this.node1.getProperty("prop1").setValue((Value) null);
         assertFalse(this.node1.hasProperty("prop1"));
     }
 
     @Test
     public void testValueArray() throws RepositoryException {
-        Value[] value1 = new Value[] { this.session.getValueFactory().createValue("aaa"),
-                this.session.getValueFactory().createValue("bbb") };
+        Value[] value1 = new Value[] {
+            this.session.getValueFactory().createValue("aaa"),
+            this.session.getValueFactory().createValue("bbb")
+        };
         this.node1.setProperty("prop1", value1);
         Property prop1 = this.node1.getProperty("prop1");
 
@@ -349,7 +353,7 @@ public class MockPropertyTest extends AbstractItemTest {
             assertEquals("value #" + i, value1[i].getString(), values[i].getString());
         }
 
-        Value[] value2 = new Value[] { this.session.getValueFactory().createValue("cc") };
+        Value[] value2 = new Value[] {this.session.getValueFactory().createValue("cc")};
         prop1.setValue(value2);
         values = prop1.getValues();
         for (int i = 0; i < values.length; i++) {
@@ -358,26 +362,30 @@ public class MockPropertyTest extends AbstractItemTest {
 
         assertTrue(prop1.isMultiple());
         assertTrue(prop1.getDefinition().isMultiple());
-        assertArrayEquals(new long[] { 2 }, prop1.getLengths());
+        assertArrayEquals(new long[] {2}, prop1.getLengths());
     }
 
     @Test
     public void testValueArraySetNullViaNode() throws RepositoryException {
-        Value[] value1 = new Value[] { this.session.getValueFactory().createValue("aaa"),
-                this.session.getValueFactory().createValue("bbb") };
+        Value[] value1 = new Value[] {
+            this.session.getValueFactory().createValue("aaa"),
+            this.session.getValueFactory().createValue("bbb")
+        };
         this.node1.setProperty("prop1", value1);
 
-        this.node1.setProperty("prop1", (Value[])null);
+        this.node1.setProperty("prop1", (Value[]) null);
         assertFalse(this.node1.hasProperty("prop1"));
     }
 
     @Test
     public void testValueArraySetNullViaProp() throws RepositoryException {
-        Value[] value1 = new Value[] { this.session.getValueFactory().createValue("aaa"),
-                this.session.getValueFactory().createValue("bbb") };
+        Value[] value1 = new Value[] {
+            this.session.getValueFactory().createValue("aaa"),
+            this.session.getValueFactory().createValue("bbb")
+        };
         this.node1.setProperty("prop1", value1);
 
-        this.node1.getProperty("prop1").setValue((Value[])null);
+        this.node1.getProperty("prop1").setValue((Value[]) null);
         assertFalse(this.node1.hasProperty("prop1"));
     }
 
@@ -477,5 +485,4 @@ public class MockPropertyTest extends AbstractItemTest {
         assertEquals(1, enterProperties.size());
         assertEquals(1, leaveProperties.size());
     }
-
 }
diff --git a/src/test/java/org/apache/sling/testing/mock/jcr/MockQueryManagerTest.java b/src/test/java/org/apache/sling/testing/mock/jcr/MockQueryManagerTest.java
index da9eadd..c32c015 100644
--- a/src/test/java/org/apache/sling/testing/mock/jcr/MockQueryManagerTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/jcr/MockQueryManagerTest.java
@@ -18,12 +18,6 @@
  */
 package org.apache.sling.testing.mock.jcr;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-
-import java.util.List;
-
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
@@ -33,11 +27,17 @@ import javax.jcr.query.QueryManager;
 import javax.jcr.query.QueryResult;
 import javax.jcr.query.Row;
 
+import java.util.List;
+
 import org.apache.commons.collections4.IteratorUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+
 public class MockQueryManagerTest {
 
     private Session session;
@@ -51,13 +51,9 @@ public class MockQueryManagerTest {
 
         Node rootNode = session.getRootNode();
 
-        sampleNodes = List.of(
-            rootNode.addNode("node1"),
-            rootNode.addNode("node2"),
-            rootNode.addNode("node3")
-        );
+        sampleNodes = List.of(rootNode.addNode("node1"), rootNode.addNode("node2"), rootNode.addNode("node3"));
 
-        for (int i=0; i<sampleNodes.size(); i++) {
+        for (int i = 0; i < sampleNodes.size(); i++) {
             Node node = sampleNodes.get(i);
             node.setProperty("stringProp", "value" + (i + 1));
             node.setProperty("intProp", i + 1);
@@ -72,7 +68,7 @@ public class MockQueryManagerTest {
         assertFalse(result.getNodes().hasNext());
     }
 
-    @Test(expected=InvalidQueryException.class)
+    @Test(expected = InvalidQueryException.class)
     public void testInvalidQueryLanguage() throws RepositoryException {
         queryManager.createQuery("dummy", "wurst");
     }
@@ -84,6 +80,7 @@ public class MockQueryManagerTest {
         QueryResult result = assertQueryResults_AllQuerys();
         assertEquals(sampleNodes.size(), result.getNodes().getSize());
     }
+
     @Test
     public void testQueryResultsForSession_AllQuerys() throws RepositoryException {
         MockJcr.setQueryResult(session, sampleNodes);
@@ -100,6 +97,7 @@ public class MockQueryManagerTest {
         QueryResult result = assertQueryResults_AllQuerys();
         assertEquals(-1, result.getNodes().getSize());
     }
+
     @Test
     public void testQueryResultsForSession_AllQuerys_WithUnknownSize() throws RepositoryException {
         MockJcr.setQueryResult(session, sampleNodes, true);
@@ -127,6 +125,7 @@ public class MockQueryManagerTest {
         QueryResult result = assertQueryResults_SpecificQuery();
         assertEquals(sampleNodes.size(), result.getNodes().getSize());
     }
+
     @Test
     public void testQueryResultsForSession_SpecificQuery() throws RepositoryException {
         MockJcr.setQueryResult(session, "query1", Query.JCR_SQL2, sampleNodes);
@@ -143,6 +142,7 @@ public class MockQueryManagerTest {
         QueryResult result = assertQueryResults_SpecificQuery();
         assertEquals(-1, result.getNodes().getSize());
     }
+
     @Test
     public void testQueryResultsForSession_SpecificQuery_WithUnknownSize() throws RepositoryException {
         MockJcr.setQueryResult(session, "query1", Query.JCR_SQL2, sampleNodes, true);
@@ -238,11 +238,7 @@ public class MockQueryManagerTest {
     @SuppressWarnings("unchecked")
     @Test
     public void testQueryResults_ResultHandler_Rows() throws RepositoryException {
-        final List<String> columnNames = List.of(
-            "stringProp",
-            "intProp",
-            "optionalStringProp"
-        );
+        final List<String> columnNames = List.of("stringProp", "intProp", "optionalStringProp");
 
         MockJcr.addQueryResultHandler(queryManager, new MockQueryResultHandler() {
             @Override
@@ -270,5 +266,4 @@ public class MockQueryManagerTest {
         assertEquals(3L, rows.get(2).getValues()[1].getLong());
         assertNull(rows.get(2).getValues()[2]);
     }
-
 }
diff --git a/src/test/java/org/apache/sling/testing/mock/jcr/MockRepositoryTest.java b/src/test/java/org/apache/sling/testing/mock/jcr/MockRepositoryTest.java
index 7b680c2..a4c7dc5 100644
--- a/src/test/java/org/apache/sling/testing/mock/jcr/MockRepositoryTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/jcr/MockRepositoryTest.java
@@ -18,12 +18,6 @@
  */
 package org.apache.sling.testing.mock.jcr;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.fail;
-
 import javax.jcr.Node;
 import javax.jcr.PathNotFoundException;
 import javax.jcr.Repository;
@@ -34,6 +28,12 @@ import javax.jcr.SimpleCredentials;
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.fail;
+
 public class MockRepositoryTest {
 
     private static final String USER_NAME = "user";
@@ -85,10 +85,8 @@ public class MockRepositoryTest {
         try {
             session1.getNode("/test");
             fail("Node was not removed");
-        }
-        catch (PathNotFoundException ex) {
+        } catch (PathNotFoundException ex) {
             // expected
         }
     }
-
 }
diff --git a/src/test/java/org/apache/sling/testing/mock/jcr/MockSessionTest.java b/src/test/java/org/apache/sling/testing/mock/jcr/MockSessionTest.java
index 2f11246..028938f 100644
--- a/src/test/java/org/apache/sling/testing/mock/jcr/MockSessionTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/jcr/MockSessionTest.java
@@ -18,16 +18,6 @@
  */
 package org.apache.sling.testing.mock.jcr;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertThrows;
-import static org.junit.Assert.assertTrue;
-
-import java.util.Set;
-
 import javax.jcr.AccessDeniedException;
 import javax.jcr.ItemExistsException;
 import javax.jcr.ItemNotFoundException;
@@ -41,11 +31,21 @@ import javax.jcr.Session;
 import javax.jcr.UnsupportedRepositoryOperationException;
 import javax.jcr.security.AccessControlManager;
 
+import java.util.Set;
+
 import org.apache.jackrabbit.JcrConstants;
 import org.apache.jackrabbit.api.JackrabbitSession;
 import org.junit.Test;
 import org.mockito.Mockito;
 
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertThrows;
+import static org.junit.Assert.assertTrue;
+
 public class MockSessionTest {
 
     @Test
@@ -128,7 +128,6 @@ public class MockSessionTest {
         assertEquals(JcrConstants.NT_UNSTRUCTURED, node1.getPrimaryNodeType().getName());
         assertTrue(node1.isNodeType(JcrConstants.NT_UNSTRUCTURED));
         assertTrue(node1.getPrimaryNodeType().isNodeType(JcrConstants.NT_UNSTRUCTURED));
-
     }
 
     @Test
@@ -208,7 +207,7 @@ public class MockSessionTest {
         Session session = MockJcr.newSession();
 
         // test initial namespaces
-        assertArrayEquals(new String[] { "jcr" }, session.getNamespacePrefixes());
+        assertArrayEquals(new String[] {"jcr"}, session.getNamespacePrefixes());
         assertEquals("http://www.jcp.org/jcr/1.0", session.getNamespaceURI("jcr"));
         assertEquals("jcr", session.getNamespacePrefix("http://www.jcp.org/jcr/1.0"));
 
@@ -223,8 +222,7 @@ public class MockSessionTest {
         NamespaceRegistry namespaceRegistry = session.getWorkspace().getNamespaceRegistry();
 
         assertEquals(Set.of("jcr", "dummy"), Set.of(namespaceRegistry.getPrefixes()));
-        assertEquals(Set.of("http://www.jcp.org/jcr/1.0", "http://mydummy"),
-                Set.of(namespaceRegistry.getURIs()));
+        assertEquals(Set.of("http://www.jcp.org/jcr/1.0", "http://mydummy"), Set.of(namespaceRegistry.getURIs()));
         assertEquals("http://mydummy", namespaceRegistry.getURI("dummy"));
         assertEquals("dummy", namespaceRegistry.getPrefix("http://mydummy"));
 
@@ -415,12 +413,11 @@ public class MockSessionTest {
         assertTrue(session.propertyExists("/node1/child2/grandchild1/prop1"));
     }
 
-
     // --- jackrabbit session operations ---
 
     @Test
     public void testGetItemOrNull() throws RepositoryException {
-        JackrabbitSession s = (JackrabbitSession)MockJcr.newSession();
+        JackrabbitSession s = (JackrabbitSession) MockJcr.newSession();
         Node node1 = s.getRootNode().addNode("node1");
         Node child1 = node1.addNode("child1");
         String childPath = child1.getPath();
@@ -437,7 +434,7 @@ public class MockSessionTest {
 
     @Test
     public void testGetNodeOrNull() throws RepositoryException {
-        JackrabbitSession s = (JackrabbitSession)MockJcr.newSession();
+        JackrabbitSession s = (JackrabbitSession) MockJcr.newSession();
         Node node1 = s.getRootNode().addNode("node1");
         Node child1 = node1.addNode("child1");
         String path = child1.getPath();
@@ -448,7 +445,7 @@ public class MockSessionTest {
 
     @Test
     public void testGetPropertyOrNull() throws RepositoryException {
-        JackrabbitSession s = (JackrabbitSession)MockJcr.newSession();
+        JackrabbitSession s = (JackrabbitSession) MockJcr.newSession();
         Node node1 = s.getRootNode().addNode("node1");
         Node child1 = node1.addNode("child1");
         Property prop1 = child1.setProperty("prop1", "value1");
@@ -461,21 +458,24 @@ public class MockSessionTest {
     @Test
     public void testGetPrincipalManager()
             throws AccessDeniedException, UnsupportedRepositoryOperationException, RepositoryException {
-        JackrabbitSession s = (JackrabbitSession)MockJcr.newSession();
+        JackrabbitSession s = (JackrabbitSession) MockJcr.newSession();
         assertNotNull(s.getPrincipalManager());
     }
 
     @Test
     public void testGetUserManager()
             throws AccessDeniedException, UnsupportedRepositoryOperationException, RepositoryException {
-        JackrabbitSession s = (JackrabbitSession)MockJcr.newSession();
+        JackrabbitSession s = (JackrabbitSession) MockJcr.newSession();
         assertNotNull(s.getUserManager());
     }
 
     @Test
     public void testHasPermission() throws RepositoryException {
-        JackrabbitSession s = (JackrabbitSession)MockJcr.newSession();
-        assertThrows(UnsupportedOperationException.class, () -> s.hasPermission("/path1", JackrabbitSession.ACTION_ADD_PROPERTY, JackrabbitSession.ACTION_MODIFY_PROPERTY));
+        JackrabbitSession s = (JackrabbitSession) MockJcr.newSession();
+        assertThrows(
+                UnsupportedOperationException.class,
+                () -> s.hasPermission(
+                        "/path1", JackrabbitSession.ACTION_ADD_PROPERTY, JackrabbitSession.ACTION_MODIFY_PROPERTY));
     }
 
     @Test
@@ -488,5 +488,4 @@ public class MockSessionTest {
 
         assertEquals(mockAccessControlManager, s.getAccessControlManager());
     }
-
 }
diff --git a/src/test/java/org/apache/sling/testing/mock/jcr/MockUserManagerTest.java b/src/test/java/org/apache/sling/testing/mock/jcr/MockUserManagerTest.java
index d63e626..24290ad 100644
--- a/src/test/java/org/apache/sling/testing/mock/jcr/MockUserManagerTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/jcr/MockUserManagerTest.java
@@ -1,33 +1,23 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.sling.testing.mock.jcr;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertThrows;
-import static org.junit.Assert.assertTrue;
-
-import java.io.UnsupportedEncodingException;
-import java.security.NoSuchAlgorithmException;
-import java.util.Iterator;
-import java.util.Set;
-
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
@@ -35,6 +25,12 @@ import javax.jcr.SimpleCredentials;
 import javax.jcr.UnsupportedRepositoryOperationException;
 import javax.jcr.ValueFactory;
 
+import java.io.UnsupportedEncodingException;
+import java.security.NoSuchAlgorithmException;
+import java.util.Iterator;
+import java.util.Set;
+
+import ch.qos.logback.classic.Level;
 import org.apache.jackrabbit.api.security.user.Authorizable;
 import org.apache.jackrabbit.api.security.user.AuthorizableExistsException;
 import org.apache.jackrabbit.api.security.user.AuthorizableTypeException;
@@ -51,7 +47,12 @@ import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mockito;
 
-import ch.qos.logback.classic.Level;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertThrows;
+import static org.junit.Assert.assertTrue;
 
 /**
  *
@@ -91,9 +92,9 @@ public class MockUserManagerTest {
     }
 
     @Test
-    public void testLoadAlreadyExistingAuthorizables() throws RepositoryException, NoSuchAlgorithmException, UnsupportedEncodingException {
-        Node homeNode = session.getRootNode()
-            .addNode("home", UserConstants.NT_REP_AUTHORIZABLE_FOLDER);
+    public void testLoadAlreadyExistingAuthorizables()
+            throws RepositoryException, NoSuchAlgorithmException, UnsupportedEncodingException {
+        Node homeNode = session.getRootNode().addNode("home", UserConstants.NT_REP_AUTHORIZABLE_FOLDER);
         Node usersNode = homeNode.addNode("users", UserConstants.NT_REP_AUTHORIZABLE_FOLDER);
         Node testuser1 = usersNode.addNode("testuser1", UserConstants.NT_REP_USER);
         testuser1.setProperty(UserConstants.REP_AUTHORIZABLE_ID, "testuser1");
@@ -121,13 +122,13 @@ public class MockUserManagerTest {
         @Nullable Authorizable authorizable = userManager.getAuthorizable("testuser1");
         assertTrue(authorizable instanceof User);
         // verify password state was stored
-        SimpleCredentials creds = (SimpleCredentials)((User)authorizable).getCredentials();
+        SimpleCredentials creds = (SimpleCredentials) ((User) authorizable).getCredentials();
         assertTrue(PasswordUtil.isSame(String.valueOf(creds.getPassword()), "testPwd"));
         @Nullable Authorizable authorizable2 = userManager.getAuthorizable("testuser2");
         assertTrue(authorizable2 instanceof User);
         // verify disabled state was stored
-        assertTrue(((User)authorizable2).isDisabled());
-        assertEquals("Bad Behavior", ((User)authorizable2).getDisabledReason());
+        assertTrue(((User) authorizable2).isDisabled());
+        assertEquals("Bad Behavior", ((User) authorizable2).getDisabledReason());
         assertNotNull(userManager.getAuthorizable("testsystemuser1"));
         assertNotNull(userManager.getAuthorizable("testgroup1"));
     }
@@ -222,6 +223,7 @@ public class MockUserManagerTest {
         assertTrue(user.isSystemUser());
         assertEquals("/home/users/system/test", ResourceUtil.getParent(user.getPath()));
     }
+
     @Test
     public void testCreateSystemUserWithNullIntermediatePath() throws RepositoryException {
         @NotNull User user = userManager.createSystemUser("systemuser1", null);
@@ -249,8 +251,10 @@ public class MockUserManagerTest {
         assertNotNull(user1);
         assertEquals("/home/users/path1/user1", user1.getPath());
     }
+
     @Test
-    public void testCreateUserStringStringPrincipalStringWithNullIntermediatePath() throws AuthorizableExistsException, RepositoryException {
+    public void testCreateUserStringStringPrincipalStringWithNullIntermediatePath()
+            throws AuthorizableExistsException, RepositoryException {
         @NotNull User user1 = userManager.createUser("user1", "pwd", () -> "user1", null);
         assertNotNull(user1);
         assertEquals("/home/users", ResourceUtil.getParent(user1.getPath()));
@@ -282,7 +286,8 @@ public class MockUserManagerTest {
      */
     @Test
     public void testEnsureAuthorizablePathExistsStringStringString() throws RepositoryException {
-        Node user1node = userManager.ensureAuthorizablePathExists("/home/users/path1", "user1", UserConstants.NT_REP_USER);
+        Node user1node =
+                userManager.ensureAuthorizablePathExists("/home/users/path1", "user1", UserConstants.NT_REP_USER);
         assertNotNull(user1node);
 
         // one more time to ensure it works if the path already exists
@@ -337,7 +342,9 @@ public class MockUserManagerTest {
         user1.setProperty("sub1/prop2", vf.createValue("prop2Value"));
 
         // none found
-        @NotNull Iterator<Authorizable> authorizables = userManager.findAuthorizables("prop1", "other", UserManager.SEARCH_TYPE_AUTHORIZABLE);
+        @NotNull
+        Iterator<Authorizable> authorizables =
+                userManager.findAuthorizables("prop1", "other", UserManager.SEARCH_TYPE_AUTHORIZABLE);
         assertFalse(authorizables.hasNext());
 
         // found by name
@@ -366,7 +373,7 @@ public class MockUserManagerTest {
         assertEquals(group1, authorizables.next());
 
         // not found by relPath
-        authorizables = userManager.findAuthorizables("sub1/prop3","prop3Value", UserManager.SEARCH_TYPE_GROUP);
+        authorizables = userManager.findAuthorizables("sub1/prop3", "prop3Value", UserManager.SEARCH_TYPE_GROUP);
         assertFalse(authorizables.hasNext());
 
         // some invalid type
@@ -409,7 +416,8 @@ public class MockUserManagerTest {
      * Test to verify the fix for SLING-12166
      */
     @Test
-    public void testGetAuthorizableStringClassOfTWhenItDoesNotExist() throws AuthorizableExistsException, RepositoryException {
+    public void testGetAuthorizableStringClassOfTWhenItDoesNotExist()
+            throws AuthorizableExistsException, RepositoryException {
         @Nullable Authorizable authorizable = userManager.getAuthorizable("user1", User.class);
         assertNull(authorizable);
     }
@@ -422,9 +430,10 @@ public class MockUserManagerTest {
         @NotNull User user1 = userManager.createUser("user1", "pwd", () -> "user1", "/home/users/path1");
         @Nullable Authorizable authorizable = userManager.getAuthorizableByPath(user1.getPath());
         assertEquals(user1, authorizable);
-        
-        //throws exception
+
+        // throws exception
     }
+
     @Test
     public void testGetAuthorizableByPathCatchRepositoryException() throws Exception {
         @NotNull User user1 = userManager.createUser("user1", "pwd", () -> "user1", "/home/users/path1");
@@ -457,5 +466,4 @@ public class MockUserManagerTest {
             capture.assertContains(Level.DEBUG, "Failed to match authorizable path");
         }
     }
-
 }
diff --git a/src/test/java/org/apache/sling/testing/mock/jcr/MockUserTest.java b/src/test/java/org/apache/sling/testing/mock/jcr/MockUserTest.java
index dc803a0..3b2105f 100644
--- a/src/test/java/org/apache/sling/testing/mock/jcr/MockUserTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/jcr/MockUserTest.java
@@ -1,36 +1,33 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.sling.testing.mock.jcr;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertThrows;
-import static org.junit.Assert.assertTrue;
-
-import java.io.UnsupportedEncodingException;
-import java.security.NoSuchAlgorithmException;
-
 import javax.jcr.Credentials;
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.SimpleCredentials;
 import javax.jcr.UnsupportedRepositoryOperationException;
 
+import java.io.UnsupportedEncodingException;
+import java.security.NoSuchAlgorithmException;
+
+import ch.qos.logback.classic.Level;
 import org.apache.jackrabbit.api.security.user.User;
 import org.apache.jackrabbit.oak.spi.security.user.UserConstants;
 import org.apache.jackrabbit.oak.spi.security.user.UserIdCredentials;
@@ -40,7 +37,11 @@ import org.junit.Test;
 import org.mockito.MockedStatic;
 import org.mockito.Mockito;
 
-import ch.qos.logback.classic.Level;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertThrows;
+import static org.junit.Assert.assertTrue;
 
 /**
  *
@@ -72,6 +73,7 @@ public class MockUserTest extends MockAuthorizableTest<User> {
         assertFalse(authorizable.isAdmin());
         assertTrue(userManager.createUser("admin", "admin").isAdmin());
     }
+
     @Test
     public void testIsAdminCatchRepositoryException() throws Exception {
         User mockAuthorizable = Mockito.spy(authorizable);
@@ -117,8 +119,9 @@ public class MockUserTest extends MockAuthorizableTest<User> {
     public void testGetCredentials() throws RepositoryException {
         @NotNull Credentials credentials = authorizable.getCredentials();
         assertTrue(credentials instanceof SimpleCredentials);
-        assertEquals(authorizable.getID(), ((SimpleCredentials)credentials).getUserID());
+        assertEquals(authorizable.getID(), ((SimpleCredentials) credentials).getUserID());
     }
+
     @Test
     public void testGetCredentialsWithNullPassword() throws RepositoryException {
         // create a user with no password
@@ -126,7 +129,7 @@ public class MockUserTest extends MockAuthorizableTest<User> {
 
         @NotNull Credentials credentials = authorizable.getCredentials();
         assertTrue(credentials instanceof UserIdCredentials);
-        assertEquals(authorizable.getID(), ((UserIdCredentials)credentials).getUserId());
+        assertEquals(authorizable.getID(), ((UserIdCredentials) credentials).getUserId());
     }
 
     /**
@@ -147,6 +150,7 @@ public class MockUserTest extends MockAuthorizableTest<User> {
 
         assertThrows(RepositoryException.class, () -> authorizable.changePassword(null));
     }
+
     @Test
     public void testChangePasswordStringFromNull() throws RepositoryException {
         // start with a null password - for code coverage
@@ -156,23 +160,26 @@ public class MockUserTest extends MockAuthorizableTest<User> {
 
     @Test
     public void testChangePasswordStringWithCaughtNoSuchAlgorithmException() throws RepositoryException {
-        try (MockedStatic<PasswordUtil> passwordUtilMock = Mockito.mockStatic(PasswordUtil.class);) {
-            passwordUtilMock.when(() -> PasswordUtil.buildPasswordHash("changed"))
-                .thenThrow(NoSuchAlgorithmException.class);
+        try (MockedStatic<PasswordUtil> passwordUtilMock = Mockito.mockStatic(PasswordUtil.class); ) {
+            passwordUtilMock
+                    .when(() -> PasswordUtil.buildPasswordHash("changed"))
+                    .thenThrow(NoSuchAlgorithmException.class);
             assertThrows(RepositoryException.class, () -> authorizable.changePassword("changed"));
         }
     }
+
     @Test
     public void testChangePasswordStringWithCaughtUnsupportedEncodingExceptionException() throws RepositoryException {
-        try (MockedStatic<PasswordUtil> passwordUtilMock = Mockito.mockStatic(PasswordUtil.class);) {
-            passwordUtilMock.when(() -> PasswordUtil.buildPasswordHash("changed"))
-                .thenThrow(UnsupportedEncodingException.class);
+        try (MockedStatic<PasswordUtil> passwordUtilMock = Mockito.mockStatic(PasswordUtil.class); ) {
+            passwordUtilMock
+                    .when(() -> PasswordUtil.buildPasswordHash("changed"))
+                    .thenThrow(UnsupportedEncodingException.class);
             assertThrows(RepositoryException.class, () -> authorizable.changePassword("changed"));
         }
     }
 
-    protected void assertPassword(char [] expectedPwd) throws RepositoryException {
-        SimpleCredentials creds = (SimpleCredentials)authorizable.getCredentials();
+    protected void assertPassword(char[] expectedPwd) throws RepositoryException {
+        SimpleCredentials creds = (SimpleCredentials) authorizable.getCredentials();
         assertTrue(PasswordUtil.isSame(new String(creds.getPassword()), expectedPwd));
     }
 
@@ -232,7 +239,8 @@ public class MockUserTest extends MockAuthorizableTest<User> {
         assertEquals("/home/users/user1", authorizable.getPath());
         assertTrue(session.nodeExists(authorizable.getPath()));
         Node node = session.getNode(authorizable.getPath());
-        assertEquals(authorizable.getID(), 
+        assertEquals(
+                authorizable.getID(),
                 node.getProperty(UserConstants.REP_PRINCIPAL_NAME).getString());
     }
 
@@ -243,5 +251,4 @@ public class MockUserTest extends MockAuthorizableTest<User> {
         authorizable = userManager.createUser("user2", null);
         super.testGetPropertyNames();
     }
-
 }
diff --git a/src/test/java/org/apache/sling/testing/mock/jcr/MockWorkspaceTest.java b/src/test/java/org/apache/sling/testing/mock/jcr/MockWorkspaceTest.java
index cd4830e..84d05a4 100644
--- a/src/test/java/org/apache/sling/testing/mock/jcr/MockWorkspaceTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/jcr/MockWorkspaceTest.java
@@ -18,11 +18,6 @@
  */
 package org.apache.sling.testing.mock.jcr;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
 import javax.jcr.RepositoryException;
 import javax.jcr.Workspace;
 import javax.jcr.observation.ObservationManager;
@@ -30,6 +25,11 @@ import javax.jcr.observation.ObservationManager;
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
 public class MockWorkspaceTest {
 
     private Workspace underTest;
@@ -65,5 +65,4 @@ public class MockWorkspaceTest {
     public void testNodeTypeManager() throws RepositoryException {
         assertNotNull(underTest.getNodeTypeManager());
     }
-
 }
diff --git a/src/test/java/org/apache/sling/testing/mock/jcr/ResourceUtilTest.java b/src/test/java/org/apache/sling/testing/mock/jcr/ResourceUtilTest.java
index 05256bc..b8de472 100644
--- a/src/test/java/org/apache/sling/testing/mock/jcr/ResourceUtilTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/jcr/ResourceUtilTest.java
@@ -18,12 +18,12 @@
  */
 package org.apache.sling.testing.mock.jcr;
 
+import org.junit.Test;
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.fail;
 
-import org.junit.Test;
-
 public class ResourceUtilTest {
 
     @Test
@@ -217,5 +217,4 @@ public class ResourceUtilTest {
         assertEquals("/", ResourceUtil.getParent("/b/c/d", 3));
         assertEquals("/", ResourceUtil.getParent("/b///", 1));
     }
-
 }


(sling-org-apache-sling-testing-jcr-mock) 01/02: SLING-12284 Update to Parent 60, Java 11 Minimum Version

Posted by ss...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sseifert pushed a commit to branch feature/SLING-12284-parent-60
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-jcr-mock.git

commit 9a550cd0ce880d8cbf30d83e28068d547ba8c4d9
Author: Stefan Seifert <st...@users.noreply.github.com>
AuthorDate: Tue Apr 9 17:30:23 2024 +0200

    SLING-12284 Update to Parent 60, Java 11 Minimum Version
---
 .sling-module.json | 5 +++++
 pom.xml            | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/.sling-module.json b/.sling-module.json
new file mode 100644
index 0000000..cfad4d2
--- /dev/null
+++ b/.sling-module.json
@@ -0,0 +1,5 @@
+{
+  "jenkins": {
+    "jdks": [17, 21]
+  }
+}
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 3213a70..e894405 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,12 +23,12 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling-bundle-parent</artifactId>
-        <version>52</version>
+        <version>60</version>
         <relativePath />
     </parent>
 
     <artifactId>org.apache.sling.testing.jcr-mock</artifactId>
-    <version>1.6.15-SNAPSHOT</version>
+    <version>1.7.0-SNAPSHOT</version>
     <packaging>jar</packaging>
 
     <name>Apache Sling Testing JCR Mock</name>