diff --git a/full/pom.xml b/full/pom.xml
index 6a2d352..faafe81 100644
--- a/full/pom.xml
+++ b/full/pom.xml
@@ -1,4 +1,5 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 	<modelVersion>4.0.0</modelVersion>
 	<groupId>de.ids_mannheim.korap</groupId>
@@ -57,13 +58,13 @@
 										</transformer>
 									</transformers>
 									<filters>
-							          <filter>
-							            <artifact>*:*</artifact>
-							            <excludes>
-							              <exclude>db/lite/**</exclude>
-							            </excludes>
-							          </filter>
-							        </filters>
+										<filter>
+											<artifact>*:*</artifact>
+											<excludes>
+												<exclude>db/lite/**</exclude>
+											</excludes>
+										</filter>
+									</filters>
 								</configuration>
 							</execution>
 						</executions>
@@ -71,65 +72,65 @@
 				</plugins>
 			</build>
 		</profile>
-		
-		
+
+
 		<profile>
 			<id>lite</id>
 			<build>
 				<plugins>
 					<plugin>
 						<artifactId>maven-shade-plugin</artifactId>
-							<version>3.5.1</version>
-							<executions>
-								<!--option 2-->
-								<execution>
-									<id>lite</id>
-									<phase>package</phase>
-									<goals>
-										<goal>shade</goal>
-									</goals>
-									<configuration>
-										<finalName>
-											Kustvakt-lite-${project.version}
-										</finalName>
-										<transformers>
-											<transformer
-												implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
-												<mainClass>
-													de.ids_mannheim.korap.server.KustvaktLiteServer
-												</mainClass>
-											</transformer>
-											<transformer
-												implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
-												<resource>META-INF/spring.handlers
-												</resource>
-											</transformer>
-											<transformer
-												implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
-												<resource>META-INF/spring.schemas
-												</resource>
-											</transformer>
-										</transformers>
-										<filters>
-								          <filter>
-								            <artifact>*:*</artifact>
-								             <excludes>
+						<version>3.5.1</version>
+						<executions>
+							<!--option 2 -->
+							<execution>
+								<id>lite</id>
+								<phase>package</phase>
+								<goals>
+									<goal>shade</goal>
+								</goals>
+								<configuration>
+									<finalName>
+										Kustvakt-lite-${project.version}
+									</finalName>
+									<transformers>
+										<transformer
+											implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+											<mainClass>
+												de.ids_mannheim.korap.server.KustvaktLiteServer
+											</mainClass>
+										</transformer>
+										<transformer
+											implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
+											<resource>META-INF/spring.handlers
+											</resource>
+										</transformer>
+										<transformer
+											implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
+											<resource>META-INF/spring.schemas
+											</resource>
+										</transformer>
+									</transformers>
+									<filters>
+										<filter>
+											<artifact>*:*</artifact>
+											<excludes>
 												<exclude>db/mysql/**</exclude>
 												<exclude>db/predefined/**</exclude>
 												<exclude>db/sqlite/**</exclude>
 												<exclude>db/test/**</exclude>
-					                            <exclude>com.novell.ldap</exclude>
-					                            <exclude>com.unboundid</exclude>
-					                            <exclude>org.glassfish.jersey.test-framework*</exclude>
-					                            <exclude>org.apache.velocity*</exclude>
-					                            <exclude>com.sun.mail</exclude>
-					                            <exclude>javax.activation</exclude>
-					                        </excludes>
-								          </filter>
-								        </filters>
-									</configuration>
-								</execution>
-							</executions>
+												<exclude>com.novell.ldap</exclude>
+												<exclude>com.unboundid</exclude>
+												<exclude>org.glassfish.jersey.test-framework*</exclude>
+												<exclude>org.apache.velocity*</exclude>
+												<exclude>com.sun.mail</exclude>
+												<exclude>javax.activation</exclude>
+											</excludes>
+										</filter>
+									</filters>
+								</configuration>
+							</execution>
+						</executions>
 					</plugin>
 				</plugins>
 			</build>
@@ -137,16 +138,14 @@
 
 	</profiles>
 	<build>
-		<resources> 
-			<resource> 
-				<directory>src/main/resources</directory> 
-				<filtering>true</filtering> 
-		<!-- 	
-			<includes> <include>**/*.info</include> <include>**/*.xml</include> <include>**/*.conf</include> 
-			<include>**/*.kustvakt</include> <include>**/*.properties</include> <include>**/*.sql</include> 
-			<include>**/*.vm</include> </includes> 
-		 -->	
-			</resource> 
+		<resources>
+			<resource>
+				<directory>src/main/resources</directory>
+				<filtering>true</filtering>
+				<!-- <includes> <include>**/*.info</include> <include>**/*.xml</include> 
+					<include>**/*.conf</include> <include>**/*.kustvakt</include> <include>**/*.properties</include> 
+					<include>**/*.sql</include> <include>**/*.vm</include> </includes> -->
+			</resource>
 		</resources>
 		<testResources>
 			<testResource>
@@ -240,11 +239,11 @@
 	<dependencies>
 		<!-- backport -->
 		<dependency>
-		    <groupId>backport-util-concurrent</groupId>
-		    <artifactId>backport-util-concurrent</artifactId>
-		    <version>3.1</version>
+			<groupId>backport-util-concurrent</groupId>
+			<artifactId>backport-util-concurrent</artifactId>
+			<version>3.1</version>
 		</dependency>
-	
+
 		<!-- Jersey -->
 		<dependency>
 			<groupId>org.glassfish.jersey.core</groupId>
@@ -285,23 +284,16 @@
 			<groupId>org.glassfish.jersey.media</groupId>
 			<artifactId>jersey-media-json-jackson</artifactId>
 			<version>${jersey.version}</version>
-			<!--<exclusions>
-				<exclusion>
-					<groupId>com.fasterxml.jackson.core</groupId>
-					<artifactId>jackson-annotations</artifactId>
-				</exclusion>
-				<exclusion>
-					<groupId>com.fasterxml.jackson.core</groupId>
-					<artifactId>jackson-databind</artifactId>
-				</exclusion>
-			</exclusions>-->
+			<!--<exclusions> <exclusion> <groupId>com.fasterxml.jackson.core</groupId> 
+				<artifactId>jackson-annotations</artifactId> </exclusion> <exclusion> <groupId>com.fasterxml.jackson.core</groupId> 
+				<artifactId>jackson-databind</artifactId> </exclusion> </exclusions> -->
 		</dependency>
 		<dependency>
 			<groupId>net.minidev</groupId>
 			<artifactId>json-smart</artifactId>
 			<version>2.5.0</version>
 		</dependency>
-		
+
 		<!-- Flyway -->
 		<dependency>
 			<groupId>org.flywaydb</groupId>
@@ -347,7 +339,7 @@
 			<artifactId>slf4j-api</artifactId>
 			<version>2.0.9</version>
 		</dependency>
-		
+
 		<!-- Java Assist -->
 		<dependency>
 			<groupId>org.javassist</groupId>
@@ -407,7 +399,7 @@
 			<exclusions>
 				<exclusion>
 					<groupId>commons-logging</groupId>
-  					<artifactId>commons-logging</artifactId>
+					<artifactId>commons-logging</artifactId>
 				</exclusion>
 			</exclusions>
 		</dependency>
@@ -419,7 +411,7 @@
 			<exclusions>
 				<exclusion>
 					<groupId>commons-logging</groupId>
-  					<artifactId>commons-logging</artifactId>
+					<artifactId>commons-logging</artifactId>
 				</exclusion>
 			</exclusions>
 		</dependency>
@@ -430,11 +422,8 @@
 			<version>0.4</version>
 		</dependency>
 
-		<!--<dependency>
-		    <groupId>javax.annotation</groupId>
-		    <artifactId>javax.annotation-api</artifactId>
-		    <version>1.3.2</version>
-		</dependency>-->
+		<!--<dependency> <groupId>javax.annotation</groupId> <artifactId>javax.annotation-api</artifactId> 
+			<version>1.3.2</version> </dependency> -->
 
 		<dependency>
 			<groupId>de.ids_mannheim.korap</groupId>
@@ -442,8 +431,8 @@
 			<version>${krill.version}</version>
 			<exclusions>
 				<exclusion>
-				    <groupId>com.fasterxml.jackson.jaxrs</groupId>
-      				<artifactId>jackson-jaxrs-json-provider</artifactId>
+					<groupId>com.fasterxml.jackson.jaxrs</groupId>
+					<artifactId>jackson-jaxrs-json-provider</artifactId>
 				</exclusion>
 				<exclusion>
 					<groupId>org.glassfish.jersey.containers</groupId>
@@ -504,16 +493,10 @@
 			<artifactId>spring-tx</artifactId>
 			<version>${spring.version}</version>
 		</dependency>
-		<!-- <dependency>
-			<groupId>org.springframework.security</groupId>
-			<artifactId>spring-security-core</artifactId>
-			<version>${spring.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>org.springframework.security</groupId>
-			<artifactId>spring-security-web</artifactId>
-			<version>${spring.version}</version>
-		</dependency> -->
+		<!-- <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-core</artifactId> 
+			<version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> 
+			<artifactId>spring-security-web</artifactId> <version>${spring.version}</version> 
+			</dependency> -->
 		<!-- EM: done -->
 		<dependency>
 			<groupId>org.springframework</groupId>
@@ -592,7 +575,7 @@
 			<exclusions>
 				<exclusion>
 					<groupId>commons-logging</groupId>
-  					<artifactId>commons-logging</artifactId>
+					<artifactId>commons-logging</artifactId>
 				</exclusion>
 			</exclusions>
 		</dependency>
@@ -629,47 +612,39 @@
 			<artifactId>hibernate-c3p0</artifactId>
 			<version>${hibernate.version}</version>
 		</dependency>
-		
+
 		<dependency>
-		    <groupId>org.hibernate.orm</groupId>
-		    <artifactId>hibernate-community-dialects</artifactId>
-		    <version>${hibernate.version}</version>
-		</dependency>
-		
-		<!-- servlet -->
-		<dependency>
-		    <groupId>jakarta.persistence</groupId>
-		    <artifactId>jakarta.persistence-api</artifactId>
-		    <version>3.1.0</version>
+			<groupId>org.hibernate.orm</groupId>
+			<artifactId>hibernate-community-dialects</artifactId>
+			<version>${hibernate.version}</version>
 		</dependency>
 
 		<!-- servlet -->
 		<dependency>
-		    <groupId>jakarta.servlet</groupId>
-		    <artifactId>jakarta.servlet-api</artifactId>
-		    <version>6.0.0</version>
-		    <scope>provided</scope>
+			<groupId>jakarta.persistence</groupId>
+			<artifactId>jakarta.persistence-api</artifactId>
+			<version>3.1.0</version>
 		</dependency>
 
-	    <dependency>
-	      <groupId>org.apache.commons</groupId>
-	      <artifactId>commons-text</artifactId>
-	      <version>1.11.0</version>
-	    </dependency>
-		<!--<dependency>
-			<groupId>de.ids_mannheim.korap</groupId>
-			<artifactId>Kustvakt-core</artifactId>
-			<version>${project.version}</version>
-		</dependency>
+		<!-- servlet -->
 		<dependency>
-			<groupId>de.ids_mannheim.korap</groupId>
-			<artifactId>Kustvakt-core</artifactId>
-			<version>${project.version}</version>
-			<classifier>tests</classifier>
-      		<type>test-jar</type>
-      		<scope>test</scope>
-		</dependency>-->
-		
+			<groupId>jakarta.servlet</groupId>
+			<artifactId>jakarta.servlet-api</artifactId>
+			<version>6.0.0</version>
+			<scope>provided</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.commons</groupId>
+			<artifactId>commons-text</artifactId>
+			<version>1.11.0</version>
+		</dependency>
+		<!--<dependency> <groupId>de.ids_mannheim.korap</groupId> <artifactId>Kustvakt-core</artifactId> 
+			<version>${project.version}</version> </dependency> <dependency> <groupId>de.ids_mannheim.korap</groupId> 
+			<artifactId>Kustvakt-core</artifactId> <version>${project.version}</version> 
+			<classifier>tests</classifier> <type>test-jar</type> <scope>test</scope> 
+			</dependency> -->
+
 		<!-- LDAP -->
 		<dependency>
 			<groupId>com.novell.ldap</groupId>
@@ -717,16 +692,16 @@
 			<exclusions>
 				<exclusion>
 					<groupId>commons-logging</groupId>
-  					<artifactId>commons-logging</artifactId>
+					<artifactId>commons-logging</artifactId>
 				</exclusion>
 			</exclusions>
 		</dependency>
-		
+
 		<!-- Mail -->
 		<dependency>
-		    <groupId>com.sun.mail</groupId>
-		    <artifactId>jakarta.mail</artifactId>
-		    <version>2.0.1</version>
+			<groupId>com.sun.mail</groupId>
+			<artifactId>jakarta.mail</artifactId>
+			<version>2.0.1</version>
 		</dependency>
 
 		<dependency>
@@ -734,7 +709,7 @@
 			<artifactId>jakarta.activation-api</artifactId>
 			<version>2.1.2</version>
 		</dependency>
-		
+
 		<dependency>
 			<groupId>javax.activation</groupId>
 			<artifactId>activation</artifactId>
@@ -754,13 +729,13 @@
 			<artifactId>lombok</artifactId>
 			<version>1.18.30</version>
 		</dependency>
-		
+
 		<!-- Mockserver -->
 		<dependency>
-		    <groupId>org.mock-server</groupId>
-		    <artifactId>mockserver-netty</artifactId>
-		    <version>5.15.0</version>
-		    <scope>test</scope>
+			<groupId>org.mock-server</groupId>
+			<artifactId>mockserver-netty</artifactId>
+			<version>5.15.0</version>
+			<scope>test</scope>
 		</dependency>
 		<dependency>
 			<groupId>org.junit.jupiter</groupId>
diff --git a/full/src/main/java/de/ids_mannheim/korap/annotation/AnnotationParser.java b/full/src/main/java/de/ids_mannheim/korap/annotation/AnnotationParser.java
index ccb6d1a..3f71e9f 100644
--- a/full/src/main/java/de/ids_mannheim/korap/annotation/AnnotationParser.java
+++ b/full/src/main/java/de/ids_mannheim/korap/annotation/AnnotationParser.java
@@ -23,7 +23,9 @@
 import de.ids_mannheim.korap.core.entity.AnnotationLayer;
 import de.ids_mannheim.korap.dao.AnnotationDao;
 
-/** Parser for extracting annotation descriptions from Kalamar javascripts 
+/**
+ * Parser for extracting annotation descriptions from Kalamar
+ * javascripts
  * 
  * @author margaretha
  *
@@ -47,23 +49,23 @@
     private Set<Annotation> values = new HashSet<>();
 
     public void run () throws IOException {
-        PathMatchingResourcePatternResolver resolver =
-                new PathMatchingResourcePatternResolver(
-                        getClass().getClassLoader());
+        PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(
+                getClass().getClassLoader());
         Resource[] resources = resolver
                 .getResources("classpath:annotation-scripts/foundries/*.js");
 
-        if (resources.length < 1) return;
+        if (resources.length < 1)
+            return;
 
         for (Resource r : resources) {
-//            log.debug(r.getFilename());
+            //            log.debug(r.getFilename());
             readFile(r.getInputStream());
         }
     }
 
     private void readFile (InputStream inputStream) throws IOException {
-        BufferedReader br =
-                new BufferedReader(new InputStreamReader(inputStream), 1024);
+        BufferedReader br = new BufferedReader(
+                new InputStreamReader(inputStream), 1024);
 
         foundry = null;
 
@@ -128,8 +130,8 @@
             Annotation layer = retrieveOrCreateAnnotation(code, annotationType,
                     null, array.get(0));
             try {
-                AnnotationLayer annotationLayer =
-                        annotationDao.retrieveAnnotationLayer(foundry.getCode(),
+                AnnotationLayer annotationLayer = annotationDao
+                        .retrieveAnnotationLayer(foundry.getCode(),
                                 layer.getCode());
                 if (annotationLayer == null) {
                     annotationDao.createAnnotationLayer(foundry, layer);
@@ -161,8 +163,8 @@
                         annotationType, array.get(1), array.get(2));
             }
             if (annotation != null) {
-                AnnotationKey annotationKey =
-                        annotationDao.retrieveAnnotationKey(layer, annotation);
+                AnnotationKey annotationKey = annotationDao
+                        .retrieveAnnotationKey(layer, annotation);
                 if (annotationKey == null) {
                     annotationDao.createAnnotationKey(layer, annotation);
                 }
@@ -203,8 +205,8 @@
             if (layerCode.endsWith("=")) {
                 layerCode = layerCode.substring(0, layerCode.length() - 1);
             }
-            this.layer =
-                    annotationDao.retrieveAnnotationLayer(codes[0], layerCode);
+            this.layer = annotationDao.retrieveAnnotationLayer(codes[0],
+                    layerCode);
             if (layer == null) {
                 log.warn("Layer is null for " + code);
             }
diff --git a/full/src/main/java/de/ids_mannheim/korap/annotation/ArrayVariables.java b/full/src/main/java/de/ids_mannheim/korap/annotation/ArrayVariables.java
index 8740919..09d652c 100644
--- a/full/src/main/java/de/ids_mannheim/korap/annotation/ArrayVariables.java
+++ b/full/src/main/java/de/ids_mannheim/korap/annotation/ArrayVariables.java
@@ -22,8 +22,7 @@
 @Deprecated
 public class ArrayVariables {
 
-    public static HashMap<String, List<Annotation>> annotationMap =
-            new HashMap<>();
+    public static HashMap<String, List<Annotation>> annotationMap = new HashMap<>();
 
     public static void main (String[] args) throws IOException {
         ArrayVariables variables = new ArrayVariables();
@@ -53,7 +52,8 @@
 
     public void extractVariables () throws IOException {
         String dir = "annotation-scripts/variables";
-        if (dir.isEmpty()) return;
+        if (dir.isEmpty())
+            return;
 
         File d = new File(dir);
         if (!d.isDirectory()) {
diff --git a/full/src/main/java/de/ids_mannheim/korap/annotation/FreeResourceParser.java b/full/src/main/java/de/ids_mannheim/korap/annotation/FreeResourceParser.java
index f6a0ee5..bb7beec 100644
--- a/full/src/main/java/de/ids_mannheim/korap/annotation/FreeResourceParser.java
+++ b/full/src/main/java/de/ids_mannheim/korap/annotation/FreeResourceParser.java
@@ -21,7 +21,8 @@
 import de.ids_mannheim.korap.dao.ResourceDao;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 
-/** Parser for extracting data from free-resources.json containing
+/**
+ * Parser for extracting data from free-resources.json containing
  * listing free (non-licensed) corpora.
  * 
  * @author margaretha
@@ -40,12 +41,12 @@
     public static ObjectMapper mapper = new ObjectMapper();
 
     public void run () throws IOException, KustvaktException {
-        InputStream is=null;
+        InputStream is = null;
         File f = new File(FREE_RESOURCE_FILE);
-        if (f.exists()){
+        if (f.exists()) {
             is = new FileInputStream(f);
         }
-        else{
+        else {
             is = FreeResourceParser.class.getClassLoader()
                     .getResourceAsStream(FREE_RESOURCE_FILE);
         }
@@ -53,7 +54,7 @@
         JsonNode node = mapper.readTree(is);
         for (JsonNode resource : node) {
             String resourceId = resource.at("/id").asText();
-//            log.debug(resourceId);
+            //            log.debug(resourceId);
             Set<AnnotationLayer> layers = parseLayers(resource.at("/layers"));
             try {
                 Resource r = resourceDao.retrieveResource(resourceId);
@@ -74,8 +75,8 @@
         Set<AnnotationLayer> layerSet = new HashSet<>(layers.size());
         for (JsonNode layer : layers) {
             String[] codes = layer.asText().split("/");
-            AnnotationLayer annotationLayer =
-                    annotationDao.retrieveAnnotationLayer(codes[0], codes[1]);
+            AnnotationLayer annotationLayer = annotationDao
+                    .retrieveAnnotationLayer(codes[0], codes[1]);
             layerSet.add(annotationLayer);
         }
         return layerSet;
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/APIAuthentication.java b/full/src/main/java/de/ids_mannheim/korap/authentication/APIAuthentication.java
index ef9db77..d78c55d 100644
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/APIAuthentication.java
+++ b/full/src/main/java/de/ids_mannheim/korap/authentication/APIAuthentication.java
@@ -31,7 +31,7 @@
 
     private static Logger jlog = LogManager.getLogger(APIAuthentication.class);
     public static boolean DEBUG = false;
-    
+
     private JWTSigner signedToken;
 
     public APIAuthentication (FullConfiguration config) throws JOSEException {
@@ -65,7 +65,6 @@
         return context;
     }
 
-
     @Override
     public TokenContext createTokenContext (User user, Map<String, Object> attr)
             throws KustvaktException {
@@ -75,7 +74,7 @@
         try {
             c.setExpirationTime(
                     jwt.getJWTClaimsSet().getExpirationTime().getTime());
-            if (DEBUG ) {
+            if (DEBUG) {
                 jlog.debug(jwt.getJWTClaimsSet()
                         .getClaim(Attributes.AUTHENTICATION_TIME));
             }
@@ -94,7 +93,6 @@
         return c;
     }
 
-
     @Override
     public TokenType getTokenType () {
         return TokenType.API;
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/AuthenticationIface.java b/full/src/main/java/de/ids_mannheim/korap/authentication/AuthenticationIface.java
index 04f5a6a..de0137a 100644
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/AuthenticationIface.java
+++ b/full/src/main/java/de/ids_mannheim/korap/authentication/AuthenticationIface.java
@@ -9,17 +9,15 @@
 
 public interface AuthenticationIface {
 
-    public TokenContext getTokenContext(String authToken) throws KustvaktException;
-
-
-    public TokenContext createTokenContext(User user, Map<String, Object> attr)
+    public TokenContext getTokenContext (String authToken)
             throws KustvaktException;
 
+    public TokenContext createTokenContext (User user, Map<String, Object> attr)
+            throws KustvaktException;
 
-//    void removeUserSession (String token) throws KustvaktException;
-//
-//    public TokenContext refresh (TokenContext context) throws KustvaktException;
-
+    //    void removeUserSession (String token) throws KustvaktException;
+    //
+    //    public TokenContext refresh (TokenContext context) throws KustvaktException;
 
     public TokenType getTokenType ();
 
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/AuthenticationManager.java b/full/src/main/java/de/ids_mannheim/korap/authentication/AuthenticationManager.java
index f11aa52..6ee6dc6 100644
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/AuthenticationManager.java
+++ b/full/src/main/java/de/ids_mannheim/korap/authentication/AuthenticationManager.java
@@ -23,9 +23,9 @@
     public AuthenticationManager () {
         super();
     }
-    
+
     public AuthenticationManager (String cache) {
-        super(cache, "key:"+cache);
+        super(cache, "key:" + cache);
         this.providers = new HashMap<>();
     }
 
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/BasicAuthentication.java b/full/src/main/java/de/ids_mannheim/korap/authentication/BasicAuthentication.java
index 52f2885..026b5b3 100644
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/BasicAuthentication.java
+++ b/full/src/main/java/de/ids_mannheim/korap/authentication/BasicAuthentication.java
@@ -61,9 +61,9 @@
             throws KustvaktException {
         String[] values = transferEncoding.decodeBase64(authToken);
         User user = dao.getAccount(values[0]);
-        ZonedDateTime authenticationTime =
-                ZonedDateTime.now(ZoneId.of(Attributes.DEFAULT_TIME_ZONE));
-        
+        ZonedDateTime authenticationTime = ZonedDateTime
+                .now(ZoneId.of(Attributes.DEFAULT_TIME_ZONE));
+
         if (user != null) {
             TokenContext c = new TokenContext();
             c.setUsername(values[0]);
@@ -84,7 +84,6 @@
         return null;
     }
 
-
     // not supported!
     @Override
     public TokenContext createTokenContext (User user, Map<String, Object> attr)
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/DummyAuthenticationManager.java b/full/src/main/java/de/ids_mannheim/korap/authentication/DummyAuthenticationManager.java
index 5934667..83b979c 100644
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/DummyAuthenticationManager.java
+++ b/full/src/main/java/de/ids_mannheim/korap/authentication/DummyAuthenticationManager.java
@@ -20,7 +20,7 @@
     private KustvaktConfiguration config;
 
     public DummyAuthenticationManager () {}
-    
+
     @Override
     public TokenContext getTokenContext (TokenType type, String token,
             String host, String useragent) throws KustvaktException {
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/KustvaktAuthenticationManager.java b/full/src/main/java/de/ids_mannheim/korap/authentication/KustvaktAuthenticationManager.java
index 590fb9f..e5f5a54 100644
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/KustvaktAuthenticationManager.java
+++ b/full/src/main/java/de/ids_mannheim/korap/authentication/KustvaktAuthenticationManager.java
@@ -38,99 +38,103 @@
 import jakarta.ws.rs.core.MultivaluedMap;
 
 /**
- * contains the logic to authentication and registration processes. Uses
- * interface implementations (AuthenticationIface) for different databases and
+ * contains the logic to authentication and registration processes.
+ * Uses
+ * interface implementations (AuthenticationIface) for different
+ * databases and
  * handlers
  * 
  * @author hanl
  */
 public class KustvaktAuthenticationManager extends AuthenticationManager {
 
-	private static Logger jlog = LogManager.getLogger(KustvaktAuthenticationManager.class);
-	public static boolean DEBUG = false;
-	
-	private EncryptionIface crypto;
-	private EntityHandlerIface entHandler;
-	@Autowired
-	private FullConfiguration config;
-	@Autowired
-	private Validator validator;
-	
-	public KustvaktAuthenticationManager(EncryptionIface crypto,
-			FullConfiguration config) {
-	    super("id_tokens");
-		this.config = config;
-		this.crypto = crypto;
-		// todo: load via beancontext
-//		try {
-//			this.validator = new ApacheValidator();
-//		} catch (IOException e) {
-//			e.printStackTrace();
-//		}
-	}
+    private static Logger jlog = LogManager
+            .getLogger(KustvaktAuthenticationManager.class);
+    public static boolean DEBUG = false;
 
-	/**
-	 * get session object if token was a session token
-	 * 
-	 * @param token
-	 * @param host
-	 * @param useragent
-	 * @return
-	 * @throws KustvaktException
-	 */
-	@Override
-	public TokenContext getTokenContext(TokenType type, String token, 
-	        String host, String userAgent) throws KustvaktException {
+    private EncryptionIface crypto;
+    private EntityHandlerIface entHandler;
+    @Autowired
+    private FullConfiguration config;
+    @Autowired
+    private Validator validator;
 
-		AuthenticationIface provider = getProvider(type , null);
+    public KustvaktAuthenticationManager (EncryptionIface crypto,
+                                          FullConfiguration config) {
+        super("id_tokens");
+        this.config = config;
+        this.crypto = crypto;
+        // todo: load via beancontext
+        //		try {
+        //			this.validator = new ApacheValidator();
+        //		} catch (IOException e) {
+        //			e.printStackTrace();
+        //		}
+    }
 
-		if (provider == null){
-			throw new KustvaktException(StatusCodes.ILLEGAL_ARGUMENT, 
-			        "Authentication provider for token type "+type
-			        +" is not found.", type.displayName());
-		}
-		
-		TokenContext context = provider.getTokenContext(token);
-		context.setHostAddress(host);
-		context.setUserAgent(userAgent);
-		// if (!matchStatus(host, useragent, context))
-		// provider.removeUserSession(token);
-		return context;
-	}
+    /**
+     * get session object if token was a session token
+     * 
+     * @param token
+     * @param host
+     * @param useragent
+     * @return
+     * @throws KustvaktException
+     */
+    @Override
+    public TokenContext getTokenContext (TokenType type, String token,
+            String host, String userAgent) throws KustvaktException {
 
-	@Override
-	public User getUser(String username) throws KustvaktException {
-		// User user;
-		// Object value = this.getCacheValue(username);
+        AuthenticationIface provider = getProvider(type, null);
 
-		if (User.UserFactory.isDemo(username))
-			return User.UserFactory.getDemoUser();
+        if (provider == null) {
+            throw new KustvaktException(StatusCodes.ILLEGAL_ARGUMENT,
+                    "Authentication provider for token type " + type
+                            + " is not found.",
+                    type.displayName());
+        }
 
-		// if (value != null) {
-		// Map map = (Map) value;
-		// user = User.UserFactory.toUser(map);
-		// }
-		// else {
-		// user = entHandler.getAccount(username);
-		// this.storeInCache(username, user.toCache());
-		// todo: not valid. for the duration of the session, the host should not
-		// change!
-		// }
-		// todo:
-		// user.addField(Attributes.HOST, context.getHostAddress());
-		// user.addField(Attributes.USER_AGENT, context.getUserAgent());
-		
-		//EM:copied from EntityDao
-		KorAPUser user = new KorAPUser(); // oder eigentlich new DemoUser oder new DefaultUser.
+        TokenContext context = provider.getTokenContext(token);
+        context.setHostAddress(host);
+        context.setUserAgent(userAgent);
+        // if (!matchStatus(host, useragent, context))
+        // provider.removeUserSession(token);
+        return context;
+    }
+
+    @Override
+    public User getUser (String username) throws KustvaktException {
+        // User user;
+        // Object value = this.getCacheValue(username);
+
+        if (User.UserFactory.isDemo(username))
+            return User.UserFactory.getDemoUser();
+
+        // if (value != null) {
+        // Map map = (Map) value;
+        // user = User.UserFactory.toUser(map);
+        // }
+        // else {
+        // user = entHandler.getAccount(username);
+        // this.storeInCache(username, user.toCache());
+        // todo: not valid. for the duration of the session, the host should not
+        // change!
+        // }
+        // todo:
+        // user.addField(Attributes.HOST, context.getHostAddress());
+        // user.addField(Attributes.USER_AGENT, context.getUserAgent());
+
+        //EM:copied from EntityDao
+        KorAPUser user = new KorAPUser(); // oder eigentlich new DemoUser oder new DefaultUser.
         user.setUsername(username);
         return user;
-//		return entHandler.getAccount(username);
-	}
-	
-	@Override
+        //		return entHandler.getAccount(username);
+    }
+
+    @Override
     public User getUser (String username, String method)
             throws KustvaktException {
-	    KorAPUser user = new KorAPUser();
+        KorAPUser user = new KorAPUser();
         user.setUsername(username);
         String email = null;
         switch (method.toLowerCase()) {
@@ -145,99 +149,108 @@
         return user;
     }
 
-	public TokenContext refresh(TokenContext context) throws KustvaktException {
-		AuthenticationIface provider = getProvider(context.getTokenType(), null);
-		if (provider == null) {
-			// todo:
-		}
+    public TokenContext refresh (TokenContext context)
+            throws KustvaktException {
+        AuthenticationIface provider = getProvider(context.getTokenType(),
+                null);
+        if (provider == null) {
+            // todo:
+        }
 
-		try {
-//			provider.removeUserSession(context.getToken());
-			User user = getUser(context.getUsername());
-			return provider.createTokenContext(user, context.params());
-		} catch (KustvaktException e) {
-			throw new WrappedException(e, StatusCodes.LOGIN_FAILED);
-		}
-	}
+        try {
+            //			provider.removeUserSession(context.getToken());
+            User user = getUser(context.getUsername());
+            return provider.createTokenContext(user, context.params());
+        }
+        catch (KustvaktException e) {
+            throw new WrappedException(e, StatusCodes.LOGIN_FAILED);
+        }
+    }
 
-	/** EM: fix type is not flexible
-	 * @param type
-	 * @param attributes
-	 *            contains username and password to authenticate the user.
-	 *            Depending of the authentication schema, may contain other
-	 *            values as well
-	 * @return User
-	 * @throws KustvaktException
-	 */
-	@Override
-	public User authenticate(AuthenticationMethod method, String username, String password, Map<String, Object> attributes)
-			throws KustvaktException {
-		User user;
-		switch (method) {
-		case SHIBBOLETH:
-			// todo:
-			user = authenticateShib(attributes);
-			break;
-		case LDAP:
-			// IdM/LDAP: (09.02.17/FB)
-			user = authenticateIdM(username, password, attributes);
-			break;
-		// EM: added a dummy authentication for testing
-		case TEST:
-		    user = getUser(username);
-		    break;
-		default:
-			user = authenticate(username, password, attributes);
-			break;
-		}
-		return user;
-	}
+    /**
+     * EM: fix type is not flexible
+     * 
+     * @param type
+     * @param attributes
+     *            contains username and password to authenticate the
+     *            user.
+     *            Depending of the authentication schema, may contain
+     *            other
+     *            values as well
+     * @return User
+     * @throws KustvaktException
+     */
+    @Override
+    public User authenticate (AuthenticationMethod method, String username,
+            String password, Map<String, Object> attributes)
+            throws KustvaktException {
+        User user;
+        switch (method) {
+            case SHIBBOLETH:
+                // todo:
+                user = authenticateShib(attributes);
+                break;
+            case LDAP:
+                // IdM/LDAP: (09.02.17/FB)
+                user = authenticateIdM(username, password, attributes);
+                break;
+            // EM: added a dummy authentication for testing
+            case TEST:
+                user = getUser(username);
+                break;
+            default:
+                user = authenticate(username, password, attributes);
+                break;
+        }
+        return user;
+    }
 
-	// a. set location depending on X-Forwarded-For.
-	// X-Forwarded-For: clientIP, ProxyID, ProxyID...
-	// the following private address spaces may be used to define intranet
-	// spaces:
-	// 10.0.0.0 - 10.255.255.255 (10/8 prefix)
-	// 172.16.0.0 - 172.31.255.255 (172.16/12 prefix)
-	// 192.168.0.0 - 192.168.255.255 (192.168/16 prefix)
-	// b. set corpusAccess depending on location:
-	// c. DemoUser only gets corpusAccess=FREE.
-	// 16.05.17/FB
+    // a. set location depending on X-Forwarded-For.
+    // X-Forwarded-For: clientIP, ProxyID, ProxyID...
+    // the following private address spaces may be used to define intranet
+    // spaces:
+    // 10.0.0.0 - 10.255.255.255 (10/8 prefix)
+    // 172.16.0.0 - 172.31.255.255 (172.16/12 prefix)
+    // 192.168.0.0 - 192.168.255.255 (192.168/16 prefix)
+    // b. set corpusAccess depending on location:
+    // c. DemoUser only gets corpusAccess=FREE.
+    // 16.05.17/FB
 
-	@Override
-	public void setAccessAndLocation(User user, HttpHeaders headers) {
-		MultivaluedMap<String, String> headerMap = headers.getRequestHeaders();
-		Location location = Location.EXTERN;
-		CorpusAccess corpusAccess = CorpusAccess.FREE;
-		
-	    if( user instanceof DemoUser )
-	    {
-	    	// to be absolutely sure:
-	    	user.setCorpusAccess(User.CorpusAccess.FREE);
+    @Override
+    public void setAccessAndLocation (User user, HttpHeaders headers) {
+        MultivaluedMap<String, String> headerMap = headers.getRequestHeaders();
+        Location location = Location.EXTERN;
+        CorpusAccess corpusAccess = CorpusAccess.FREE;
+
+        if (user instanceof DemoUser) {
+            // to be absolutely sure:
+            user.setCorpusAccess(User.CorpusAccess.FREE);
             if (DEBUG) {
                 jlog.debug("setAccessAndLocation: DemoUser: location="
                         + user.locationtoString() + " access="
                         + user.accesstoString());
             }
-	     	return;
-	    }
-		
-		if (headerMap != null && headerMap.containsKey(HttpHeader.X_FORWARDED_FOR.toString())) {
+            return;
+        }
 
-			String[] vals = headerMap.getFirst(HttpHeader.X_FORWARDED_FOR.toString()).split(",");
-			String clientAddress = vals[0];
+        if (headerMap != null && headerMap
+                .containsKey(HttpHeader.X_FORWARDED_FOR.toString())) {
 
-			try {
-				InetAddress ip = InetAddress.getByName(clientAddress);
-				if (ip.isSiteLocalAddress()){
-					location = Location.INTERN;
-					corpusAccess = CorpusAccess.ALL;
-				}
-				else{
-					corpusAccess = CorpusAccess.PUB;
-				}
-				
-				if (DEBUG){
+            String[] vals = headerMap
+                    .getFirst(HttpHeader.X_FORWARDED_FOR.toString()).split(",");
+            String clientAddress = vals[0];
+
+            try {
+                InetAddress ip = InetAddress.getByName(clientAddress);
+                if (ip.isSiteLocalAddress()) {
+                    location = Location.INTERN;
+                    corpusAccess = CorpusAccess.ALL;
+                }
+                else {
+                    corpusAccess = CorpusAccess.PUB;
+                }
+
+                if (DEBUG) {
                     jlog.debug(String.format(
                             "X-Forwarded-For : '%s' (%d values) -> %s\n",
                             Arrays.toString(vals), vals.length, vals[0]));
@@ -249,278 +262,319 @@
                                             : "FREE"));
                 }
 
-			} catch (UnknownHostException e) {
-				// TODO Auto-generated catch block
-				e.printStackTrace();
-			}
+            }
+            catch (UnknownHostException e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            }
 
-			user.setLocation(location);
-			user.setCorpusAccess(corpusAccess);
-	    	
+            user.setLocation(location);
+            user.setCorpusAccess(corpusAccess);
+
             if (DEBUG) {
                 jlog.debug("setAccessAndLocation: KorAPUser: location="
                         + user.locationtoString() + ", access="
                         + user.accesstoString());
             }
 
-		}
-	} // getAccess
+        }
+    } // getAccess
 
-	@Override
-	public TokenContext createTokenContext(User user, Map<String, Object> attr, TokenType type)
-			throws KustvaktException {
-	    //  use api token
-		AuthenticationIface provider = getProvider(type, TokenType.API);
+    @Override
+    public TokenContext createTokenContext (User user, Map<String, Object> attr,
+            TokenType type) throws KustvaktException {
+        //  use api token
+        AuthenticationIface provider = getProvider(type, TokenType.API);
 
-		// EM: not in the new DB
-//		if (attr.get(Attributes.SCOPES) != null)
-//			this.getUserData(user, UserDetails.class);
+        // EM: not in the new DB
+        //		if (attr.get(Attributes.SCOPES) != null)
+        //			this.getUserData(user, UserDetails.class);
 
-		TokenContext context = provider.createTokenContext(user, attr);
-		if (context == null)
-			throw new KustvaktException(StatusCodes.NOT_SUPPORTED);
-		context.setUserAgent((String) attr.get(Attributes.USER_AGENT));
-		context.setHostAddress(Attributes.HOST);
-		return context;
-	}
+        TokenContext context = provider.createTokenContext(user, attr);
+        if (context == null)
+            throw new KustvaktException(StatusCodes.NOT_SUPPORTED);
+        context.setUserAgent((String) attr.get(Attributes.USER_AGENT));
+        context.setHostAddress(Attributes.HOST);
+        return context;
+    }
 
-	@Deprecated
-	private User authenticateShib(Map<String, Object> attributes) throws KustvaktException {
-		// todo use persistent id, since eppn is not unique
-		String eppn = (String) attributes.get(Attributes.EPPN);
+    @Deprecated
+    private User authenticateShib (Map<String, Object> attributes)
+            throws KustvaktException {
+        // todo use persistent id, since eppn is not unique
+        String eppn = (String) attributes.get(Attributes.EPPN);
 
-		if (eppn == null || eppn.isEmpty())
-			throw new KustvaktException(StatusCodes.INVALID_REQUEST);
+        if (eppn == null || eppn.isEmpty())
+            throw new KustvaktException(StatusCodes.INVALID_REQUEST);
 
-		if (!attributes.containsKey(Attributes.EMAIL) && validator.isValid(eppn, Attributes.EMAIL))
-			attributes.put(Attributes.EMAIL, eppn);
+        if (!attributes.containsKey(Attributes.EMAIL)
+                && validator.isValid(eppn, Attributes.EMAIL))
+            attributes.put(Attributes.EMAIL, eppn);
 
-		User user = null;
-		return user;
-	}
+        User user = null;
+        return user;
+    }
 
-	// todo: what if attributes null?
-	private User authenticate(String username, String password, Map<String, Object> attr) throws KustvaktException {
+    // todo: what if attributes null?
+    private User authenticate (String username, String password,
+            Map<String, Object> attr) throws KustvaktException {
 
-		Map<String, Object> attributes = validator.validateMap(attr);
-		User unknown;
-		// just to make sure that the plain password does not appear anywhere in
-		// the logs!
+        Map<String, Object> attributes = validator.validateMap(attr);
+        User unknown;
+        // just to make sure that the plain password does not appear anywhere in
+        // the logs!
 
-		try {
-			validator.validateEntry(username, Attributes.USERNAME);
-		} catch (KustvaktException e) {
-			throw new WrappedException(e, StatusCodes.LOGIN_FAILED, username);
-		}
+        try {
+            validator.validateEntry(username, Attributes.USERNAME);
+        }
+        catch (KustvaktException e) {
+            throw new WrappedException(e, StatusCodes.LOGIN_FAILED, username);
+        }
 
-		if (username == null || username.isEmpty())
-			throw new WrappedException(new KustvaktException(username, StatusCodes.BAD_CREDENTIALS),
-					StatusCodes.LOGIN_FAILED);
-		else {
-			try {
-				unknown = entHandler.getAccount(username);
-			} catch (EmptyResultException e) {
-				// mask exception to disable user guessing in possible attacks
-				throw new WrappedException(new KustvaktException(username, StatusCodes.BAD_CREDENTIALS),
-						StatusCodes.LOGIN_FAILED, username);
-			} catch (KustvaktException e) {
-				jlog.error("Error: {}", e);
-				throw new WrappedException(e, StatusCodes.LOGIN_FAILED, attributes.toString());
-			}
-		}
+        if (username == null || username.isEmpty())
+            throw new WrappedException(
+                    new KustvaktException(username,
+                            StatusCodes.BAD_CREDENTIALS),
+                    StatusCodes.LOGIN_FAILED);
+        else {
+            try {
+                unknown = entHandler.getAccount(username);
+            }
+            catch (EmptyResultException e) {
+                // mask exception to disable user guessing in possible attacks
+                throw new WrappedException(
+                        new KustvaktException(username,
+                                StatusCodes.BAD_CREDENTIALS),
+                        StatusCodes.LOGIN_FAILED, username);
+            }
+            catch (KustvaktException e) {
+                jlog.error("Error: {}", e);
+                throw new WrappedException(e, StatusCodes.LOGIN_FAILED,
+                        attributes.toString());
+            }
+        }
 
         if (DEBUG) {
             jlog.debug(
                     "Authentication: found username " + unknown.getUsername());
         }
-		if (unknown instanceof KorAPUser) {
-			if (password == null || password.isEmpty())
-				throw new WrappedException(new KustvaktException(unknown.getId(), StatusCodes.BAD_CREDENTIALS),
-						StatusCodes.LOGIN_FAILED, username);
+        if (unknown instanceof KorAPUser) {
+            if (password == null || password.isEmpty())
+                throw new WrappedException(
+                        new KustvaktException(unknown.getId(),
+                                StatusCodes.BAD_CREDENTIALS),
+                        StatusCodes.LOGIN_FAILED, username);
 
-			KorAPUser user = (KorAPUser) unknown;
-			boolean check = crypto.checkHash(password, user.getPassword());
+            KorAPUser user = (KorAPUser) unknown;
+            boolean check = crypto.checkHash(password, user.getPassword());
 
-			if (!check) {
-				// the fail counter only applies for wrong password
-				jlog.warn("Wrong Password!");
-				throw new WrappedException(new KustvaktException(user.getId(), StatusCodes.BAD_CREDENTIALS),
-						StatusCodes.LOGIN_FAILED, username);
-			}
+            if (!check) {
+                // the fail counter only applies for wrong password
+                jlog.warn("Wrong Password!");
+                throw new WrappedException(
+                        new KustvaktException(user.getId(),
+                                StatusCodes.BAD_CREDENTIALS),
+                        StatusCodes.LOGIN_FAILED, username);
+            }
 
-			// bad credentials error has precedence over account locked or
-			// unconfirmed codes
-			// since latter can lead to account guessing of third parties
-			if (user.isAccountLocked()) {
-				URIParam param = (URIParam) user.getField(URIParam.class);
+            // bad credentials error has precedence over account locked or
+            // unconfirmed codes
+            // since latter can lead to account guessing of third parties
+            if (user.isAccountLocked()) {
+                URIParam param = (URIParam) user.getField(URIParam.class);
 
-				if (param.hasValues()) {
+                if (param.hasValues()) {
                     if (DEBUG) {
                         jlog.debug("Account is not yet activated for user '"
                                 + user.getUsername() + "'");
                     }
-					if (TimeUtils.getNow().isAfter(param.getUriExpiration())) {
-						jlog.error("URI token is expired. Deleting account for user "+ user.getUsername());
-						throw new WrappedException(
-								new KustvaktException(unknown.getId(), StatusCodes.EXPIRED,
-										"account confirmation uri has expired!", param.getUriFragment()),
-								StatusCodes.LOGIN_FAILED, username);
-					}
-					throw new WrappedException(
-							new KustvaktException(unknown.getId(), StatusCodes.ACCOUNT_NOT_CONFIRMED),
-							StatusCodes.LOGIN_FAILED, username);
-				}
-				jlog.error("ACCESS DENIED: account not active for '"+unknown.getUsername()+"'");
-				throw new WrappedException(new KustvaktException(unknown.getId(), StatusCodes.ACCOUNT_DEACTIVATED),
-						StatusCodes.LOGIN_FAILED, username);
-			}
+                    if (TimeUtils.getNow().isAfter(param.getUriExpiration())) {
+                        jlog.error(
+                                "URI token is expired. Deleting account for user "
+                                        + user.getUsername());
+                        throw new WrappedException(
+                                new KustvaktException(unknown.getId(),
+                                        StatusCodes.EXPIRED,
+                                        "account confirmation uri has expired!",
+                                        param.getUriFragment()),
+                                StatusCodes.LOGIN_FAILED, username);
+                    }
+                    throw new WrappedException(
+                            new KustvaktException(unknown.getId(),
+                                    StatusCodes.ACCOUNT_NOT_CONFIRMED),
+                            StatusCodes.LOGIN_FAILED, username);
+                }
+                jlog.error("ACCESS DENIED: account not active for '"
+                        + unknown.getUsername() + "'");
+                throw new WrappedException(
+                        new KustvaktException(unknown.getId(),
+                                StatusCodes.ACCOUNT_DEACTIVATED),
+                        StatusCodes.LOGIN_FAILED, username);
+            }
 
-		} else if (unknown instanceof ShibbolethUser) {
-			// todo
-		}
+        }
+        else if (unknown instanceof ShibbolethUser) {
+            // todo
+        }
         if (DEBUG) {
             jlog.debug("Authentication done: " + unknown);
         }
-		return unknown;
-	}
+        return unknown;
+    }
 
-	/**
-	 * authenticate using IdM (Identitätsmanagement) accessed by LDAP.
-	 * 
-	 * @param username
-	 * @param password
-	 * @param attr
-	 * @return
-	 * @throws KustvaktException
-	 * @date 09.02.17/FB
-	 */
-	// todo: what if attributes null?
+    /**
+     * authenticate using IdM (Identitätsmanagement) accessed by LDAP.
+     * 
+     * @param username
+     * @param password
+     * @param attr
+     * @return
+     * @throws KustvaktException
+     * @date 09.02.17/FB
+     */
+    // todo: what if attributes null?
 
-	private User authenticateIdM(String username, String password, Map<String, Object> attr) throws KustvaktException {
+    private User authenticateIdM (String username, String password,
+            Map<String, Object> attr) throws KustvaktException {
 
-		User unknown = null;
-		// just to make sure that the plain password does not appear anywhere in
-		// the logs!
-		if (DEBUG){
-            jlog.debug("Debug: authenticateIdM: entering for '%s'...\n", username);
-		}
-		/**
-		 * wozu Apache Validatoren für User/Passwort für IdM/LDAP? siehe
-		 * validation.properties. Abgeschaltet 21.04.17/FB try {
-		 * validator.validateEntry(username, Attributes.USERNAME); } catch
-		 * (KustvaktException e) { throw new WrappedException(e,
-		 * StatusCodes.LOGIN_FAILED, username); }
-		 */
-		if (username == null || username.isEmpty() || password == null || password.isEmpty())
-			throw new WrappedException(new KustvaktException(username, StatusCodes.BAD_CREDENTIALS),
-					StatusCodes.LOGIN_FAILED);
+        User unknown = null;
+        // just to make sure that the plain password does not appear anywhere in
+        // the logs!
+        if (DEBUG) {
+            jlog.debug("Debug: authenticateIdM: entering for '%s'...\n",
+                    username);
+        }
+        /**
+         * wozu Apache Validatoren für User/Passwort für IdM/LDAP?
+         * siehe
+         * validation.properties. Abgeschaltet 21.04.17/FB try {
+         * validator.validateEntry(username, Attributes.USERNAME); }
+         * catch
+         * (KustvaktException e) { throw new WrappedException(e,
+         * StatusCodes.LOGIN_FAILED, username); }
+         */
+        if (username == null || username.isEmpty() || password == null
+                || password.isEmpty())
+            throw new WrappedException(
+                    new KustvaktException(username,
+                            StatusCodes.BAD_CREDENTIALS),
+                    StatusCodes.LOGIN_FAILED);
 
-		// LDAP Access:
-		try {
-			// todo: unknown = ...
-			int ret = LdapAuth3.login(username, password, config.getLdapConfig());
-			if (DEBUG){
-			    jlog.debug("Debug: autenticationIdM: Ldap.login(%s) returns: %d.\n", username, ret);
-			}
-			if (ret != LdapAuth3.LDAP_AUTH_ROK) {
-				jlog.error("LdapAuth3.login(username='"+username+"') returns '"+ret+"'='"+LdapAuth3.getErrMessage(ret)+"'!");
+        // LDAP Access:
+        try {
+            // todo: unknown = ...
+            int ret = LdapAuth3.login(username, password,
+                    config.getLdapConfig());
+            if (DEBUG) {
+                jlog.debug(
+                        "Debug: autenticationIdM: Ldap.login(%s) returns: %d.\n",
+                        username, ret);
+            }
+            if (ret != LdapAuth3.LDAP_AUTH_ROK) {
+                jlog.error("LdapAuth3.login(username='" + username
+                        + "') returns '" + ret + "'='"
+                        + LdapAuth3.getErrMessage(ret) + "'!");
 
-				// mask exception to disable user guessing in possible attacks
-				/*
-				 * by Hanl throw new WrappedException(new
-				 * KustvaktException(username, StatusCodes.BAD_CREDENTIALS),
-				 * StatusCodes.LOGIN_FAILED, username);
-				 */
-				throw new WrappedException(new KustvaktException(username, StatusCodes.LDAP_BASE_ERRCODE + ret,
-						LdapAuth3.getErrMessage(ret), null), StatusCodes.LOGIN_FAILED, username);
-			}
-		} catch (LDAPException e) {
+                // mask exception to disable user guessing in possible attacks
+                /*
+                 * by Hanl throw new WrappedException(new
+                 * KustvaktException(username, StatusCodes.BAD_CREDENTIALS),
+                 * StatusCodes.LOGIN_FAILED, username);
+                 */
+                throw new WrappedException(
+                        new KustvaktException(username,
+                                StatusCodes.LDAP_BASE_ERRCODE + ret,
+                                LdapAuth3.getErrMessage(ret), null),
+                        StatusCodes.LOGIN_FAILED, username);
+            }
+        }
+        catch (LDAPException e) {
 
-			jlog.error("Error: username='"+username+"' -> '"+e+"'!");
-			// mask exception to disable user guessing in possible attacks
-			/*
-			 * by Hanl: throw new WrappedException(new
-			 * KustvaktException(username, StatusCodes.BAD_CREDENTIALS),
-			 * StatusCodes.LOGIN_FAILED, username);
-			 */
-			throw new WrappedException(
-					new KustvaktException(username, StatusCodes.LDAP_BASE_ERRCODE + LdapAuth3.LDAP_AUTH_RINTERR,
-							LdapAuth3.getErrMessage(LdapAuth3.LDAP_AUTH_RINTERR), null),
-					StatusCodes.LOGIN_FAILED, username);
-		}
+            jlog.error("Error: username='" + username + "' -> '" + e + "'!");
+            // mask exception to disable user guessing in possible attacks
+            /*
+             * by Hanl: throw new WrappedException(new
+             * KustvaktException(username, StatusCodes.BAD_CREDENTIALS),
+             * StatusCodes.LOGIN_FAILED, username);
+             */
+            throw new WrappedException(new KustvaktException(username,
+                    StatusCodes.LDAP_BASE_ERRCODE + LdapAuth3.LDAP_AUTH_RINTERR,
+                    LdapAuth3.getErrMessage(LdapAuth3.LDAP_AUTH_RINTERR), null),
+                    StatusCodes.LOGIN_FAILED, username);
+        }
 
-		// Create a User
-		// TODO: KorAPUser für solche mit einem bestehenden Account
-		// DefaultUser sonst.
-		User user = new KorAPUser();
-		user.setUsername(username);
-		/*
-		 * folgender Code funktioniert hier noch nicht, da die Headers noch
-		 * nicht ausgewertet worden sind - 23.05.17/FB Object o =
-		 * attr.get(Attributes.LOCATION); String loc = (String)o.toString(); int
-		 * location = Integer.parseInt(loc); user.setLocation(location);
-		 * user.setCorpusAccess(Integer.parseInt(attr.get(Attributes.
-		 * CORPUS_ACCESS).toString()));
-		 */
-		unknown = user;
+        // Create a User
+        // TODO: KorAPUser für solche mit einem bestehenden Account
+        // DefaultUser sonst.
+        User user = new KorAPUser();
+        user.setUsername(username);
+        /*
+         * folgender Code funktioniert hier noch nicht, da die Headers noch
+         * nicht ausgewertet worden sind - 23.05.17/FB Object o =
+         * attr.get(Attributes.LOCATION); String loc = (String)o.toString(); int
+         * location = Integer.parseInt(loc); user.setLocation(location);
+         * user.setCorpusAccess(Integer.parseInt(attr.get(Attributes.
+         * CORPUS_ACCESS).toString()));
+         */
+        unknown = user;
 
         if (DEBUG) {
             jlog.trace(
                     "Authentication: found username " + unknown.getUsername());
         }
-		if (unknown instanceof KorAPUser) {
-			/*
-			 * password already checked using LDAP: if (password == null ||
-			 * password.isEmpty()) throw new WrappedException(new
-			 * KustvaktException( unknown.getId(), StatusCodes.BAD_CREDENTIALS),
-			 * StatusCodes.LOGIN_FAILED, username);
-			 * 
-			 * KorAPUser user = (KorAPUser) unknown; boolean check =
-			 * crypto.checkHash(password, user.getPassword());
-			 * 
-			 * if (!check) { // the fail counter only applies for wrong password
-			 * jlog.warn("Wrong Password!"); processLoginFail(unknown); throw
-			 * new WrappedException(new KustvaktException(user.getId(),
-			 * StatusCodes.BAD_CREDENTIALS), StatusCodes.LOGIN_FAILED,
-			 * username); }
-			 */
-			// bad credentials error has precedence over account locked or
-			// unconfirmed codes
-			// since latter can lead to account guessing of third parties
-			/*
-			 * if (user.isAccountLocked()) {
-			 * 
-			 * URIParam param = (URIParam) user.getField(URIParam.class);
-			 * 
-			 * if (param.hasValues()) {
-			 * jlog.debug("Account is not yet activated for user '{}'",
-			 * user.getUsername()); if
-			 * (TimeUtils.getNow().isAfter(param.getUriExpiration())) {
-			 * jlog.error( "URI token is expired. Deleting account for user {}",
-			 * user.getUsername()); deleteAccount(user); throw new
-			 * WrappedException(new KustvaktException( unknown.getId(),
-			 * StatusCodes.EXPIRED, "account confirmation uri has expired!",
-			 * param.getUriFragment()), StatusCodes.LOGIN_FAILED, username); }
-			 * throw new WrappedException(new KustvaktException(
-			 * unknown.getId(), StatusCodes.ACCOUNT_NOT_CONFIRMED),
-			 * StatusCodes.LOGIN_FAILED, username); }
-			 * jlog.error("ACCESS DENIED: account not active for '{}'",
-			 * unknown.getUsername()); throw new WrappedException(new
-			 * KustvaktException( unknown.getId(),
-			 * StatusCodes.ACCOUNT_DEACTIVATED), StatusCodes.LOGIN_FAILED,
-			 * username); }
-			 */
+        if (unknown instanceof KorAPUser) {
+            /*
+             * password already checked using LDAP: if (password == null ||
+             * password.isEmpty()) throw new WrappedException(new
+             * KustvaktException( unknown.getId(), StatusCodes.BAD_CREDENTIALS),
+             * StatusCodes.LOGIN_FAILED, username);
+             * 
+             * KorAPUser user = (KorAPUser) unknown; boolean check =
+             * crypto.checkHash(password, user.getPassword());
+             * 
+             * if (!check) { // the fail counter only applies for wrong password
+             * jlog.warn("Wrong Password!"); processLoginFail(unknown); throw
+             * new WrappedException(new KustvaktException(user.getId(),
+             * StatusCodes.BAD_CREDENTIALS), StatusCodes.LOGIN_FAILED,
+             * username); }
+             */
+            // bad credentials error has precedence over account locked or
+            // unconfirmed codes
+            // since latter can lead to account guessing of third parties
+            /*
+             * if (user.isAccountLocked()) {
+             * 
+             * URIParam param = (URIParam) user.getField(URIParam.class);
+             * 
+             * if (param.hasValues()) {
+             * jlog.debug("Account is not yet activated for user '{}'",
+             * user.getUsername()); if
+             * (TimeUtils.getNow().isAfter(param.getUriExpiration())) {
+             * jlog.error( "URI token is expired. Deleting account for user {}",
+             * user.getUsername()); deleteAccount(user); throw new
+             * WrappedException(new KustvaktException( unknown.getId(),
+             * StatusCodes.EXPIRED, "account confirmation uri has expired!",
+             * param.getUriFragment()), StatusCodes.LOGIN_FAILED, username); }
+             * throw new WrappedException(new KustvaktException(
+             * unknown.getId(), StatusCodes.ACCOUNT_NOT_CONFIRMED),
+             * StatusCodes.LOGIN_FAILED, username); }
+             * jlog.error("ACCESS DENIED: account not active for '{}'",
+             * unknown.getUsername()); throw new WrappedException(new
+             * KustvaktException( unknown.getId(),
+             * StatusCodes.ACCOUNT_DEACTIVATED), StatusCodes.LOGIN_FAILED,
+             * username); }
+             */
 
-		} 
-//		else if (unknown instanceof ShibbolethUser) {
-//			// todo
-//		}
+        }
+        //		else if (unknown instanceof ShibbolethUser) {
+        //			// todo
+        //		}
 
         if (DEBUG) {
             jlog.debug("Authentication done: " + username);
         }
-		return unknown;
+        return unknown;
 
-	} // authenticateIdM
+    } // authenticateIdM
 
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/LDAPConfig.java b/full/src/main/java/de/ids_mannheim/korap/authentication/LDAPConfig.java
index 92ae6d6..79a9462 100644
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/LDAPConfig.java
+++ b/full/src/main/java/de/ids_mannheim/korap/authentication/LDAPConfig.java
@@ -22,43 +22,55 @@
     public final String authFilter;
     public final String userNotBlockedFilter;
 
-    public LDAPConfig(String ldapConfigFilename) throws LdapConfigurationException {
+    public LDAPConfig (String ldapConfigFilename)
+            throws LdapConfigurationException {
         Map<String, String> ldapConfig = null;
         try {
             ldapConfig = loadProp(ldapConfigFilename);
-        } catch (IOException e) {
-            System.out.println("Error: LDAPAuth.login: cannot load Property file!");
+        }
+        catch (IOException e) {
+            System.out.println(
+                    "Error: LDAPAuth.login: cannot load Property file!");
         }
 
-        useSSL = Boolean.parseBoolean(ldapConfig.getOrDefault("useSSL", "false"));
+        useSSL = Boolean
+                .parseBoolean(ldapConfig.getOrDefault("useSSL", "false"));
         host = ldapConfig.getOrDefault("host", "localhost");
-        port = Integer.parseInt(ldapConfig.getOrDefault("port", (useSSL ? "636" : "389")));
+        port = Integer.parseInt(
+                ldapConfig.getOrDefault("port", (useSSL ? "636" : "389")));
         searchBase = getConfigOrThrow(ldapConfig, "searchBase");
         sLoginDN = getConfigOrThrow(ldapConfig, "sLoginDN");
         searchFilter = getConfigOrThrow(ldapConfig, "searchFilter");
         authFilter = ldapConfig.getOrDefault("authFilter", null);
-        userNotBlockedFilter = ldapConfig.getOrDefault("userNotBlockedFilter", null);
+        userNotBlockedFilter = ldapConfig.getOrDefault("userNotBlockedFilter",
+                null);
         sPwd = ldapConfig.getOrDefault("pwd", "");
         trustStorePath = ldapConfig.getOrDefault("trustStore", "");
-        additionalCipherSuites = ldapConfig.getOrDefault("additionalCipherSuites", "");
-        useEmbeddedServer = Boolean.parseBoolean(ldapConfig.getOrDefault("useEmbeddedServer", "false"));
+        additionalCipherSuites = ldapConfig
+                .getOrDefault("additionalCipherSuites", "");
+        useEmbeddedServer = Boolean.parseBoolean(
+                ldapConfig.getOrDefault("useEmbeddedServer", "false"));
         emailAttribute = ldapConfig.getOrDefault("emailAttribute", "mail");
         ldif = ldapConfig.getOrDefault("ldifFile", null);
     }
 
-    static HashMap<String, String> typeCastConvert(Properties prop) {
+    static HashMap<String, String> typeCastConvert (Properties prop) {
         Map<String, String> step2 = (Map<String, String>) (Map) prop;
         return new HashMap<>(step2);
     }
 
-    public static HashMap<String, String> loadProp(String sConfFile) throws IOException {
+    public static HashMap<String, String> loadProp (String sConfFile)
+            throws IOException {
         FileInputStream in;
         Properties prop;
 
         try {
             in = new FileInputStream(sConfFile);
-        } catch (IOException ex) {
-            System.err.printf("Error: LDAP.loadProp: cannot load Property file '%s'!\n", sConfFile);
+        }
+        catch (IOException ex) {
+            System.err.printf(
+                    "Error: LDAP.loadProp: cannot load Property file '%s'!\n",
+                    sConfFile);
             ex.printStackTrace();
             return null;
         }
@@ -68,21 +80,25 @@
         try {
             prop.load(in);
             return typeCastConvert(prop);
-        } catch (IOException ex) {
+        }
+        catch (IOException ex) {
             ex.printStackTrace();
         }
 
         return new HashMap<>();
     }
 
-    private String getConfigOrThrow(Map<String, String> ldapConfig, String attribute) throws LdapConfigurationException {
+    private String getConfigOrThrow (Map<String, String> ldapConfig,
+            String attribute) throws LdapConfigurationException {
         String value = ldapConfig.get(attribute);
-        if (value != null) return value;
-        else throw new LdapConfigurationException(attribute + " is not set");
+        if (value != null)
+            return value;
+        else
+            throw new LdapConfigurationException(attribute + " is not set");
     }
 
     private class LdapConfigurationException extends RuntimeException {
-        public LdapConfigurationException(String s) {
+        public LdapConfigurationException (String s) {
             super(s);
         }
     }
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/LdapAuth3.java b/full/src/main/java/de/ids_mannheim/korap/authentication/LdapAuth3.java
index 15b1b56..845a6d5 100644
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/LdapAuth3.java
+++ b/full/src/main/java/de/ids_mannheim/korap/authentication/LdapAuth3.java
@@ -34,7 +34,6 @@
 
 import de.ids_mannheim.korap.server.EmbeddedLdapServer;
 
-
 /**
  * LDAP Login
  *
@@ -54,7 +53,7 @@
 
     private static Logger jlog = LogManager.getLogger(LdapAuth3.class);
 
-    public static String getErrMessage(int code) {
+    public static String getErrMessage (int code) {
         switch (code) {
             case LDAP_AUTH_ROK:
                 return "LDAP Authentication successful.";
@@ -77,7 +76,8 @@
         }
     }
 
-    public static int login(String login, String password, String ldapConfigFilename) throws LDAPException {
+    public static int login (String login, String password,
+            String ldapConfigFilename) throws LDAPException {
         LDAPConfig ldapConfig = new LDAPConfig(ldapConfigFilename);
 
         login = Filter.encodeValue(login);
@@ -86,16 +86,21 @@
         if (ldapConfig.useEmbeddedServer) {
             try {
                 EmbeddedLdapServer.startIfNotRunning(ldapConfig);
-            } catch (GeneralSecurityException | UnknownHostException | LDAPException e) {
+            }
+            catch (GeneralSecurityException | UnknownHostException
+                    | LDAPException e) {
                 throw new RuntimeException(e);
             }
         }
 
-        LdapAuth3Result ldapAuth3Result = search(login, password, ldapConfig, !ldapConfig.searchFilter.contains("${password}"), true);
+        LdapAuth3Result ldapAuth3Result = search(login, password, ldapConfig,
+                !ldapConfig.searchFilter.contains("${password}"), true);
         SearchResult srchRes = ldapAuth3Result.getSearchResultValue();
 
-        if (ldapAuth3Result.getErrorCode() != 0 || srchRes == null || srchRes.getEntryCount() == 0) {
-            if (DEBUGLOG) System.out.printf("Finding '%s': no entry found!\n", login);
+        if (ldapAuth3Result.getErrorCode() != 0 || srchRes == null
+                || srchRes.getEntryCount() == 0) {
+            if (DEBUGLOG)
+                System.out.printf("Finding '%s': no entry found!\n", login);
             return ldapAuth3Result.getErrorCode();
         }
 
@@ -103,7 +108,9 @@
     }
 
     @NotNull
-    public static LdapAuth3Result search(String login, String password, LDAPConfig ldapConfig, boolean bindWithFoundDN, boolean applyExtraFilters) {
+    public static LdapAuth3Result search (String login, String password,
+            LDAPConfig ldapConfig, boolean bindWithFoundDN,
+            boolean applyExtraFilters) {
         Map<String, String> valuesMap = new HashMap<>();
         valuesMap.put("login", login);
         valuesMap.put("password", password);
@@ -117,7 +124,8 @@
 
         if (DEBUGLOG) {
             //System.out.printf("LDAP Version      = %d.\n", LDAPConnection.LDAP_V3);
-            System.out.printf("LDAP Host & Port  = '%s':%d.\n", ldapConfig.host, ldapConfig.port);
+            System.out.printf("LDAP Host & Port  = '%s':%d.\n", ldapConfig.host,
+                    ldapConfig.port);
             System.out.printf("Login User = '%s'\n", login);
             System.out.println("LDAPS " + ldapConfig.useSSL);
         }
@@ -127,81 +135,117 @@
         if (ldapConfig.useSSL) {
             try {
                 SSLUtil sslUtil;
-                if (ldapConfig.trustStorePath != null && !ldapConfig.trustStorePath.isEmpty()) {
-                    sslUtil = new SSLUtil(new TrustStoreTrustManager(ldapConfig.trustStorePath));
-                } else {
+                if (ldapConfig.trustStorePath != null
+                        && !ldapConfig.trustStorePath.isEmpty()) {
+                    sslUtil = new SSLUtil(new TrustStoreTrustManager(
+                            ldapConfig.trustStorePath));
+                }
+                else {
                     sslUtil = new SSLUtil(new TrustAllTrustManager());
                 }
-                if (ldapConfig.additionalCipherSuites != null && !ldapConfig.additionalCipherSuites.isEmpty()) {
+                if (ldapConfig.additionalCipherSuites != null
+                        && !ldapConfig.additionalCipherSuites.isEmpty()) {
                     addSSLCipherSuites(ldapConfig.additionalCipherSuites);
                 }
-                SSLSocketFactory socketFactory = sslUtil.createSSLSocketFactory();
+                SSLSocketFactory socketFactory = sslUtil
+                        .createSSLSocketFactory();
                 lc = new LDAPConnection(socketFactory);
-            } catch (GeneralSecurityException e) {
-                System.err.printf("Error: login: Connecting to LDAPS Server: failed: '%s'!\n", e);
+            }
+            catch (GeneralSecurityException e) {
+                System.err.printf(
+                        "Error: login: Connecting to LDAPS Server: failed: '%s'!\n",
+                        e);
                 ldapTerminate(null);
                 return new LdapAuth3Result(null, LDAP_AUTH_RCONNECT);
             }
-        } else {
+        }
+        else {
             lc = new LDAPConnection();
         }
         try {
             lc.connect(ldapConfig.host, ldapConfig.port);
-            if (DEBUGLOG && ldapConfig.useSSL) System.out.println("LDAPS Connection = OK\n");
-            if (DEBUGLOG && !ldapConfig.useSSL) System.out.println("LDAP Connection = OK\n");
-        } catch (LDAPException e) {
-            String fullStackTrace = org.apache.commons.lang.exception.ExceptionUtils.getFullStackTrace(e);
-            System.err.printf("Error: login: Connecting to LDAP Server: failed: '%s'!\n", fullStackTrace);
+            if (DEBUGLOG && ldapConfig.useSSL)
+                System.out.println("LDAPS Connection = OK\n");
+            if (DEBUGLOG && !ldapConfig.useSSL)
+                System.out.println("LDAP Connection = OK\n");
+        }
+        catch (LDAPException e) {
+            String fullStackTrace = org.apache.commons.lang.exception.ExceptionUtils
+                    .getFullStackTrace(e);
+            System.err.printf(
+                    "Error: login: Connecting to LDAP Server: failed: '%s'!\n",
+                    fullStackTrace);
             ldapTerminate(lc);
             return new LdapAuth3Result(null, LDAP_AUTH_RCONNECT);
         }
-        if (DEBUGLOG) System.out.printf("Debug: isConnected=%d\n", lc.isConnected() ? 1 : 0);
+        if (DEBUGLOG)
+            System.out.printf("Debug: isConnected=%d\n",
+                    lc.isConnected() ? 1 : 0);
 
         try {
             // bind to server:
-            if (DEBUGLOG) System.out.printf("Binding with '%s' ...\n", ldapConfig.sLoginDN);
+            if (DEBUGLOG)
+                System.out.printf("Binding with '%s' ...\n",
+                        ldapConfig.sLoginDN);
             lc.bind(ldapConfig.sLoginDN, ldapConfig.sPwd);
-            if (DEBUGLOG) System.out.print("Binding: OK.\n");
-        } catch (LDAPException e) {
+            if (DEBUGLOG)
+                System.out.print("Binding: OK.\n");
+        }
+        catch (LDAPException e) {
             System.err.printf("Error: login: Binding failed: '%s'!\n", e);
             ldapTerminate(lc);
             return new LdapAuth3Result(null, LDAP_AUTH_RINTERR);
         }
 
-        if (DEBUGLOG) System.out.printf("Debug: isConnected=%d\n", lc.isConnected() ? 1 : 0);
+        if (DEBUGLOG)
+            System.out.printf("Debug: isConnected=%d\n",
+                    lc.isConnected() ? 1 : 0);
 
-        if (DEBUGLOG) System.out.printf("Finding user '%s'...\n", login);
+        if (DEBUGLOG)
+            System.out.printf("Finding user '%s'...\n", login);
 
         SearchResult srchRes = null;
         try {
-            if (DEBUGLOG) System.out.printf("Searching with searchFilter: '%s'.\n", insensitiveSearchFilter);
+            if (DEBUGLOG)
+                System.out.printf("Searching with searchFilter: '%s'.\n",
+                        insensitiveSearchFilter);
 
-            srchRes = lc.search(ldapConfig.searchBase, SearchScope.SUB, searchFilterInstance);
+            srchRes = lc.search(ldapConfig.searchBase, SearchScope.SUB,
+                    searchFilterInstance);
 
-            if (DEBUGLOG) System.out.printf("Found '%s': %d entries.\n", login, srchRes.getEntryCount());
-        } catch (LDAPSearchException e) {
+            if (DEBUGLOG)
+                System.out.printf("Found '%s': %d entries.\n", login,
+                        srchRes.getEntryCount());
+        }
+        catch (LDAPSearchException e) {
             System.err.printf("Error: Search for User failed: '%s'!\n", e);
         }
 
         if (srchRes == null || srchRes.getEntryCount() == 0) {
-            if (DEBUGLOG) System.out.printf("Finding '%s': no entry found!\n", login);
+            if (DEBUGLOG)
+                System.out.printf("Finding '%s': no entry found!\n", login);
             ldapTerminate(lc);
             return new LdapAuth3Result(null, LDAP_AUTH_RUNKNOWN);
         }
 
         if (bindWithFoundDN) {
             String matchedDN = srchRes.getSearchEntries().get(0).getDN();
-            if (DEBUGLOG) System.out.printf("Requested bind for found user %s' failed.\n", matchedDN);
+            if (DEBUGLOG)
+                System.out.printf("Requested bind for found user %s' failed.\n",
+                        matchedDN);
             try {
                 // bind to server:
-                if (DEBUGLOG) System.out.printf("Binding with '%s' ...\n", matchedDN);
+                if (DEBUGLOG)
+                    System.out.printf("Binding with '%s' ...\n", matchedDN);
                 BindResult bindResult = lc.bind(matchedDN, password);
-                if (DEBUGLOG) System.out.print("Binding: OK.\n");
+                if (DEBUGLOG)
+                    System.out.print("Binding: OK.\n");
                 if (!bindResult.getResultCode().equals(ResultCode.SUCCESS)) {
                     ldapTerminate(lc);
                     return new LdapAuth3Result(null, LDAP_AUTH_RUNKNOWN);
                 }
-            } catch (LDAPException e) {
+            }
+            catch (LDAPException e) {
                 System.err.printf("Error: login: Binding failed: '%s'!\n", e);
                 ldapTerminate(lc);
                 return new LdapAuth3Result(null, LDAP_AUTH_RUNKNOWN);
@@ -209,16 +253,21 @@
         }
 
         if (applyExtraFilters) {
-            if (ldapConfig.authFilter != null && !ldapConfig.authFilter.isEmpty()) {
-                srchRes = applyAdditionalFilter(login, ldapConfig, ldapConfig.authFilter, searchFilterInstance, lc);
+            if (ldapConfig.authFilter != null
+                    && !ldapConfig.authFilter.isEmpty()) {
+                srchRes = applyAdditionalFilter(login, ldapConfig,
+                        ldapConfig.authFilter, searchFilterInstance, lc);
                 if (srchRes == null || srchRes.getEntryCount() == 0) {
                     ldapTerminate(lc);
                     return new LdapAuth3Result(null, LDAP_AUTH_RNOTREG);
                 }
             }
 
-            if (ldapConfig.userNotBlockedFilter != null && !ldapConfig.userNotBlockedFilter.isEmpty()) {
-                srchRes = applyAdditionalFilter(login, ldapConfig, ldapConfig.userNotBlockedFilter, searchFilterInstance, lc);
+            if (ldapConfig.userNotBlockedFilter != null
+                    && !ldapConfig.userNotBlockedFilter.isEmpty()) {
+                srchRes = applyAdditionalFilter(login, ldapConfig,
+                        ldapConfig.userNotBlockedFilter, searchFilterInstance,
+                        lc);
                 if (srchRes == null || srchRes.getEntryCount() == 0) {
                     ldapTerminate(lc);
                     return new LdapAuth3Result(null, LDAP_AUTH_RLOCKED);
@@ -230,26 +279,37 @@
         return new LdapAuth3Result(srchRes, LDAP_AUTH_ROK);
     }
 
-    private static SearchResult applyAdditionalFilter(String login, LDAPConfig ldapConfig, String searchFilterInstance, String extraFilter, LDAPConnection lc) {
+    private static SearchResult applyAdditionalFilter (String login,
+            LDAPConfig ldapConfig, String searchFilterInstance,
+            String extraFilter, LDAPConnection lc) {
         SearchResult srchRes;
         srchRes = null;
         try {
-            String combindedFilterInstance = "(&" + searchFilterInstance + extraFilter + ")";
-            if (DEBUGLOG) System.out.printf("Searching with additional Filter: '%s'.\n", extraFilter);
-            srchRes = lc.search(ldapConfig.searchBase, SearchScope.SUB, combindedFilterInstance);
-            if (DEBUGLOG) System.out.printf("Found '%s': %d entries.\n", login, srchRes.getEntryCount());
-        } catch (LDAPSearchException e) {
+            String combindedFilterInstance = "(&" + searchFilterInstance
+                    + extraFilter + ")";
+            if (DEBUGLOG)
+                System.out.printf("Searching with additional Filter: '%s'.\n",
+                        extraFilter);
+            srchRes = lc.search(ldapConfig.searchBase, SearchScope.SUB,
+                    combindedFilterInstance);
+            if (DEBUGLOG)
+                System.out.printf("Found '%s': %d entries.\n", login,
+                        srchRes.getEntryCount());
+        }
+        catch (LDAPSearchException e) {
             System.err.printf("Error: Search for User failed: '%s'!\n", e);
         }
         return srchRes;
     }
 
-    public static String getEmail(String sUserDN, String ldapConfigFilename) throws LDAPException {
+    public static String getEmail (String sUserDN, String ldapConfigFilename)
+            throws LDAPException {
         String sUserPwd = "*";
         LDAPConfig ldapConfig = new LDAPConfig(ldapConfigFilename);
         final String emailAttribute = ldapConfig.emailAttribute;
 
-        SearchResult searchResult = search(sUserDN, sUserPwd, ldapConfig, false, false).getSearchResultValue();
+        SearchResult searchResult = search(sUserDN, sUserPwd, ldapConfig, false,
+                false).getSearchResultValue();
 
         if (searchResult == null) {
             return null;
@@ -263,41 +323,44 @@
         }
         return null;
     }
-    
-    public static String getUsername(String sUserDN, String ldapConfigFilename) throws LDAPException {
+
+    public static String getUsername (String sUserDN, String ldapConfigFilename)
+            throws LDAPException {
         String sUserPwd = "*";
         LDAPConfig ldapConfig = new LDAPConfig(ldapConfigFilename);
         final String idsC2Attribute = "idsC2Profile";
         final String uidAttribute = "uid";
-        
-        SearchResult searchResult = search(sUserDN, sUserPwd, ldapConfig, false, false)
-                .getSearchResultValue();
+
+        SearchResult searchResult = search(sUserDN, sUserPwd, ldapConfig, false,
+                false).getSearchResultValue();
 
         if (searchResult == null) {
             return null;
         }
-        
+
         String username = null;
         for (SearchResultEntry entry : searchResult.getSearchEntries()) {
             username = entry.getAttributeValue(idsC2Attribute);
             if (username == null) {
                 username = entry.getAttributeValue(uidAttribute);
-                jlog.warn("idsC2Profile not found for uid: "+username);
+                jlog.warn("idsC2Profile not found for uid: " + username);
             }
         }
         return username;
     }
 
-    public static void ldapTerminate(LDAPConnection lc) {
-        if (DEBUGLOG) System.out.println("Terminating...");
+    public static void ldapTerminate (LDAPConnection lc) {
+        if (DEBUGLOG)
+            System.out.println("Terminating...");
 
         if (lc != null) {
             lc.close(null);
         }
-        if (DEBUGLOG) System.out.println("closing connection: done.\n");
+        if (DEBUGLOG)
+            System.out.println("closing connection: done.\n");
     }
 
-    private static void addSSLCipherSuites(String ciphersCsv) {
+    private static void addSSLCipherSuites (String ciphersCsv) {
         // add e.g. TLS_RSA_WITH_AES_256_GCM_SHA384
         Set<String> ciphers = new HashSet<>();
         ciphers.addAll(SSLUtil.getEnabledSSLCipherSuites());
@@ -309,21 +372,20 @@
         final int errorCode;
         final Object value;
 
-
-        public LdapAuth3Result(Object value, int errorCode) {
+        public LdapAuth3Result (Object value, int errorCode) {
             this.errorCode = errorCode;
             this.value = value;
         }
 
-        public int getErrorCode() {
+        public int getErrorCode () {
             return errorCode;
         }
 
-        public Object getValue() {
+        public Object getValue () {
             return value;
         }
 
-        public SearchResult getSearchResultValue() {
+        public SearchResult getSearchResultValue () {
             return (SearchResult) value;
         }
     }
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/LoginCounter.java b/full/src/main/java/de/ids_mannheim/korap/authentication/LoginCounter.java
index aeb2856..1e08647 100644
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/LoginCounter.java
+++ b/full/src/main/java/de/ids_mannheim/korap/authentication/LoginCounter.java
@@ -30,12 +30,10 @@
         this.failedLogins = new HashMap<>();
     }
 
-
     public void resetFailedCounter (String username) {
         failedLogins.remove(username);
     }
 
-
     public void registerFail (String username) {
         long expires = TimeUtils.plusSeconds(config.getLoginAttemptTTL())
                 .getMillis();
@@ -49,11 +47,10 @@
         set[1] = expires;
 
         failedLogins.put(username, set);
-        jlog.warn("user failed to login "+
-                Arrays.asList(failedLogins.get(username)));
+        jlog.warn("user failed to login "
+                + Arrays.asList(failedLogins.get(username)));
     }
 
-
     public boolean validate (String username) {
         Long[] set = failedLogins.get(username);
         if (set != null) {
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/OAuth2Authentication.java b/full/src/main/java/de/ids_mannheim/korap/authentication/OAuth2Authentication.java
index 80a3773..3f569fb 100644
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/OAuth2Authentication.java
+++ b/full/src/main/java/de/ids_mannheim/korap/authentication/OAuth2Authentication.java
@@ -16,7 +16,8 @@
 import de.ids_mannheim.korap.security.context.TokenContext;
 import de.ids_mannheim.korap.user.User;
 
-/** Authentication provider for Bearer tokens
+/**
+ * Authentication provider for Bearer tokens
  * 
  * @author margaretha
  *
@@ -44,7 +45,8 @@
 
         TokenContext c = new TokenContext();
         c.setUsername(accessToken.getUserId());
-        c.setExpirationTime(accessToken.getExpiryDate().toInstant().toEpochMilli());
+        c.setExpirationTime(
+                accessToken.getExpiryDate().toInstant().toEpochMilli());
         c.setToken(authToken);
         c.setTokenType(TokenType.BEARER);
         c.addContextParameter(Attributes.SCOPE, scopes);
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/SessionAuthentication.java b/full/src/main/java/de/ids_mannheim/korap/authentication/SessionAuthentication.java
index f4aa637..7d63c56 100644
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/SessionAuthentication.java
+++ b/full/src/main/java/de/ids_mannheim/korap/authentication/SessionAuthentication.java
@@ -30,13 +30,12 @@
     private static final Logger jlog = LogManager
             .getLogger(SessionAuthentication.class);
     public static boolean DEBUG = false;
-    
+
     public static SessionFactory sessions;
     private ScheduledThreadPoolExecutor scheduled;
     private EncryptionIface crypto;
     private KustvaktConfiguration config;
 
-
     public SessionAuthentication (KustvaktConfiguration config,
                                   EncryptionIface crypto) {
         jlog.info("initialize session authentication handler");
@@ -50,9 +49,8 @@
                 this.config.getInactiveTime(), TimeUnit.SECONDS);
     }
 
-
     @Override
-    public TokenContext getTokenContext(String authenticationToken)
+    public TokenContext getTokenContext (String authenticationToken)
             throws KustvaktException {
         if (DEBUG) {
             jlog.debug(
@@ -61,9 +59,8 @@
         return this.sessions.getSession(authenticationToken);
     }
 
-
     @Override
-    public TokenContext createTokenContext(User user, Map<String, Object> attr)
+    public TokenContext createTokenContext (User user, Map<String, Object> attr)
             throws KustvaktException {
         DateTime now = TimeUtils.getNow();
         DateTime ex = TimeUtils.getExpiration(now.getMillis(),
@@ -74,23 +71,22 @@
         ctx.setUsername(user.getUsername());
         ctx.setTokenType(TokenType.SESSION);
         ctx.setToken(token);
-        ctx.setExpirationTime(ex.getMillis()+(1000));
+        ctx.setExpirationTime(ex.getMillis() + (1000));
         ctx.setHostAddress(attr.get(Attributes.HOST).toString());
         ctx.setUserAgent(attr.get(Attributes.USER_AGENT).toString());
         this.sessions.putSession(token, ctx);
         if (DEBUG) {
             jlog.debug(ctx.toJson());
-            jlog.debug("session " +sessions.getSession(token).toString());
+            jlog.debug("session " + sessions.getSession(token).toString());
             jlog.info("create session for user: " + user.getUsername());
         }
         return ctx;
     }
 
-
-//    @Override
-//    public void removeUserSession (String token) {
-//        this.sessions.removeSession(token);
-//    }
+    //    @Override
+    //    public void removeUserSession (String token) {
+    //        this.sessions.removeSession(token);
+    //    }
 
     @Override
     public TokenType getTokenType () {
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/SessionFactory.java b/full/src/main/java/de/ids_mannheim/korap/authentication/SessionFactory.java
index 62c7442..55b3e42 100644
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/SessionFactory.java
+++ b/full/src/main/java/de/ids_mannheim/korap/authentication/SessionFactory.java
@@ -42,7 +42,6 @@
     private final boolean multipleEnabled;
     private final int inactive;
 
-
     public SessionFactory (boolean multipleEnabled, int inactive) {
         if (DEBUG) {
             jlog.debug("allow multiple sessions per user: " + multipleEnabled);
@@ -54,7 +53,6 @@
         this.loggedInRecord = new ConcurrentMultiMap<>();
     }
 
-
     public boolean hasSession (TokenContext context) {
         if (context.getUsername().equalsIgnoreCase(DemoUser.DEMOUSER_NAME))
             return false;
@@ -79,10 +77,9 @@
                 throw new KustvaktException(StatusCodes.EXPIRED);
 
         }
-         return context;
+        return context;
     }
 
-
     //todo: ?!
     @CacheEvict(value = "session", key = "#session.token")
     public void putSession (final String token, final TokenContext activeUser)
@@ -98,7 +95,6 @@
         }
     }
 
-
     public void removeAll (final TokenContext activeUser) {
         for (String existing : loggedInRecord.get(activeUser.getUsername())) {
             timeCheck.remove(existing);
@@ -107,7 +103,6 @@
         loggedInRecord.remove(activeUser.getUsername());
     }
 
-
     @CacheEvict(value = "session", key = "#session.token")
     public void removeSession (String token) {
         String username = sessionsObject.get(token).getUsername();
@@ -118,7 +113,6 @@
         sessionsObject.remove(token);
     }
 
-
     /**
      * reset inactive time interval to 0
      * 
@@ -128,7 +122,6 @@
         timeCheck.put(token, TimeUtils.getNow());
     }
 
-
     /**
      * if user possesses a valid non-expired session token
      * 
@@ -137,19 +130,22 @@
      */
     private boolean isUserSessionValid (String token) {
         if (timeCheck.containsKey(token)) {
-            if (TimeUtils.plusSeconds(timeCheck.get(token).getMillis(),
-                    inactive).isAfterNow()) {
-                if (DEBUG){ jlog.debug("user has session");}
+            if (TimeUtils
+                    .plusSeconds(timeCheck.get(token).getMillis(), inactive)
+                    .isAfterNow()) {
+                if (DEBUG) {
+                    jlog.debug("user has session");
+                }
                 return true;
             }
-            else if (DEBUG){
-                jlog.debug("user with token "+token+" has an invalid session");
+            else if (DEBUG) {
+                jlog.debug(
+                        "user with token " + token + " has an invalid session");
             }
         }
         return false;
     }
 
-
     /**
      * clean inactive sessions from session object
      * TODO: persist userdata to database when session times out!
@@ -160,22 +156,21 @@
         for (Entry<String, DateTime> entry : timeCheck.entrySet()) {
             if (!isUserSessionValid(entry.getKey())) {
                 TokenContext user = sessionsObject.get(entry.getKey());
-                jlog.trace("removing user session for user "+
-                        user.getUsername());
+                jlog.trace(
+                        "removing user session for user " + user.getUsername());
                 inactive.add(user.getUsername());
                 removeSession(entry.getKey());
             }
         }
         // fixme: not doing anything!
-        if (inactive.size() > 0){
-            if (DEBUG){
-            jlog.trace("removing inactive user session for users "+
-                    inactive);
+        if (inactive.size() > 0) {
+            if (DEBUG) {
+                jlog.trace(
+                        "removing inactive user session for users " + inactive);
             }
         }
     }
 
-
     /**
      * run cleanup-thread
      */
@@ -183,6 +178,6 @@
     public void run () {
         timeoutMaintenance();
         if (loggedInRecord.size() > 0)
-            jlog.debug("logged users: "+ loggedInRecord.toString());
+            jlog.debug("logged users: " + loggedInRecord.toString());
     }
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/http/AuthorizationData.java b/full/src/main/java/de/ids_mannheim/korap/authentication/http/AuthorizationData.java
index 236f26a..a0ebd57 100644
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/http/AuthorizationData.java
+++ b/full/src/main/java/de/ids_mannheim/korap/authentication/http/AuthorizationData.java
@@ -4,7 +4,9 @@
 import lombok.Getter;
 import lombok.Setter;
 
-/** Describes the values stored in Authorization header of HTTP requests. 
+/**
+ * Describes the values stored in Authorization header of HTTP
+ * requests.
  * 
  * @author margaretha
  *
@@ -19,4 +21,3 @@
     private String password;
 
 }
-
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/http/TransferEncoding.java b/full/src/main/java/de/ids_mannheim/korap/authentication/http/TransferEncoding.java
index 52d1a90..305406c 100644
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/http/TransferEncoding.java
+++ b/full/src/main/java/de/ids_mannheim/korap/authentication/http/TransferEncoding.java
@@ -6,19 +6,24 @@
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.utils.ParameterChecker;
 
-/** TransferEncoding contains encoding and decoding methods for data transfer, 
- *  e.g. transfering credentials using basic Http authentication.  
- *   
+/**
+ * TransferEncoding contains encoding and decoding methods for data
+ * transfer,
+ * e.g. transfering credentials using basic Http authentication.
+ * 
  * @author margaretha
  *
  */
 @Component
 public class TransferEncoding {
 
-    /** Encodes username and password using Base64.
+    /**
+     * Encodes username and password using Base64.
      * 
-     * @param username username
-     * @param password password
+     * @param username
+     *            username
+     * @param password
+     *            password
      * @return
      */
     public static String encodeBase64 (String username, String password) {
@@ -26,11 +31,12 @@
         return new String(Base64.encodeBase64(s.getBytes()));
     }
 
-    /** Decodes the given string using Base64.
+    /**
+     * Decodes the given string using Base64.
      * 
-     * @param encodedStr 
+     * @param encodedStr
      * @return username and password as an array of strings.
-     * @throws KustvaktException 
+     * @throws KustvaktException
      */
     public static String[] decodeBase64 (String encodedStr)
             throws KustvaktException {
diff --git a/full/src/main/java/de/ids_mannheim/korap/config/Attributes.java b/full/src/main/java/de/ids_mannheim/korap/config/Attributes.java
index e2e4ed5..dde3291 100644
--- a/full/src/main/java/de/ids_mannheim/korap/config/Attributes.java
+++ b/full/src/main/java/de/ids_mannheim/korap/config/Attributes.java
@@ -4,17 +4,17 @@
 
     public static final String AUTHENTICATION_TIME = "auth_time";
     public static final String DEFAULT_TIME_ZONE = "Europe/Berlin";
-    
+
     public static final String AUTHORIZATION = "Authorization";
     // moved to de.ids_mannheim.korap.config.AuthenticationScheme
-//    public static final String SESSION_AUTHENTICATION = "session_token";
-//    public static final String API_AUTHENTICATION = "api_token";
-//    public static final String OAUTH2_AUTHORIZATION = "bearer";
-//    public static final String BASIC_AUTHENTICATION = "basic";
+    //    public static final String SESSION_AUTHENTICATION = "session_token";
+    //    public static final String API_AUTHENTICATION = "api_token";
+    //    public static final String OAUTH2_AUTHORIZATION = "bearer";
+    //    public static final String BASIC_AUTHENTICATION = "basic";
 
     public static final String LOCATION = "location"; // location of Client: User.INTERN/EXTERN
     public static final String CORPUS_ACCESS = "corpusAccess"; // User.ALL/PUB/FREE.
-    
+
     public static final String CLIENT_ID = "client_id";
     public static final String CLIENT_SECRET = "client_secret";
     public static final String SCOPE = "scope";
@@ -99,7 +99,7 @@
     public static final String TEXT_SIGLE = "textSigle";
 
     public static final String AVAILABILITY = "availability";
-    
+
     public static final String REF_CORPUS = "refCorpus";
     public static final String QUERY = "query";
     public static final String CACHE = "cache";
@@ -147,7 +147,7 @@
     public static final String DEFAULT_FOUNDRY_RELATION = "relation-foundry";
     public static final String DEFAULT_FOUNDRY_MORPHOLOGY = "morphology-foundry";
     public static final String DEFAULT_FOUNDRY_STRUCTURE = "structure-foundry";
-    
+
     /**
      * db column keys
      */
diff --git a/full/src/main/java/de/ids_mannheim/korap/config/BeansFactory.java b/full/src/main/java/de/ids_mannheim/korap/config/BeansFactory.java
index 46d319e..2616870 100644
--- a/full/src/main/java/de/ids_mannheim/korap/config/BeansFactory.java
+++ b/full/src/main/java/de/ids_mannheim/korap/config/BeansFactory.java
@@ -20,33 +20,29 @@
 
     private static ContextHolder beanHolder;
 
-
     //todo: allow this for external plugin systems that are not kustvakt specific
     @Deprecated
     public static void setCustomBeansHolder (ContextHolder holder) {
         beanHolder = holder;
     }
 
-
     public static synchronized ContextHolder getKustvaktContext () {
         return beanHolder;
     }
 
-
     public static synchronized ContextHolder getKustvaktContext (int i) {
         return beanHolder;
     }
 
-
     public static synchronized TypeBeanFactory getTypeFactory () {
         return new TypeBeanFactory();
     }
 
-
     public static int loadClasspathContext (String ... files) {
         ApplicationContext context;
         if (files.length == 0)
-            throw new IllegalArgumentException("Spring XML config file is not specified.");
+            throw new IllegalArgumentException(
+                    "Spring XML config file is not specified.");
         else
             context = new ClassPathXmlApplicationContext(files);
         ContextHolder h = new ContextHolder(context) {};
@@ -55,7 +51,6 @@
         return 0;
     }
 
-
     public static synchronized int addApplicationContext (
             ApplicationContext context) {
         ContextHolder h = new ContextHolder(context) {};
@@ -64,12 +59,10 @@
         return 0;
     }
 
-
     public static synchronized void setKustvaktContext (ContextHolder holder) {
         BeansFactory.beanHolder = holder;
     }
 
-
     public static synchronized int setApplicationContext (
             ApplicationContext context) {
         ContextHolder h = new ContextHolder(context) {};
@@ -77,7 +70,6 @@
         return 0;
     }
 
-
     public static synchronized int loadFileContext (String filepath) {
         ApplicationContext context = new FileSystemXmlApplicationContext(
                 "file:" + filepath);
@@ -86,19 +78,16 @@
         return 0;
     }
 
-
     public static void closeApplication () {
         BeansFactory.beanHolder = null;
     }
 
-
     //todo: set response handler
     @Deprecated
     public static CoreResponseHandler getResponseHandler () {
         return null;
     }
 
-
     public BeansFactory () {}
 
     public static class TypeBeanFactory {
@@ -116,7 +105,6 @@
                             + "'");
         }
 
-
         @Deprecated
         public <T> T getTypedBean (Collection objs, Class type) {
             for (Object o : objs) {
diff --git a/full/src/main/java/de/ids_mannheim/korap/config/ConfigLoader.java b/full/src/main/java/de/ids_mannheim/korap/config/ConfigLoader.java
index 9fcc3bd..a8ec0a0 100644
--- a/full/src/main/java/de/ids_mannheim/korap/config/ConfigLoader.java
+++ b/full/src/main/java/de/ids_mannheim/korap/config/ConfigLoader.java
@@ -16,10 +16,8 @@
 
     private static final Logger jlog = LogManager.getLogger(ConfigLoader.class);
 
-
     private ConfigLoader () {}
 
-
     public static InputStream loadConfigStream (String name) {
         InputStream stream = null;
         try {
@@ -31,25 +29,27 @@
             }
             else {
                 jlog.info("Loading config '" + name + "' from classpath!");
-                stream = ConfigLoader.class.getClassLoader().getResourceAsStream(
-                        name);
+                stream = ConfigLoader.class.getClassLoader()
+                        .getResourceAsStream(name);
             }
         }
         catch (IOException e) {
             // do nothing
         }
         if (stream == null)
-            throw new RuntimeException("Config file '"+name+"' could not be loaded ...");
+            throw new RuntimeException(
+                    "Config file '" + name + "' could not be loaded ...");
         return stream;
     }
 
-
-    public static Properties loadProperties (String name){
+    public static Properties loadProperties (String name) {
         Properties p = new Properties();
         try {
             p.load(loadConfigStream(name));
-        } catch (IOException e) {
-            throw new RuntimeException("Properties from config file '"+name+"' could not be loaded ...");
+        }
+        catch (IOException e) {
+            throw new RuntimeException("Properties from config file '" + name
+                    + "' could not be loaded ...");
         }
         return p;
     }
diff --git a/full/src/main/java/de/ids_mannheim/korap/config/ContextHolder.java b/full/src/main/java/de/ids_mannheim/korap/config/ContextHolder.java
index 7626ec1..3d26bcc 100644
--- a/full/src/main/java/de/ids_mannheim/korap/config/ContextHolder.java
+++ b/full/src/main/java/de/ids_mannheim/korap/config/ContextHolder.java
@@ -27,7 +27,6 @@
     private ApplicationContext context = null;
     private DefaultHandler handler;
 
-
     public ContextHolder (ApplicationContext context) {
         this.handler = new DefaultHandler();
         this.context = context;
@@ -35,7 +34,6 @@
         new CoreResponseHandler();
     }
 
-
     protected <T> T getBean (Class<T> clazz) {
         if (this.context != null) {
             try {
@@ -48,7 +46,6 @@
         return this.handler.getDefault(clazz);
     }
 
-
     protected <T> T getBean (String name) {
         T bean = null;
         if (this.context != null) {
@@ -64,7 +61,6 @@
         return bean;
     }
 
-
     @Deprecated
     public <T extends KustvaktConfiguration> T getConfiguration () {
         return (T) getBean(KUSTVAKT_CONFIG);
diff --git a/full/src/main/java/de/ids_mannheim/korap/config/DefaultHandler.java b/full/src/main/java/de/ids_mannheim/korap/config/DefaultHandler.java
index 982985f..df7be47 100644
--- a/full/src/main/java/de/ids_mannheim/korap/config/DefaultHandler.java
+++ b/full/src/main/java/de/ids_mannheim/korap/config/DefaultHandler.java
@@ -12,13 +12,11 @@
 
     private Map<String, Object> defaults;
 
-
     public DefaultHandler () {
         this.defaults = new HashMap<>();
         loadClasses();
     }
 
-
     private void loadClasses () {
         Set<Class<?>> cls = KustvaktClassLoader
                 .loadFromAnnotation(Configurable.class);
@@ -34,12 +32,10 @@
         }
     }
 
-
     public Object getDefault (String name) {
         return this.defaults.get(name);
     }
 
-
     public <T> T getDefault (Class<T> tClass) {
         for (Object o : this.defaults.values()) {
             if (o.getClass().equals(tClass))
@@ -48,12 +44,10 @@
         return null;
     }
 
-
     public void remove (String name) {
         this.defaults.remove(name);
     }
 
-
     @Override
     public String toString () {
         return defaults.toString();
diff --git a/full/src/main/java/de/ids_mannheim/korap/config/FullConfiguration.java b/full/src/main/java/de/ids_mannheim/korap/config/FullConfiguration.java
index a1ba12f..0a904d3 100644
--- a/full/src/main/java/de/ids_mannheim/korap/config/FullConfiguration.java
+++ b/full/src/main/java/de/ids_mannheim/korap/config/FullConfiguration.java
@@ -26,7 +26,7 @@
  */
 
 public class FullConfiguration extends KustvaktConfiguration {
-    public static Logger jlog = LogManager.getLogger(FullConfiguration.class);    
+    public static Logger jlog = LogManager.getLogger(FullConfiguration.class);
     // mail configuration
     private boolean isMailEnabled;
     private String testEmail;
@@ -63,19 +63,19 @@
     private int refreshTokenLongExpiry;
     private int refreshTokenExpiry;
     private int authorizationCodeExpiry;
-    
+
     private int maxNumberOfUserQueries;
-    
+
     private URL issuer;
 
     private String namedVCPath;
-    
+
     private boolean createInitialSuperClient;
 
     public FullConfiguration (Properties properties) throws Exception {
         super(properties);
     }
-    
+
     public FullConfiguration () {
         super();
     }
@@ -97,23 +97,24 @@
         setOAuth2Configuration(properties);
 
         setNamedVCPath(properties.getProperty("krill.namedVC", ""));
-        
-//        Cache cache = CacheManager.newInstance().getCache("named_vc");
-//        CacheConfiguration config = cache.getCacheConfiguration();
-//        config.setMaxBytesLocalHeap(properties.getProperty("cache.max.bytes.local.heap", "256m"));
-//        config.setMaxBytesLocalDisk(properties.getProperty("cache.max.bytes.local.disk", "2G"));
-//        jlog.info("max local heap:"+config.getMaxBytesLocalHeapAsString());
-//        jlog.info("max local disk:"+config.getMaxBytesLocalDiskAsString());
-        
+
+        //        Cache cache = CacheManager.newInstance().getCache("named_vc");
+        //        CacheConfiguration config = cache.getCacheConfiguration();
+        //        config.setMaxBytesLocalHeap(properties.getProperty("cache.max.bytes.local.heap", "256m"));
+        //        config.setMaxBytesLocalDisk(properties.getProperty("cache.max.bytes.local.disk", "2G"));
+        //        jlog.info("max local heap:"+config.getMaxBytesLocalHeapAsString());
+        //        jlog.info("max local disk:"+config.getMaxBytesLocalDiskAsString());
+
         setMaxNumberOfUserQueries(Integer.parseInt(
                 properties.getProperty("max.user.persistent.queries", "20")));
     }
 
-    private void setSecurityConfiguration (Properties properties) throws MalformedURLException {
+    private void setSecurityConfiguration (Properties properties)
+            throws MalformedURLException {
         setSecureHashAlgorithm(Enum.valueOf(EncryptionIface.Encryption.class,
                 properties.getProperty("security.secure.hash.algorithm",
                         "BCRYPT")));
-        
+
         String issuerStr = properties.getProperty("security.jwt.issuer",
                 "https://korap.ids-mannheim.de");
 
@@ -129,8 +130,8 @@
                         "oauth2.password.authentication", "TEST")));
         setNativeClientHost(properties.getProperty("oauth2.native.client.host",
                 "korap.ids-mannheim.de"));
-        setCreateInitialSuperClient(Boolean.valueOf(
-                properties.getProperty("oauth2.initial.super.client", "false")));
+        setCreateInitialSuperClient(Boolean.valueOf(properties
+                .getProperty("oauth2.initial.super.client", "false")));
 
         setMaxAuthenticationAttempts(Integer
                 .parseInt(properties.getProperty("oauth2.max.attempts", "1")));
@@ -146,11 +147,11 @@
                 properties.getProperty("oauth2.refresh.token.expiry", "90D"));
         authorizationCodeExpiry = TimeUtils.convertTimeToSeconds(properties
                 .getProperty("oauth2.authorization.code.expiry", "10M"));
-        
-        setAccessTokenLongExpiry(TimeUtils.convertTimeToSeconds(
-                properties.getProperty("oauth2.access.token.long.expiry", "365D")));
-        setRefreshTokenLongExpiry(TimeUtils.convertTimeToSeconds(
-                properties.getProperty("oauth2.refresh.token.long.expiry", "365D")));
+
+        setAccessTokenLongExpiry(TimeUtils.convertTimeToSeconds(properties
+                .getProperty("oauth2.access.token.long.expiry", "365D")));
+        setRefreshTokenLongExpiry(TimeUtils.convertTimeToSeconds(properties
+                .getProperty("oauth2.refresh.token.long.expiry", "365D")));
     }
 
     private void setMailConfiguration (Properties properties) {
@@ -476,7 +477,7 @@
     public boolean createInitialSuperClient () {
         return createInitialSuperClient;
     }
-    
+
     public void setCreateInitialSuperClient (boolean initialSuperClient) {
         this.createInitialSuperClient = initialSuperClient;
     }
@@ -488,5 +489,5 @@
     public void setMaxNumberOfUserQueries (int maxNumberOfUserQueries) {
         this.maxNumberOfUserQueries = maxNumberOfUserQueries;
     }
-    
+
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/config/JWTSigner.java b/full/src/main/java/de/ids_mannheim/korap/config/JWTSigner.java
index 63ec65e..d8f3341 100644
--- a/full/src/main/java/de/ids_mannheim/korap/config/JWTSigner.java
+++ b/full/src/main/java/de/ids_mannheim/korap/config/JWTSigner.java
@@ -40,13 +40,12 @@
 
     private static Logger jlog = LogManager.getLogger(JWTSigner.class);
     public static boolean DEBUG = false;
-    
+
     private URL issuer;
     private JWSSigner signer;
     private JWSVerifier verifier;
     private final int defaultttl;
 
-
     public JWTSigner (final byte[] secret, URL issuer, final int defaulttl)
             throws JOSEException {
         this.issuer = issuer;
@@ -55,18 +54,15 @@
         this.defaultttl = defaulttl;
     }
 
-
     public JWTSigner (final byte[] secret, String issuer)
             throws MalformedURLException, JOSEException {
         this(secret, new URL(issuer), 72 * 60 * 60);
     }
 
-
     public SignedJWT createJWT (User user, Map<String, Object> attr) {
         return signContent(user, attr, defaultttl);
     }
 
-
     public SignedJWT signContent (User user, Map<String, Object> attr,
             int ttl) {
         String scopes;
@@ -91,11 +87,12 @@
         csBuilder.expirationTime(TimeUtils.getNow().plusSeconds(ttl).toDate());
         csBuilder.claim(Attributes.AUTHENTICATION_TIME,
                 attr.get(Attributes.AUTHENTICATION_TIME));
-        
+
         JWTClaimsSet jwtClaimsSet = csBuilder.build();
-        if (DEBUG) jlog.debug(jwtClaimsSet.getClaim(Attributes.AUTHENTICATION_TIME));
-        SignedJWT signedJWT =
-                new SignedJWT(new JWSHeader(JWSAlgorithm.HS256), jwtClaimsSet);
+        if (DEBUG)
+            jlog.debug(jwtClaimsSet.getClaim(Attributes.AUTHENTICATION_TIME));
+        SignedJWT signedJWT = new SignedJWT(new JWSHeader(JWSAlgorithm.HS256),
+                jwtClaimsSet);
         try {
             signedJWT.sign(signer);
         }
@@ -105,7 +102,6 @@
         return signedJWT;
     }
 
-
     /**
      * @param username
      * @param json
@@ -115,14 +111,16 @@
             String json, int ttl) {
         Builder cs = new JWTClaimsSet.Builder();
         cs.subject(username);
-        if (!json.isEmpty()) cs.claim("data", json);
+        if (!json.isEmpty())
+            cs.claim("data", json);
         cs.expirationTime(TimeUtils.getNow().plusSeconds(ttl).toDate());
         cs.issuer(this.issuer.toString());
 
-        if (!userclient.isEmpty()) cs.claim("userip", userclient);
+        if (!userclient.isEmpty())
+            cs.claim("userip", userclient);
 
-        SignedJWT signedJWT =
-                new SignedJWT(new JWSHeader(JWSAlgorithm.HS256), cs.build());
+        SignedJWT signedJWT = new SignedJWT(new JWSHeader(JWSAlgorithm.HS256),
+                cs.build());
         try {
             signedJWT.sign(signer);
         }
@@ -132,24 +130,20 @@
         return signedJWT;
     }
 
-
     public SignedJWT signContent (String username, String userclient,
             String json) {
         return signContent(username, userclient, json, defaultttl);
     }
 
-
     public SignedJWT createSignedToken (String username) {
         return createSignedToken(username, defaultttl);
     }
 
-
     // add client info
     public SignedJWT createSignedToken (String username, int ttl) {
         return signContent(username, "", "", ttl);
     }
 
-
     public SignedJWT verifyToken (String token) throws KustvaktException {
         SignedJWT client;
         try {
@@ -171,7 +165,6 @@
         return client;
     }
 
-
     // does not care about expiration times
     public String retrieveContent (String signedContent)
             throws KustvaktException {
@@ -188,7 +181,6 @@
         }
     }
 
-
     public TokenContext getTokenContext (String idtoken)
             throws ParseException, JOSEException, KustvaktException {
         SignedJWT signedJWT = verifyToken(idtoken);
@@ -202,10 +194,10 @@
         c.setExpirationTime(
                 signedJWT.getJWTClaimsSet().getExpirationTime().getTime());
 
-        Instant instant = Instant.ofEpochMilli((long) signedJWT.getJWTClaimsSet()
-                .getClaim(Attributes.AUTHENTICATION_TIME));
-        ZonedDateTime zonedAuthTime = ZonedDateTime.ofInstant(
-                instant, ZoneId.of(Attributes.DEFAULT_TIME_ZONE));
+        Instant instant = Instant.ofEpochMilli((long) signedJWT
+                .getJWTClaimsSet().getClaim(Attributes.AUTHENTICATION_TIME));
+        ZonedDateTime zonedAuthTime = ZonedDateTime.ofInstant(instant,
+                ZoneId.of(Attributes.DEFAULT_TIME_ZONE));
         c.setAuthenticationTime(zonedAuthTime);
         c.setToken(idtoken);
         c.addParams(signedJWT.getJWTClaimsSet().getClaims());
diff --git a/full/src/main/java/de/ids_mannheim/korap/config/KustvaktCacheable.java b/full/src/main/java/de/ids_mannheim/korap/config/KustvaktCacheable.java
index a66486f..c8971ea 100644
--- a/full/src/main/java/de/ids_mannheim/korap/config/KustvaktCacheable.java
+++ b/full/src/main/java/de/ids_mannheim/korap/config/KustvaktCacheable.java
@@ -23,37 +23,33 @@
     private String prefix;
     private String name;
 
-    public KustvaktCacheable(String cache_name, String prefix) {
+    public KustvaktCacheable (String cache_name, String prefix) {
         init();
-        if(!enabled())
+        if (!enabled())
             createDefaultFileCache(cache_name);
         this.prefix = prefix;
         this.name = cache_name;
     }
-    
+
     public KustvaktCacheable () {
         // TODO Auto-generated constructor stub
     }
 
-    private static Cache getCache(String name) {
+    private static Cache getCache (String name) {
         return CacheManager.getInstance().getCache(name);
     }
 
-
-    private void createDefaultFileCache(String name) {
-        Cache default_cache = new Cache(
-                new CacheConfiguration(name, 20000)
-                        .memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LFU)
-                        .eternal(false)
-                        .timeToLiveSeconds(15000)
-                        .timeToIdleSeconds(5000)
-                        .diskExpiryThreadIntervalSeconds(0)
-                        .persistence(new PersistenceConfiguration().strategy(PersistenceConfiguration.Strategy.LOCALTEMPSWAP)));
+    private void createDefaultFileCache (String name) {
+        Cache default_cache = new Cache(new CacheConfiguration(name, 20000)
+                .memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LFU)
+                .eternal(false).timeToLiveSeconds(15000).timeToIdleSeconds(5000)
+                .diskExpiryThreadIntervalSeconds(0)
+                .persistence(new PersistenceConfiguration().strategy(
+                        PersistenceConfiguration.Strategy.LOCALTEMPSWAP)));
         if (!CacheManager.getInstance().cacheExists(name))
             CacheManager.getInstance().addCache(default_cache);
     }
 
-
     public void init () {
         if (!loaded) {
             if (ServiceInfo.getInfo().getCacheable()) {
@@ -61,62 +57,62 @@
                 InputStream in = ConfigLoader.loadConfigStream(file);
                 CacheManager.newInstance(in);
                 loaded = true;
-            } else {
+            }
+            else {
                 CacheManager.create();
             }
         }
     }
 
-    public boolean hasCacheEntry(Object key) {
+    public boolean hasCacheEntry (Object key) {
         return getCache(this.name).isKeyInCache(createKey(key.toString()));
     }
 
-
-    public boolean enabled() {
+    public boolean enabled () {
         // check that caching is enabled
         return ServiceInfo.getInfo().getCacheable();
     }
 
-    public Object getCacheValue(Object key) {
+    public Object getCacheValue (Object key) {
         Element e = getCache(this.name).get(createKey(key.toString()));
-        if (e!= null)
+        if (e != null)
             return e.getObjectValue();
         return null;
     }
 
-    public long getCacheCreationTime(Object key) {
+    public long getCacheCreationTime (Object key) {
         Element e = getCache(this.name).get(createKey(key.toString()));
-        if (e!= null)
+        if (e != null)
             return e.getCreationTime();
         return -1;
     }
 
-    public void storeInCache(Object key, Object value) {
+    public void storeInCache (Object key, Object value) {
         getCache(this.name).put(new Element(createKey(key.toString()), value));
     }
 
-    public void removeCacheEntry(Object key) {
+    public void removeCacheEntry (Object key) {
         getCache(this.name).remove(createKey(key.toString()));
     }
 
-    public void clearCache() {
+    public void clearCache () {
         Cache c = getCache(this.name);
         if (enabled()) {
             c.removeAll();
-//            c.clearStatistics();
-            
+            //            c.clearStatistics();
+
         }
     }
 
-    private String createKey(String input) {
-        return StringUtils.toSHAHash(this.prefix+ "@" + input);
+    private String createKey (String input) {
+        return StringUtils.toSHAHash(this.prefix + "@" + input);
     }
-    
+
     public Map<Object, Element> getAllCacheElements () {
         Cache cache = getCache(name);
         return cache.getAll(cache.getKeysWithExpiryCheck());
     }
-    
+
     public List getKeysWithExpiryCheck () {
         Cache cache = getCache(name);
         return cache.getKeysWithExpiryCheck();
diff --git a/full/src/main/java/de/ids_mannheim/korap/config/KustvaktClassLoader.java b/full/src/main/java/de/ids_mannheim/korap/config/KustvaktClassLoader.java
index 83100bc..860d373 100644
--- a/full/src/main/java/de/ids_mannheim/korap/config/KustvaktClassLoader.java
+++ b/full/src/main/java/de/ids_mannheim/korap/config/KustvaktClassLoader.java
@@ -16,10 +16,8 @@
     private static final Reflections reflections = new Reflections(
             "de.ids_mannheim.korap");
 
-
     private KustvaktClassLoader () {}
 
-
     /**
      * loads interface implementations in current classpath
      * 
@@ -31,13 +29,11 @@
         return reflections.getSubTypesOf(iface);
     }
 
-
     public static Set<Class<?>> loadFromAnnotation (
             Class<? extends Annotation> annotation) {
         return reflections.getTypesAnnotatedWith(annotation);
     }
 
-
     public static <T> Class<? extends T> getTypeClass (Class type,
             Class<T> iface) {
         Set<Class<? extends T>> c = KustvaktClassLoader.loadSubTypes(iface);
diff --git a/full/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java b/full/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
index 40073b8..b838073 100644
--- a/full/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
+++ b/full/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
@@ -22,11 +22,12 @@
 import lombok.Setter;
 
 /**
- * Describes configuration for Kustvakt by importing properties 
- * from kustvakt.conf file and setting default values if they are 
- * not configured.  
+ * Describes configuration for Kustvakt by importing properties
+ * from kustvakt.conf file and setting default values if they are
+ * not configured.
  * 
- * MH: if configuration class is extended, loadSubTypes method should be
+ * MH: if configuration class is extended, loadSubTypes method should
+ * be
  * overriden
  * 
  * @author hanl
@@ -41,7 +42,7 @@
     public static final String DATA_FOLDER = "data";
 
     private String vcInCaching;
-    
+
     private String indexDir;
     private int port;
     // todo: make exclusive so that the containg languages can really
@@ -94,7 +95,7 @@
     // deprec?!
     private final BACKENDS DEFAULT_ENGINE = BACKENDS.LUCENE;
     private String networkEndpointURL;
-    
+
     // license patterns
     protected Pattern publicLicensePattern;
     protected Pattern freeLicensePattern;
@@ -107,28 +108,28 @@
     // EM: metadata restriction
     // another variable might be needed to define which metadata fields are restricted 
     private boolean isMetadataRestricted = false;
-    
+
     // EM: Maybe needed when we support pipe registration
     @Deprecated
     public static Map<String, String> pipes = new HashMap<>();
-    
+
     public KustvaktConfiguration (Properties properties) throws Exception {
         load(properties);
-//        readPipesFile("pipes");
+        //        readPipesFile("pipes");
         KrillProperties.setProp(properties);
     }
 
     public KustvaktConfiguration () {}
-    
+
     public void loadBasicProperties (Properties properties) {
         port = Integer.valueOf(properties.getProperty("server.port", "8095"));
         baseURL = properties.getProperty("kustvakt.base.url", "/api/*");
-        setSecureRandomAlgorithm(properties
-                .getProperty("security.secure.random.algorithm", ""));
+        setSecureRandomAlgorithm(
+                properties.getProperty("security.secure.random.algorithm", ""));
         setMessageDigestAlgorithm(
                 properties.getProperty("security.md.algorithm", "MD5"));
     }
-    
+
     /**
      * loading of the properties and mapping to parameter variables
      * 
@@ -139,23 +140,26 @@
     protected void load (Properties properties) throws Exception {
         loadBasicProperties(properties);
 
-        apiWelcomeMessage = properties.getProperty("api.welcome.message", "Welcome to KorAP API!");
+        apiWelcomeMessage = properties.getProperty("api.welcome.message",
+                "Welcome to KorAP API!");
         currentVersion = properties.getProperty("current.api.version", "v1.0");
 
-        String supportedVersions =
-                properties.getProperty("supported.api.versions", "");
-        
+        String supportedVersions = properties
+                .getProperty("supported.api.versions", "");
+
         this.supportedVersions = new HashSet<>();
-        if (!supportedVersions.isEmpty()){
-            List<String> versionArray = Arrays.asList(supportedVersions.split(" "));
+        if (!supportedVersions.isEmpty()) {
+            List<String> versionArray = Arrays
+                    .asList(supportedVersions.split(" "));
             this.supportedVersions.addAll(versionArray);
         }
         this.supportedVersions.add(currentVersion);
 
         maxhits = Integer.valueOf(properties.getProperty("maxhits", "50000"));
-        returnhits = Integer.valueOf(properties.getProperty("returnhits", "50000"));
+        returnhits = Integer
+                .valueOf(properties.getProperty("returnhits", "50000"));
         indexDir = properties.getProperty("krill.indexDir", "");
-        
+
         // server options
         serverHost = String
                 .valueOf(properties.getProperty("server.host", "localhost"));
@@ -165,18 +169,19 @@
         for (String querylang : qls)
             queryLanguages.add(querylang.trim().toUpperCase());
 
-        default_const =
-                properties.getProperty("default.foundry.constituent", "corenlp");
-        default_dep =
-                properties.getProperty("default.foundry.dependency", "malt");
+        default_const = properties.getProperty("default.foundry.constituent",
+                "corenlp");
+        default_dep = properties.getProperty("default.foundry.dependency",
+                "malt");
         default_lemma = properties.getProperty("default.foundry.lemma", "tt");
-        default_morphology = properties.getProperty("default.foundry.morphology", "marmot");
-        default_pos =
-                properties.getProperty("default.foundry.partOfSpeech", "tt");
-        default_orthography =
-                properties.getProperty("default.foundry.orthography", "opennlp");
-        defaultStructureFoundry =
-                properties.getProperty("default.foundry.structure", "base");
+        default_morphology = properties
+                .getProperty("default.foundry.morphology", "marmot");
+        default_pos = properties.getProperty("default.foundry.partOfSpeech",
+                "tt");
+        default_orthography = properties
+                .getProperty("default.foundry.orthography", "opennlp");
+        defaultStructureFoundry = properties
+                .getProperty("default.foundry.structure", "base");
 
         // security configuration
         inactiveTime = TimeUtils.convertTimeToSeconds(
@@ -196,8 +201,8 @@
         validationEmaillength = Integer.valueOf(properties
                 .getProperty("security.validation.emailLength", "40"));
 
-        sharedSecret =
-                properties.getProperty("security.sharedSecret", "").getBytes();
+        sharedSecret = properties.getProperty("security.sharedSecret", "")
+                .getBytes();
 
         longTokenTTL = TimeUtils.convertTimeToSeconds(
                 properties.getProperty("security.longTokenTTL", "100D"));
@@ -205,12 +210,11 @@
                 properties.getProperty("security.tokenTTL", "72H"));
         shortTokenTTL = TimeUtils.convertTimeToSeconds(
                 properties.getProperty("security.shortTokenTTL", "3H"));
-        
+
         // network endpoint
-        networkEndpointURL =
-                properties.getProperty("network.endpoint.url", "");
+        networkEndpointURL = properties.getProperty("network.endpoint.url", "");
     }
-    
+
     @Deprecated
     public void readPipesFile (String filename) throws IOException {
         File file = new File(filename);
@@ -219,19 +223,18 @@
                     new InputStreamReader(new FileInputStream(file)));
 
             String line = null;
-            while( (line=br.readLine())!=null ){
+            while ((line = br.readLine()) != null) {
                 String[] parts = line.split("\t");
-                if (parts.length !=2){
+                if (parts.length != 2) {
                     continue;
                 }
-                else{
+                else {
                     pipes.put(parts[0], parts[1]);
                 }
             }
             br.close();
         }
     }
-    
 
     /**
      * set properties
diff --git a/full/src/main/java/de/ids_mannheim/korap/config/NamedVCLoader.java b/full/src/main/java/de/ids_mannheim/korap/config/NamedVCLoader.java
index f16acbf..fda0ee8 100644
--- a/full/src/main/java/de/ids_mannheim/korap/config/NamedVCLoader.java
+++ b/full/src/main/java/de/ids_mannheim/korap/config/NamedVCLoader.java
@@ -33,7 +33,8 @@
  * <p>
  * All predefined VC are set as SYSTEM VC. The filenames are used as
  * VC names. Acceptable file extensions are .jsonld.gz or .jsonld. The
- * VC should be located at the folder indicated by <em>krill.namedVC</em>
+ * VC should be located at the folder indicated by
+ * <em>krill.namedVC</em>
  * specified in kustvakt.conf.
  * </p>
  * 
@@ -41,7 +42,7 @@
  *
  */
 @Component
-public class NamedVCLoader implements Runnable{
+public class NamedVCLoader implements Runnable {
     @Autowired
     private FullConfiguration config;
     @Autowired
@@ -58,12 +59,13 @@
             loadVCToCache();
         }
         catch (IOException | QueryException e) {
-//            e.printStackTrace();
+            //            e.printStackTrace();
             throw new RuntimeException(e.getMessage(), e.getCause());
         }
     }
-    
-    /** Used for testing 
+
+    /**
+     * Used for testing
      * 
      * @param filename
      * @param filePath
@@ -77,18 +79,18 @@
         InputStream is = NamedVCLoader.class.getResourceAsStream(filePath);
         String json = IOUtils.toString(is, "utf-8");
         if (json != null) {
-            cacheVC(filename,json);
-            vcService.storeQuery("system",filename, ResourceType.SYSTEM,
+            cacheVC(filename, json);
+            vcService.storeQuery("system", filename, ResourceType.SYSTEM,
                     QueryType.VIRTUAL_CORPUS, json, null, null, null, true,
                     "system", null, null);
         }
     }
 
-    public void loadVCToCache ()
-            throws IOException, QueryException {
+    public void loadVCToCache () throws IOException, QueryException {
 
         String dir = config.getNamedVCPath();
-        if (dir.isEmpty()) return;
+        if (dir.isEmpty())
+            return;
 
         File d = new File(dir);
         if (!d.isDirectory()) {
@@ -96,7 +98,7 @@
         }
 
         jlog.info(Arrays.toString(d.list()));
-        
+
         for (File file : d.listFiles()) {
             if (!file.exists()) {
                 throw new IOException("File " + file + " is not found.");
@@ -107,14 +109,13 @@
             filename = strArr[0];
             String json = strArr[1];
             if (json != null) {
-                cacheVC(filename,json);
+                cacheVC(filename, json);
                 storeVCinDB(filename, json);
             }
         }
     }
 
-    private String[] readFile (File file, String filename)
-            throws IOException {
+    private String[] readFile (File file, String filename) throws IOException {
         String json = null;
         long start = System.currentTimeMillis();
         if (filename.endsWith(".jsonld")) {
@@ -123,8 +124,8 @@
         }
         else if (filename.endsWith(".jsonld.gz")) {
             filename = filename.substring(0, filename.length() - 10);
-            GZIPInputStream gzipInputStream =
-                    new GZIPInputStream(new FileInputStream(file));
+            GZIPInputStream gzipInputStream = new GZIPInputStream(
+                    new FileInputStream(file));
             ByteArrayOutputStream bos = new ByteArrayOutputStream(512);
             bos.write(gzipInputStream);
             json = bos.toString("utf-8");
@@ -161,7 +162,7 @@
         else {
             jlog.info("Storing {} in cache ", vcId);
         }
-        
+
         long start, end;
         start = System.currentTimeMillis();
         VirtualCorpusCache.store(vcId, searchKrill.getIndex());
@@ -169,8 +170,9 @@
         jlog.info("Duration : {}", (end - start));
         config.setVcInCaching("");
     }
-    
-    /** Stores the VC if it doesn't exist in the database. 
+
+    /**
+     * Stores the VC if it doesn't exist in the database.
      * 
      * @param vcId
      * @param koralQuery
@@ -196,6 +198,6 @@
                 throw new RuntimeException(e);
             }
         }
-        
+
     }
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/config/ParamFields.java b/full/src/main/java/de/ids_mannheim/korap/config/ParamFields.java
index 2d9a255..621bffb 100644
--- a/full/src/main/java/de/ids_mannheim/korap/config/ParamFields.java
+++ b/full/src/main/java/de/ids_mannheim/korap/config/ParamFields.java
@@ -16,17 +16,14 @@
         this.put(param.getClass().getName(), param);
     }
 
-
     public <T extends Param> T get (Class<T> cl) {
         return (T) this.get(cl.getName());
     }
 
-
     public <T extends Param> T remove (Class<T> cl) {
         return (T) this.remove(cl.getName());
     }
 
-
     public void addAll (Collection<Param> params) {
         for (Param p : params)
             super.put(p.getClass().getName(), p);
diff --git a/full/src/main/java/de/ids_mannheim/korap/config/QueryBuilderUtil.java b/full/src/main/java/de/ids_mannheim/korap/config/QueryBuilderUtil.java
index bc21668..fb838b1 100644
--- a/full/src/main/java/de/ids_mannheim/korap/config/QueryBuilderUtil.java
+++ b/full/src/main/java/de/ids_mannheim/korap/config/QueryBuilderUtil.java
@@ -9,7 +9,8 @@
 public class QueryBuilderUtil {
 
     public static MetaQueryBuilder defaultMetaBuilder (Integer pageIndex,
-            Integer pageInteger, Integer pageLength, String ctx, Boolean cutoff) {
+            Integer pageInteger, Integer pageLength, String ctx,
+            Boolean cutoff) {
         MetaQueryBuilder meta = new MetaQueryBuilder();
         meta.addEntry("startIndex", pageIndex)
                 .addEntry("startPage", pageInteger)
diff --git a/full/src/main/java/de/ids_mannheim/korap/config/Scopes.java b/full/src/main/java/de/ids_mannheim/korap/config/Scopes.java
index 161d5f6..295cb4d 100644
--- a/full/src/main/java/de/ids_mannheim/korap/config/Scopes.java
+++ b/full/src/main/java/de/ids_mannheim/korap/config/Scopes.java
@@ -28,7 +28,6 @@
     private static final Enum[] SERVICE_DEFAULTS = { Scope.account,
             Scope.preferences, Scope.search, Scope.queries };
 
-
     public static Scopes getProfileScopes (Userdata values) {
         Scopes r = new Scopes();
         for (String key : profile) {
@@ -39,7 +38,6 @@
         return r;
     }
 
-
     /**
      * expects space separated values
      * 
@@ -54,7 +52,6 @@
         return s.toArray(new Scope[s.size()]);
     }
 
-
     public static Scopes mapScopes (String scopes, Userdata details) {
         Scopes m = new Scopes();
         if (scopes != null && !scopes.isEmpty()) {
@@ -73,19 +70,16 @@
 
     private Map<String, Object> values;
 
-
     private Scopes () {
         this.values = new HashMap<>();
     }
 
-
     public String toEntity () throws KustvaktException {
         if (this.values.isEmpty())
             return "";
         return JsonUtils.toJSON(this.values);
     }
 
-
     public Map<String, Object> toMap () {
         return new HashMap<>(this.values);
     }
diff --git a/full/src/main/java/de/ids_mannheim/korap/config/URIParam.java b/full/src/main/java/de/ids_mannheim/korap/config/URIParam.java
index 9fd7911..9cba8b6 100644
--- a/full/src/main/java/de/ids_mannheim/korap/config/URIParam.java
+++ b/full/src/main/java/de/ids_mannheim/korap/config/URIParam.java
@@ -12,13 +12,11 @@
     private final String uriFragment;
     private final Long uriExpiration;
 
-
     public URIParam (String uri, Long expire) {
         this.uriFragment = uri;
         this.uriExpiration = expire;
     }
 
-
     @Override
     public boolean hasValues () {
         return this.uriFragment != null && !this.uriFragment.isEmpty()
diff --git a/full/src/main/java/de/ids_mannheim/korap/constant/AnnotationType.java b/full/src/main/java/de/ids_mannheim/korap/constant/AnnotationType.java
index ea91e16..2c6c64d 100644
--- a/full/src/main/java/de/ids_mannheim/korap/constant/AnnotationType.java
+++ b/full/src/main/java/de/ids_mannheim/korap/constant/AnnotationType.java
@@ -1,6 +1,7 @@
 package de.ids_mannheim.korap.constant;
 
-/** Defines various annotation types as constants  
+/**
+ * Defines various annotation types as constants
  * 
  * @author margaretha
  *
diff --git a/full/src/main/java/de/ids_mannheim/korap/constant/AuthenticationMethod.java b/full/src/main/java/de/ids_mannheim/korap/constant/AuthenticationMethod.java
index cbdc07f..488c676 100644
--- a/full/src/main/java/de/ids_mannheim/korap/constant/AuthenticationMethod.java
+++ b/full/src/main/java/de/ids_mannheim/korap/constant/AuthenticationMethod.java
@@ -1,12 +1,13 @@
 package de.ids_mannheim.korap.constant;
 
-/** Lists possible actual authentication methods. Multiple 
- *  {@link AuthenticationScheme} may use an identical 
- *  authentication method. 
+/**
+ * Lists possible actual authentication methods. Multiple
+ * {@link AuthenticationScheme} may use an identical
+ * authentication method.
  * 
  * @author margaretha
  * 
- * @see AuthenticationScheme 
+ * @see AuthenticationScheme
  *
  */
 public enum AuthenticationMethod {
@@ -14,5 +15,5 @@
     // not available
     SHIBBOLETH, DATABASE,
     // by pass authentication for testing
-    TEST; 
+    TEST;
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/constant/AuthenticationScheme.java b/full/src/main/java/de/ids_mannheim/korap/constant/AuthenticationScheme.java
index 543b3fd..e3068f7 100644
--- a/full/src/main/java/de/ids_mannheim/korap/constant/AuthenticationScheme.java
+++ b/full/src/main/java/de/ids_mannheim/korap/constant/AuthenticationScheme.java
@@ -2,8 +2,10 @@
 
 import org.apache.commons.lang.WordUtils;
 
-/** Lists possible authentication schemes used in the Authorization header 
- *  of HTTP requests.  
+/**
+ * Lists possible authentication schemes used in the Authorization
+ * header
+ * of HTTP requests.
  * 
  * @author margaretha
  *
diff --git a/full/src/main/java/de/ids_mannheim/korap/constant/GroupMemberStatus.java b/full/src/main/java/de/ids_mannheim/korap/constant/GroupMemberStatus.java
index 11ed922..445e31e 100644
--- a/full/src/main/java/de/ids_mannheim/korap/constant/GroupMemberStatus.java
+++ b/full/src/main/java/de/ids_mannheim/korap/constant/GroupMemberStatus.java
@@ -1,15 +1,16 @@
 package de.ids_mannheim.korap.constant;
 
-/** Defines possible statuses of a user-group member
+/**
+ * Defines possible statuses of a user-group member
  * 
  * @author margaretha
  *
  */
 public enum GroupMemberStatus {
-    ACTIVE, 
+    ACTIVE,
     // membership invitation was sent and has not been accepted 
     // or rejected yet
-    PENDING, 
+    PENDING,
     // either membership invitation was rejected or the member was 
     // deleted by a user-group admin
     DELETED;
diff --git a/full/src/main/java/de/ids_mannheim/korap/constant/OAuth2Scope.java b/full/src/main/java/de/ids_mannheim/korap/constant/OAuth2Scope.java
index ee6a09b..f24956b 100644
--- a/full/src/main/java/de/ids_mannheim/korap/constant/OAuth2Scope.java
+++ b/full/src/main/java/de/ids_mannheim/korap/constant/OAuth2Scope.java
@@ -1,56 +1,37 @@
 package de.ids_mannheim.korap.constant;
 
-/** Defines all possible authorization scopes
+/**
+ * Defines all possible authorization scopes
  * 
  * @author margaretha
  *
  */
 public enum OAuth2Scope {
-    
-    ALL, 
-    @Deprecated
+
+    ALL, @Deprecated
     ADMIN,
-    
+
     AUTHORIZE,
-    
-    LIST_USER_CLIENT,
-    INSTALL_USER_CLIENT,
-    UNINSTALL_USER_CLIENT,
-    
-    CLIENT_INFO,
-    REGISTER_CLIENT,
-    DEREGISTER_CLIENT,
-    RESET_CLIENT_SECRET,
-    
-    SEARCH, 
-    SERIALIZE_QUERY,
-    MATCH_INFO, 
-    
+
+    LIST_USER_CLIENT, INSTALL_USER_CLIENT, UNINSTALL_USER_CLIENT,
+
+    CLIENT_INFO, REGISTER_CLIENT, DEREGISTER_CLIENT, RESET_CLIENT_SECRET,
+
+    SEARCH, SERIALIZE_QUERY, MATCH_INFO,
+
     USER_INFO,
-    
-    USER_GROUP_INFO, 
-    CREATE_USER_GROUP, 
-    DELETE_USER_GROUP, 
-    
-    DELETE_USER_GROUP_MEMBER, 
-    ADD_USER_GROUP_MEMBER, 
-    
-    EDIT_USER_GROUP_MEMBER_ROLE,
-    ADD_USER_GROUP_MEMBER_ROLE,
-    DELETE_USER_GROUP_MEMBER_ROLE, 
-           
-    CREATE_VC, 
-    VC_INFO,
-    EDIT_VC, 
-    DELETE_VC, 
-    
-    SHARE_VC, 
-    DELETE_VC_ACCESS, 
-    VC_ACCESS_INFO, 
-    
-    CREATE_DEFAULT_SETTING, 
-    READ_DEFAULT_SETTING, 
-    DELETE_DEFAULT_SETTING;
+
+    USER_GROUP_INFO, CREATE_USER_GROUP, DELETE_USER_GROUP,
+
+    DELETE_USER_GROUP_MEMBER, ADD_USER_GROUP_MEMBER,
+
+    EDIT_USER_GROUP_MEMBER_ROLE, ADD_USER_GROUP_MEMBER_ROLE, DELETE_USER_GROUP_MEMBER_ROLE,
+
+    CREATE_VC, VC_INFO, EDIT_VC, DELETE_VC,
+
+    SHARE_VC, DELETE_VC_ACCESS, VC_ACCESS_INFO,
+
+    CREATE_DEFAULT_SETTING, READ_DEFAULT_SETTING, DELETE_DEFAULT_SETTING;
 
     @Override
     public String toString () {
diff --git a/full/src/main/java/de/ids_mannheim/korap/constant/PredefinedRole.java b/full/src/main/java/de/ids_mannheim/korap/constant/PredefinedRole.java
index d1e363b..f91e511 100644
--- a/full/src/main/java/de/ids_mannheim/korap/constant/PredefinedRole.java
+++ b/full/src/main/java/de/ids_mannheim/korap/constant/PredefinedRole.java
@@ -1,26 +1,28 @@
 package de.ids_mannheim.korap.constant;
 
-/** Defines some predefined roles used in the system.
+/**
+ * Defines some predefined roles used in the system.
  * 
  * @author margaretha
  *
  */
 public enum PredefinedRole {
-    USER_GROUP_ADMIN(1), USER_GROUP_MEMBER(2), VC_ACCESS_ADMIN(3), VC_ACCESS_MEMBER(4), 
-    QUERY_ACCESS_ADMIN(5), QUERY_ACCESS_MEMBER(6);
-    
+    USER_GROUP_ADMIN(1), USER_GROUP_MEMBER(2), VC_ACCESS_ADMIN(
+            3), VC_ACCESS_MEMBER(
+                    4), QUERY_ACCESS_ADMIN(5), QUERY_ACCESS_MEMBER(6);
+
     private int id;
     private String name;
 
     PredefinedRole (int i) {
         this.id = i;
-        this.name = name().toLowerCase().replace("_", " "); 
+        this.name = name().toLowerCase().replace("_", " ");
     }
-    
+
     public int getId () {
         return id;
     }
-    
+
     @Override
     public String toString () {
         return this.name;
diff --git a/full/src/main/java/de/ids_mannheim/korap/constant/PrivilegeType.java b/full/src/main/java/de/ids_mannheim/korap/constant/PrivilegeType.java
index f9900b3..0466fa2 100644
--- a/full/src/main/java/de/ids_mannheim/korap/constant/PrivilegeType.java
+++ b/full/src/main/java/de/ids_mannheim/korap/constant/PrivilegeType.java
@@ -3,7 +3,8 @@
 import de.ids_mannheim.korap.entity.Privilege;
 import de.ids_mannheim.korap.entity.Role;
 
-/** Defines the privilege or permissions of users or admins 
+/**
+ * Defines the privilege or permissions of users or admins
  * based on their roles.
  * 
  * @author margaretha
diff --git a/full/src/main/java/de/ids_mannheim/korap/constant/QueryAccessStatus.java b/full/src/main/java/de/ids_mannheim/korap/constant/QueryAccessStatus.java
index de78d54..3b4f786 100644
--- a/full/src/main/java/de/ids_mannheim/korap/constant/QueryAccessStatus.java
+++ b/full/src/main/java/de/ids_mannheim/korap/constant/QueryAccessStatus.java
@@ -2,7 +2,8 @@
 
 import de.ids_mannheim.korap.entity.QueryAccess;
 
-/** Defines possible statuses of {@link QueryAccess}
+/**
+ * Defines possible statuses of {@link QueryAccess}
  * 
  * @author margaretha
  * @see QueryAccess
diff --git a/full/src/main/java/de/ids_mannheim/korap/constant/QueryType.java b/full/src/main/java/de/ids_mannheim/korap/constant/QueryType.java
index cd47332..5251bde 100644
--- a/full/src/main/java/de/ids_mannheim/korap/constant/QueryType.java
+++ b/full/src/main/java/de/ids_mannheim/korap/constant/QueryType.java
@@ -4,9 +4,8 @@
 
 public enum QueryType {
 
-    QUERY,
-    VIRTUAL_CORPUS;
-    
+    QUERY, VIRTUAL_CORPUS;
+
     public String displayName () {
         return StringUtils.capitalize(name().toLowerCase().replace("_", " "));
     }
diff --git a/full/src/main/java/de/ids_mannheim/korap/constant/ResourceType.java b/full/src/main/java/de/ids_mannheim/korap/constant/ResourceType.java
index 8c2e2ac..327e0ab 100644
--- a/full/src/main/java/de/ids_mannheim/korap/constant/ResourceType.java
+++ b/full/src/main/java/de/ids_mannheim/korap/constant/ResourceType.java
@@ -2,7 +2,8 @@
 
 import de.ids_mannheim.korap.entity.QueryDO;
 
-/** Defines types of {@link QueryDO} 
+/**
+ * Defines types of {@link QueryDO}
  * 
  * @author margaretha
  *
@@ -16,21 +17,22 @@
     /**
      * available for all
      */
-    SYSTEM, 
+    SYSTEM,
     // 
-    /** available to project group members
+    /**
+     * available to project group members
      * 
      */
-    PROJECT, 
+    PROJECT,
     /**
      * available only for the creator
      */
-    PRIVATE, 
+    PRIVATE,
     /**
-     * available for all, but not listed for all 
+     * available for all, but not listed for all
      */
     PUBLISHED;
-    
+
     public String displayName () {
         return name().toLowerCase();
 
diff --git a/full/src/main/java/de/ids_mannheim/korap/constant/TokenType.java b/full/src/main/java/de/ids_mannheim/korap/constant/TokenType.java
index bd4ad76..d238ac2 100644
--- a/full/src/main/java/de/ids_mannheim/korap/constant/TokenType.java
+++ b/full/src/main/java/de/ids_mannheim/korap/constant/TokenType.java
@@ -4,19 +4,21 @@
 
 import de.ids_mannheim.korap.security.context.TokenContext;
 
-/** Defines the types of authentication tokens. Token types are used to
- * create {@link TokenContext} and determine which authentication provider
- * must be used to create a TokenContext and parse given tokens. 
+/**
+ * Defines the types of authentication tokens. Token types are used to
+ * create {@link TokenContext} and determine which authentication
+ * provider
+ * must be used to create a TokenContext and parse given tokens.
  * 
  * @author margaretha
  *
  */
 public enum TokenType {
-    BASIC, API, SESSION, 
+    BASIC, API, SESSION,
     // OAuth2 access_token
     BEARER,
     // OAuth2 client
-    CLIENT; 
+    CLIENT;
 
     public String displayName () {
         return StringUtils.capitalize(name().toLowerCase());
diff --git a/full/src/main/java/de/ids_mannheim/korap/constant/UserGroupStatus.java b/full/src/main/java/de/ids_mannheim/korap/constant/UserGroupStatus.java
index a1507ed..03eedcb 100644
--- a/full/src/main/java/de/ids_mannheim/korap/constant/UserGroupStatus.java
+++ b/full/src/main/java/de/ids_mannheim/korap/constant/UserGroupStatus.java
@@ -2,13 +2,14 @@
 
 import de.ids_mannheim.korap.entity.UserGroup;
 
-/** Defines possible statuses of {@link UserGroup}s
+/**
+ * Defines possible statuses of {@link UserGroup}s
  * 
  * @author margaretha
  *
  */
 public enum UserGroupStatus {
-    ACTIVE, DELETED, 
+    ACTIVE, DELETED,
     // group members cannot see the group
     HIDDEN;
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/core/entity/AnnotationKey.java b/full/src/main/java/de/ids_mannheim/korap/core/entity/AnnotationKey.java
index d4184a4..fb3012d 100644
--- a/full/src/main/java/de/ids_mannheim/korap/core/entity/AnnotationKey.java
+++ b/full/src/main/java/de/ids_mannheim/korap/core/entity/AnnotationKey.java
@@ -28,8 +28,8 @@
 @Setter
 @Getter
 @Entity
-@Table(name = "annotation_key", uniqueConstraints = @UniqueConstraint(
-        columnNames = { "layer_id", "key_id" }))
+@Table(name = "annotation_key", uniqueConstraints = @UniqueConstraint(columnNames = {
+        "layer_id", "key_id" }))
 public class AnnotationKey {
 
     @Id
@@ -49,13 +49,8 @@
     private Annotation key;
 
     @ManyToMany(fetch = FetchType.EAGER)
-    @JoinTable(name = "annotation_value",
-            joinColumns = @JoinColumn(name = "key_id",
-                    referencedColumnName = "id"),
-            inverseJoinColumns = @JoinColumn(name = "value_id",
-                    referencedColumnName = "id"),
-            uniqueConstraints = @UniqueConstraint(
-                    columnNames = { "key_id", "value_id" }))
+    @JoinTable(name = "annotation_value", joinColumns = @JoinColumn(name = "key_id", referencedColumnName = "id"), inverseJoinColumns = @JoinColumn(name = "value_id", referencedColumnName = "id"), uniqueConstraints = @UniqueConstraint(columnNames = {
+            "key_id", "value_id" }))
     private Set<Annotation> values;
 
     public AnnotationKey () {}
diff --git a/full/src/main/java/de/ids_mannheim/korap/core/entity/AnnotationLayer.java b/full/src/main/java/de/ids_mannheim/korap/core/entity/AnnotationLayer.java
index 06caf6a..9beb694 100644
--- a/full/src/main/java/de/ids_mannheim/korap/core/entity/AnnotationLayer.java
+++ b/full/src/main/java/de/ids_mannheim/korap/core/entity/AnnotationLayer.java
@@ -31,8 +31,8 @@
 @Setter
 @Getter
 @Entity
-@Table(name = "annotation_layer", uniqueConstraints = @UniqueConstraint(
-        columnNames = { "foundry_id", "layer_id" }))
+@Table(name = "annotation_layer", uniqueConstraints = @UniqueConstraint(columnNames = {
+        "foundry_id", "layer_id" }))
 public class AnnotationLayer {
     @Id
     @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -54,8 +54,7 @@
     @JoinColumn(name = "layer_id", insertable = false, updatable = false)
     private Annotation layer;
 
-    @OneToMany(mappedBy = "layer", fetch = FetchType.EAGER,
-            cascade = CascadeType.REMOVE)
+    @OneToMany(mappedBy = "layer", fetch = FetchType.EAGER, cascade = CascadeType.REMOVE)
     private Set<AnnotationKey> keys;
 
     @Override
diff --git a/full/src/main/java/de/ids_mannheim/korap/core/entity/Resource.java b/full/src/main/java/de/ids_mannheim/korap/core/entity/Resource.java
index 99c572b..e002451 100644
--- a/full/src/main/java/de/ids_mannheim/korap/core/entity/Resource.java
+++ b/full/src/main/java/de/ids_mannheim/korap/core/entity/Resource.java
@@ -40,11 +40,7 @@
     private String englishDescription;
 
     @ManyToMany(fetch = FetchType.EAGER)
-    @JoinTable(name = "resource_layer",
-            joinColumns = @JoinColumn(name = "resource_id",
-                    referencedColumnName = "id"),
-            inverseJoinColumns = @JoinColumn(name = "layer_id",
-                    referencedColumnName = "id"))
+    @JoinTable(name = "resource_layer", joinColumns = @JoinColumn(name = "resource_id", referencedColumnName = "id"), inverseJoinColumns = @JoinColumn(name = "layer_id", referencedColumnName = "id"))
     private Set<AnnotationLayer> layers;
 
     public Resource () {}
diff --git a/full/src/main/java/de/ids_mannheim/korap/core/service/AnnotationService.java b/full/src/main/java/de/ids_mannheim/korap/core/service/AnnotationService.java
index 4730a4f..e7680e2 100644
--- a/full/src/main/java/de/ids_mannheim/korap/core/service/AnnotationService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/core/service/AnnotationService.java
@@ -17,7 +17,9 @@
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.exceptions.StatusCodes;
 
-/** AnnotationService defines the logic behind {@link AnnotationController}.
+/**
+ * AnnotationService defines the logic behind
+ * {@link AnnotationController}.
  * 
  * @author margaretha
  *
@@ -27,8 +29,7 @@
 
     private static final boolean DEBUG = false;
 
-    private static Logger jlog =
-            LogManager.getLogger(AnnotationService.class);
+    private static Logger jlog = LogManager.getLogger(AnnotationService.class);
 
     @Autowired
     private AnnotationDao annotationDao;
@@ -38,7 +39,7 @@
 
     public List<LayerDto> getLayerDtos () {
         List<AnnotationLayer> layers = annotationDao.getAllFoundryLayerPairs();
-        if (DEBUG){
+        if (DEBUG) {
             jlog.debug("/layers " + layers.toString());
         }
         List<LayerDto> layerDto = annotationConverter.convertToLayerDto(layers);
@@ -50,14 +51,14 @@
         List<AnnotationLayer> annotationPairs = null;
         String foundry = "", layer = "";
         if (codes.contains("*")) {
-            annotationPairs =
-                    annotationDao.getAnnotationDescriptions(foundry, layer);
+            annotationPairs = annotationDao.getAnnotationDescriptions(foundry,
+                    layer);
         }
         else {
             String[] annotationCode;
             annotationPairs = new ArrayList<AnnotationLayer>();
             for (String code : codes) {
-                if (DEBUG){
+                if (DEBUG) {
                     jlog.debug("code " + code);
                 }
                 annotationCode = code.split("/");
@@ -82,7 +83,7 @@
         if (annotationPairs != null && !annotationPairs.isEmpty()) {
             List<FoundryDto> foundryDtos = annotationConverter
                     .convertToFoundryDto(annotationPairs, language);
-            if (DEBUG){
+            if (DEBUG) {
                 jlog.debug("/description " + annotationPairs.toString());
             }
             return foundryDtos;
diff --git a/full/src/main/java/de/ids_mannheim/korap/core/service/BasicService.java b/full/src/main/java/de/ids_mannheim/korap/core/service/BasicService.java
index c1072dd..e833321 100644
--- a/full/src/main/java/de/ids_mannheim/korap/core/service/BasicService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/core/service/BasicService.java
@@ -6,7 +6,7 @@
 
     protected String combineMultipleCorpusQuery (List<String> cqList) {
         String combinedCorpusQuery = null;
-        if (cqList!=null && cqList.size() > 0) {
+        if (cqList != null && cqList.size() > 0) {
             combinedCorpusQuery = cqList.get(0);
             for (int i = 1; i < cqList.size(); i++) {
                 combinedCorpusQuery += "&" + cqList.get(i);
diff --git a/full/src/main/java/de/ids_mannheim/korap/core/service/SearchService.java b/full/src/main/java/de/ids_mannheim/korap/core/service/SearchService.java
index c940cab..03f186d 100644
--- a/full/src/main/java/de/ids_mannheim/korap/core/service/SearchService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/core/service/SearchService.java
@@ -42,12 +42,12 @@
 import jakarta.ws.rs.core.UriBuilder;
 
 @Service
-public class SearchService extends BasicService{
-    
-    public class TotalResultCache extends KustvaktCacheable{
-        
+public class SearchService extends BasicService {
+
+    public class TotalResultCache extends KustvaktCacheable {
+
         public TotalResultCache () {
-            super("total_results","key:hashedKoralQuery");
+            super("total_results", "key:hashedKoralQuery");
         }
     }
 
@@ -69,14 +69,14 @@
     private SearchNetworkEndpoint searchNetwork;
 
     private ClientsHandler graphDBhandler;
-    
+
     private TotalResultCache totalResultCache;
 
     @PostConstruct
     private void doPostConstruct () {
         UriBuilder builder = UriBuilder.fromUri("http://10.0.10.13").port(9997);
         this.graphDBhandler = new ClientsHandler(builder.build());
-        
+
         totalResultCache = new TotalResultCache();
     }
 
@@ -84,21 +84,25 @@
         return searchKrill.getIndex().getVersion();
 
     }
-    
+
     @SuppressWarnings("unchecked")
     public String serializeQuery (String q, String ql, String v, String cq,
             Integer pageIndex, Integer startPage, Integer pageLength,
             String context, Boolean cutoff, boolean accessRewriteDisabled)
             throws KustvaktException {
         QuerySerializer ss = new QuerySerializer().setQuery(q, ql, v);
-        if (cq != null) ss.setCollection(cq);
+        if (cq != null)
+            ss.setCollection(cq);
 
         MetaQueryBuilder meta = new MetaQueryBuilder();
-        if (pageIndex != null) meta.addEntry("startIndex", pageIndex);
+        if (pageIndex != null)
+            meta.addEntry("startIndex", pageIndex);
         if (pageIndex == null && startPage != null)
             meta.addEntry("startPage", startPage);
-        if (pageLength != null) meta.addEntry("count", pageLength);
-        if (context != null) meta.setSpanContext(context);
+        if (pageLength != null)
+            meta.addEntry("count", pageLength);
+        if (context != null)
+            meta.setSpanContext(context);
         meta.addEntry("cutOff", cutoff);
 
         ss.setMeta(meta.raw());
@@ -127,12 +131,12 @@
 
         User user = createUser(username, headers);
 
-        JsonNode node  = JsonUtils.readTree(jsonld);
+        JsonNode node = JsonUtils.readTree(jsonld);
         node = node.at("/meta/snippets");
-        if (node !=null && node.asBoolean()){
+        if (node != null && node.asBoolean()) {
             user.setCorpusAccess(CorpusAccess.ALL);
         }
-        
+
         String query = this.rewriteHandler.processQuery(jsonld, user);
         // MH: todo: should be possible to add the meta part to
         // the query serialization
@@ -146,42 +150,42 @@
             String q, String ql, String v, List<String> cqList, String fields,
             String pipes, Integer pageIndex, Integer pageInteger, String ctx,
             Integer pageLength, Boolean cutoff, boolean accessRewriteDisabled,
-            boolean showTokens, boolean showSnippet)
-            throws KustvaktException {
+            boolean showTokens, boolean showSnippet) throws KustvaktException {
 
         if (pageInteger != null && pageInteger < 1) {
             throw new KustvaktException(StatusCodes.INVALID_ARGUMENT,
                     "page must start from 1", "page");
         }
-        
+
         String[] pipeArray = null;
-        if (pipes!=null && !pipes.isEmpty()){
+        if (pipes != null && !pipes.isEmpty()) {
             pipeArray = pipes.split(",");
         }
-        
+
         User user = createUser(username, headers);
         CorpusAccess corpusAccess = user.getCorpusAccess();
-        
+
         // EM: TODO: check if requested fields are public metadata. Currently 
         // it is not needed because all metadata are public.        
-        if (accessRewriteDisabled){
+        if (accessRewriteDisabled) {
             corpusAccess = CorpusAccess.ALL;
             user.setCorpusAccess(CorpusAccess.ALL);
         }
-        
+
         QuerySerializer serializer = new QuerySerializer();
         serializer.setQuery(q, ql, v);
         String cq = combineMultipleCorpusQuery(cqList);
-        if (cq != null) serializer.setCollection(cq);
+        if (cq != null)
+            serializer.setCollection(cq);
 
         List<String> fieldList = convertFieldsToList(fields);
         handleNonPublicFields(fieldList, accessRewriteDisabled, serializer);
-        
+
         MetaQueryBuilder meta = createMetaQuery(pageIndex, pageInteger, ctx,
-                pageLength, cutoff, corpusAccess, fieldList, accessRewriteDisabled,
-                showTokens, showSnippet);
+                pageLength, cutoff, corpusAccess, fieldList,
+                accessRewriteDisabled, showTokens, showSnippet);
         serializer.setMeta(meta.raw());
-        
+
         // There is an error in query processing
         // - either query, corpus or meta
         if (serializer.hasErrors()) {
@@ -189,7 +193,7 @@
         }
 
         String query = serializer.toJSON();
-        
+
         if (accessRewriteDisabled && showTokens) {
             Notifications n = new Notifications();
             n.addWarning(StatusCodes.NOT_ALLOWED,
@@ -197,21 +201,22 @@
             JsonNode warning = n.toJsonNode();
             query = addWarning(query, warning);
         }
-        
-        query = runPipes(query,pipeArray);
-        
+
+        query = runPipes(query, pipeArray);
+
         query = this.rewriteHandler.processQuery(query, user);
-        if (DEBUG){
+        if (DEBUG) {
             jlog.debug("the serialized query " + query);
         }
 
         int hashedKoralQuery = createTotalResultCacheKey(query);
         boolean hasCutOff = hasCutOff(query);
         if (!hasCutOff) {
-            query = precheckTotalResultCache(hashedKoralQuery,query);
+            query = precheckTotalResultCache(hashedKoralQuery, query);
         }
 
-        KustvaktConfiguration.BACKENDS searchEngine = this.config.chooseBackend(engine);
+        KustvaktConfiguration.BACKENDS searchEngine = this.config
+                .chooseBackend(engine);
         String result;
         if (searchEngine.equals(KustvaktConfiguration.BACKENDS.NEO4J)) {
             result = searchNeo4J(query, pageLength, meta, false);
@@ -223,15 +228,15 @@
             result = searchKrill.search(query);
         }
         // jlog.debug("Query result: " + result);
-        
-        result = afterCheckTotalResultCache(hashedKoralQuery,result);
+
+        result = afterCheckTotalResultCache(hashedKoralQuery, result);
         if (!hasCutOff) {
             result = removeCutOff(result);
         }
         return result;
 
     }
-    
+
     private String removeCutOff (String result) throws KustvaktException {
         ObjectNode resultNode = (ObjectNode) JsonUtils.readTree(result);
         ObjectNode meta = (ObjectNode) resultNode.at("/meta");
@@ -239,7 +244,8 @@
         return resultNode.toString();
     }
 
-    public int createTotalResultCacheKey (String query) throws KustvaktException {
+    public int createTotalResultCacheKey (String query)
+            throws KustvaktException {
         ObjectNode queryNode = (ObjectNode) JsonUtils.readTree(query);
         queryNode.remove("meta");
         return queryNode.hashCode();
@@ -247,9 +253,9 @@
 
     private String afterCheckTotalResultCache (int hashedKoralQuery,
             String result) throws KustvaktException {
-        
-        String totalResults =
-                (String) totalResultCache.getCacheValue(hashedKoralQuery);
+
+        String totalResults = (String) totalResultCache
+                .getCacheValue(hashedKoralQuery);
         if (totalResults != null) {
             ObjectNode queryNode = (ObjectNode) JsonUtils.readTree(result);
             ObjectNode meta = (ObjectNode) queryNode.at("/meta");
@@ -264,9 +270,8 @@
         else {
             JsonNode node = JsonUtils.readTree(result);
             totalResults = node.at("/meta/totalResults").asText();
-            if (totalResults != null &&
-                    !totalResults.isEmpty() &&
-                    Integer.parseInt(totalResults) > 0)
+            if (totalResults != null && !totalResults.isEmpty()
+                    && Integer.parseInt(totalResults) > 0)
                 totalResultCache.storeInCache(hashedKoralQuery, totalResults);
         }
         return result;
@@ -274,8 +279,8 @@
 
     public String precheckTotalResultCache (int hashedKoralQuery, String query)
             throws KustvaktException {
-        String totalResults =
-                (String) totalResultCache.getCacheValue(hashedKoralQuery);
+        String totalResults = (String) totalResultCache
+                .getCacheValue(hashedKoralQuery);
         if (totalResults != null) {
             // add cutoff
             ObjectNode queryNode = (ObjectNode) JsonUtils.readTree(query);
@@ -285,7 +290,7 @@
         }
         return query;
     }
-    
+
     private boolean hasCutOff (String query) throws KustvaktException {
         JsonNode queryNode = JsonUtils.readTree(query);
         JsonNode cutOff = queryNode.at("/meta/cutOff");
@@ -300,33 +305,40 @@
     /**
      * Pipes are service URLs for modifying KoralQuery. A POST request
      * with Content-Type application/json will be sent for each pipe.
-     * Kustvakt expects a KoralQuery in JSON format as the pipe response. 
+     * Kustvakt expects a KoralQuery in JSON format as the pipe
+     * response.
      * 
-     * @param query the original koral query
-     * @param pipeArray the pipe service URLs
-     * @param serializer the query serializer
+     * @param query
+     *            the original koral query
+     * @param pipeArray
+     *            the pipe service URLs
+     * @param serializer
+     *            the query serializer
      * @return a modified koral query
-     * @throws KustvaktException 
+     * @throws KustvaktException
      */
-    private String runPipes (String query, String[] pipeArray) throws KustvaktException {
-        if (pipeArray !=null){
-            for (int i=0; i<pipeArray.length; i++){
+    private String runPipes (String query, String[] pipeArray)
+            throws KustvaktException {
+        if (pipeArray != null) {
+            for (int i = 0; i < pipeArray.length; i++) {
                 String pipeURL = pipeArray[i];
                 try {
                     URL url = new URL(pipeURL);
-                    HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+                    HttpURLConnection connection = (HttpURLConnection) url
+                            .openConnection();
                     connection.setRequestMethod("POST");
-                    connection.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
+                    connection.setRequestProperty("Content-Type",
+                            "application/json; charset=UTF-8");
                     connection.setRequestProperty("Accept", "application/json");
                     connection.setDoOutput(true);
                     OutputStream os = connection.getOutputStream();
                     byte[] input = query.getBytes("utf-8");
-                    os.write(input, 0, input.length);     
-                    
+                    os.write(input, 0, input.length);
+
                     String entity = null;
                     if (connection.getResponseCode() == HttpStatus.SC_OK) {
-                        BufferedReader br =
-                                new BufferedReader(new InputStreamReader(
+                        BufferedReader br = new BufferedReader(
+                                new InputStreamReader(
                                         connection.getInputStream(), "utf-8"));
                         StringBuilder response = new StringBuilder();
                         String responseLine = null;
@@ -346,39 +358,37 @@
                     }
                 }
                 catch (Exception e) {
-                    query = handlePipeError(query, pipeURL,
-                            e.getMessage());
+                    query = handlePipeError(query, pipeURL, e.getMessage());
                 }
             }
         }
         return query;
     }
-    
-    private String handlePipeError (String query, String url,
-            String message) throws KustvaktException {
-        jlog.warn("Failed running the pipe at " + url + ". Message: "+ message);
-       
+
+    private String handlePipeError (String query, String url, String message)
+            throws KustvaktException {
+        jlog.warn(
+                "Failed running the pipe at " + url + ". Message: " + message);
+
         Notifications n = new Notifications();
-        n.addWarning(StatusCodes.PIPE_FAILED,
-                "Pipe failed", url, message);
+        n.addWarning(StatusCodes.PIPE_FAILED, "Pipe failed", url, message);
         JsonNode warning = n.toJsonNode();
-        
+
         query = addWarning(query, warning);
-        return query; 
+        return query;
     }
-    
 
     private String addWarning (String query, JsonNode warning)
             throws KustvaktException {
-        
+
         ObjectNode node = (ObjectNode) JsonUtils.readTree(query);
-        if (node.has("warnings")){
+        if (node.has("warnings")) {
             warning = warning.at("/warnings/0");
             ArrayNode arrayNode = (ArrayNode) node.get("warnings");
             arrayNode.add(warning);
             node.set("warnings", arrayNode);
         }
-        else{
+        else {
             node.setAll((ObjectNode) warning);
         }
         return node.toString();
@@ -386,9 +396,9 @@
 
     private void handleNonPublicFields (List<String> fieldList,
             boolean accessRewriteDisabled, QuerySerializer serializer) {
-        List<String> nonPublicFields = new ArrayList<>(); 
+        List<String> nonPublicFields = new ArrayList<>();
         nonPublicFields.add("snippet");
-        
+
         List<String> ignoredFields = new ArrayList<>();
         if (accessRewriteDisabled && !fieldList.isEmpty()) {
             for (String field : fieldList) {
@@ -403,12 +413,12 @@
             }
         }
     }
-    
+
     private MetaQueryBuilder createMetaQuery (Integer pageIndex,
-            Integer pageInteger, String ctx, Integer pageLength,
-            Boolean cutoff, CorpusAccess corpusAccess, List<String> fieldList,
-            boolean accessRewriteDisabled,
-            boolean showTokens, boolean showSnippet) {
+            Integer pageInteger, String ctx, Integer pageLength, Boolean cutoff,
+            CorpusAccess corpusAccess, List<String> fieldList,
+            boolean accessRewriteDisabled, boolean showTokens,
+            boolean showSnippet) {
         MetaQueryBuilder meta = new MetaQueryBuilder();
         meta.addEntry("startIndex", pageIndex);
         meta.addEntry("startPage", pageInteger);
@@ -420,20 +430,20 @@
         if (!accessRewriteDisabled) {
             meta.addEntry("tokens", showTokens);
         }
-        
+
         // meta.addMeta(pageIndex, pageInteger, pageLength, ctx,
         // cutoff);
         // fixme: should only apply to CQL queries per default!
         // meta.addEntry("itemsPerResource", 1);
-        
-        if (corpusAccess.equals(CorpusAccess.FREE)){
+
+        if (corpusAccess.equals(CorpusAccess.FREE)) {
             meta.addEntry("timeout", 10000);
         }
-        else{
+        else {
             meta.addEntry("timeout", 90000);
         }
-        
-        if (fieldList != null && !fieldList.isEmpty()){
+
+        if (fieldList != null && !fieldList.isEmpty()) {
             meta.addEntry("fields", fieldList);
         }
         return meta;
@@ -452,7 +462,7 @@
             return new ArrayList<>();
         }
     }
-    
+
     private String searchNeo4J (String query, int pageLength,
             MetaQueryBuilder meta, boolean raw) throws KustvaktException {
 
@@ -488,25 +498,22 @@
         }
         return p;
     }
-    
-    public String retrieveMatchInfo (
-        String corpusId, String docId,
-        String textId, String matchId, boolean info, Set<String> foundries,
-        String username, HttpHeaders headers, Set<String> layers,
-        boolean spans,
-        boolean snippet, boolean tokens,
-        boolean sentenceExpansion,
-        boolean highlights
-        ) throws KustvaktException {
-        String matchid =
-            searchKrill.getMatchId(corpusId, docId, textId, matchId);
+
+    public String retrieveMatchInfo (String corpusId, String docId,
+            String textId, String matchId, boolean info, Set<String> foundries,
+            String username, HttpHeaders headers, Set<String> layers,
+            boolean spans, boolean snippet, boolean tokens,
+            boolean sentenceExpansion, boolean highlights)
+            throws KustvaktException {
+        String matchid = searchKrill.getMatchId(corpusId, docId, textId,
+                matchId);
 
         User user = createUser(username, headers);
         Pattern p = determineAvailabilityPattern(user);
 
-//        boolean match_only = foundries == null || foundries.isEmpty();
+        //        boolean match_only = foundries == null || foundries.isEmpty();
         String results;
-//        try {
+        //        try {
 
         ArrayList<String> foundryList = null;
         ArrayList<String> layerList = null;
@@ -524,24 +531,23 @@
                 foundryList.addAll(foundries);
                 layerList.addAll(layers);
             }
-        } else {
+        }
+        else {
             sentenceExpansion = false;
             spans = false;
             info = false;
             highlights = true;
         };
-        
-        results = searchKrill.getMatch(
-            matchid, info, foundryList, layerList,
-            spans, snippet, tokens, highlights,
-            sentenceExpansion, p);
-//        }
-//        catch (Exception e) {
-//            jlog.error("Exception in the MatchInfo service encountered!", e);
-//            throw new KustvaktException(StatusCodes.ILLEGAL_ARGUMENT,
-//                    e.getMessage());
-//        }
-        if (DEBUG){
+
+        results = searchKrill.getMatch(matchid, info, foundryList, layerList,
+                spans, snippet, tokens, highlights, sentenceExpansion, p);
+        //        }
+        //        catch (Exception e) {
+        //            jlog.error("Exception in the MatchInfo service encountered!", e);
+        //            throw new KustvaktException(StatusCodes.ILLEGAL_ARGUMENT,
+        //                    e.getMessage());
+        //        }
+        if (DEBUG) {
             jlog.debug("MatchInfo results: " + results);
         }
         return results;
@@ -551,22 +557,22 @@
             String textId, String fields, String username, HttpHeaders headers)
             throws KustvaktException {
         List<String> fieldList = null;
-        if (fields != null && !fields.isEmpty()){
+        if (fields != null && !fields.isEmpty()) {
             fieldList = convertFieldsToList(fields);
         }
         Pattern p = null;
-        if (config.isMetadataRestricted()){
+        if (config.isMetadataRestricted()) {
             User user = createUser(username, headers);
             p = determineAvailabilityPattern(user);
         }
         String textSigle = searchKrill.getTextSigle(corpusId, docId, textId);
         return searchKrill.getFields(textSigle, fieldList, p);
     }
-    
+
     public String getCollocationBase (String query) throws KustvaktException {
         return graphDBhandler.getResponse("distCollo", "q", query);
     }
-    
+
     public void closeIndexReader () throws KustvaktException {
         searchKrill.closeIndexReader();
     }
@@ -577,7 +583,7 @@
     public String getIndexFingerprint () {
         return searchKrill.getIndexFingerprint();
     }
-    
+
     public TotalResultCache getTotalResultCache () {
         return totalResultCache;
     }
diff --git a/full/src/main/java/de/ids_mannheim/korap/core/service/StatisticService.java b/full/src/main/java/de/ids_mannheim/korap/core/service/StatisticService.java
index 54f5e1a..6f0a3f0 100644
--- a/full/src/main/java/de/ids_mannheim/korap/core/service/StatisticService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/core/service/StatisticService.java
@@ -49,7 +49,7 @@
             node.setAll(warning);
             stats = node.toString();
         }
-        
+
         if (stats.contains("-1")) {
             throw new KustvaktException(StatusCodes.NO_RESULT_FOUND);
         }
@@ -89,7 +89,7 @@
         else {
             stats = searchKrill.getStatistics(null);
         }
-        
+
         if (stats.contains("-1")) {
             throw new KustvaktException(StatusCodes.NO_RESULT_FOUND);
         }
diff --git a/full/src/main/java/de/ids_mannheim/korap/core/web/controller/AnnotationController.java b/full/src/main/java/de/ids_mannheim/korap/core/web/controller/AnnotationController.java
index c337c5e..1f75d3c 100644
--- a/full/src/main/java/de/ids_mannheim/korap/core/web/controller/AnnotationController.java
+++ b/full/src/main/java/de/ids_mannheim/korap/core/web/controller/AnnotationController.java
@@ -34,7 +34,8 @@
  */
 @Controller
 @Path("/{version}/annotation/")
-@ResourceFilters({APIVersionFilter.class, DemoUserFilter.class, PiwikFilter.class })
+@ResourceFilters({ APIVersionFilter.class, DemoUserFilter.class,
+        PiwikFilter.class })
 @Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
 public class AnnotationController {
 
@@ -55,7 +56,6 @@
         return annotationService.getLayerDtos();
     }
 
-
     /**
      * Returns a list of foundry descriptions.
      * 
@@ -71,8 +71,8 @@
     @Consumes(MediaType.APPLICATION_JSON)
     public List<FoundryDto> getFoundryDescriptions (String json) {
         if (json == null || json.isEmpty()) {
-            throw kustvaktResponseHandler
-                    .throwit(new KustvaktException(StatusCodes.MISSING_PARAMETER,
+            throw kustvaktResponseHandler.throwit(
+                    new KustvaktException(StatusCodes.MISSING_PARAMETER,
                             "Missing a json string.", ""));
         }
 
@@ -122,4 +122,3 @@
         }
     }
 }
-
diff --git a/full/src/main/java/de/ids_mannheim/korap/core/web/controller/SearchController.java b/full/src/main/java/de/ids_mannheim/korap/core/web/controller/SearchController.java
index 7e4ed94..042f412 100644
--- a/full/src/main/java/de/ids_mannheim/korap/core/web/controller/SearchController.java
+++ b/full/src/main/java/de/ids_mannheim/korap/core/web/controller/SearchController.java
@@ -1,5 +1,6 @@
 package de.ids_mannheim.korap.core.web.controller;// package
-                                             // de.ids_mannheim.korap.ext.web;
+
+// de.ids_mannheim.korap.ext.web;
 
 import java.util.HashMap;
 import java.util.HashSet;
@@ -61,7 +62,7 @@
 
     private static Logger jlog = LogManager.getLogger(SearchController.class);
     private @Context ServletContext context;
-    
+
     @Autowired
     private KustvaktResponseHandler kustvaktResponseHandler;
 
@@ -71,20 +72,19 @@
     private OAuth2ScopeService scopeService;
     @Autowired
     private KustvaktConfiguration config;
-    
+
     @GET
     @Path("{version}")
-    public Response index (){
-        return Response
-            .ok(config.getApiWelcomeMessage())
-            .header("X-Index-Revision", searchService.getIndexFingerprint())
-            .build();
+    public Response index () {
+        return Response.ok(config.getApiWelcomeMessage())
+                .header("X-Index-Revision", searchService.getIndexFingerprint())
+                .build();
     }
-    
+
     @GET
     @Path("{version}/info")
     @Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
-    public Response info (){
+    public Response info () {
         Map<String, Object> m = new HashMap<>();
         m.put("latest_api_version", config.getCurrentVersion());
         m.put("supported_api_versions", config.getSupportedVersions());
@@ -98,12 +98,12 @@
             throw kustvaktResponseHandler.throwit(e);
         }
     }
-    
+
     @POST
     @Path("{version}/index/close")
     // overrides the whole filters
-    @ResourceFilters({APIVersionFilter.class,AdminFilter.class})
-    public Response closeIndexReader (){
+    @ResourceFilters({ APIVersionFilter.class, AdminFilter.class })
+    public Response closeIndexReader () {
         try {
             searchService.closeIndexReader();
         }
@@ -112,16 +112,15 @@
         }
         return Response.ok().build();
     }
-    
-    
-//     EM: This web service is DISABLED until there is a need for it.
-//     ND: In case rewrite is supported, it could be used to check the authorization 
-//         scope without searching etc. In case not, it helps to compare queries in 
-//         different query languages.
-//     MH: ref query parameter removed!
-//    @GET
-//    @Path("{version}/query")
-//    @Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
+
+    //     EM: This web service is DISABLED until there is a need for it.
+    //     ND: In case rewrite is supported, it could be used to check the authorization 
+    //         scope without searching etc. In case not, it helps to compare queries in 
+    //         different query languages.
+    //     MH: ref query parameter removed!
+    //    @GET
+    //    @Path("{version}/query")
+    //    @Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
     public Response serializeQuery (@Context Locale locale,
             @Context SecurityContext securityContext, @QueryParam("q") String q,
             @QueryParam("ql") String ql, @QueryParam("v") String v,
@@ -138,7 +137,7 @@
             String result = searchService.serializeQuery(q, ql, v, cq,
                     pageIndex, startPage, pageLength, context, cutoff,
                     accessRewriteDisabled);
-            if (DEBUG){
+            if (DEBUG) {
                 jlog.debug("Query: " + result);
             }
             return Response.ok(result).build();
@@ -148,21 +147,19 @@
         }
     }
 
-    
-//    This web service is DISABLED until there is a need for it. 
+    //    This web service is DISABLED until there is a need for it. 
     @POST
     @Path("{version}/search")
     @Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
     @SearchResourceFilters
     public Response searchPost (@Context SecurityContext context,
-            @Context Locale locale, 
-            @Context HttpHeaders headers,
+            @Context Locale locale, @Context HttpHeaders headers,
             String jsonld) {
-        
-        if (DEBUG){
+
+        if (DEBUG) {
             jlog.debug("Serialized search: " + jsonld);
         }
-        
+
         TokenContext ctx = (TokenContext) context.getUserPrincipal();
         try {
             scopeService.verifyScope(ctx, OAuth2Scope.SEARCH);
@@ -175,7 +172,8 @@
         }
     }
 
-    /** Performs for the given query 
+    /**
+     * Performs for the given query
      * 
      * @param securityContext
      * @param request
@@ -194,8 +192,9 @@
      *            or not (default false)
      * @param pageLength
      *            the number of results should be included in a page
-     * @param pageIndex 
-     * @param pageInteger page number
+     * @param pageIndex
+     * @param pageInteger
+     *            page number
      * @param fields
      *            metadata fields to be included, separated by comma
      * @param pipes
@@ -214,10 +213,10 @@
     @Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
     @SearchResourceFilters
     public Response searchGet (@Context SecurityContext securityContext,
-            @Context HttpServletRequest request,
-            @Context HttpHeaders headers, @Context Locale locale,
-            @QueryParam("q") String q, @QueryParam("ql") String ql,
-            @QueryParam("v") String v, @QueryParam("context") String ctx,
+            @Context HttpServletRequest request, @Context HttpHeaders headers,
+            @Context Locale locale, @QueryParam("q") String q,
+            @QueryParam("ql") String ql, @QueryParam("v") String v,
+            @QueryParam("context") String ctx,
             @QueryParam("cutoff") Boolean cutoff,
             @QueryParam("count") Integer pageLength,
             @QueryParam("offset") Integer pageIndex,
@@ -227,19 +226,19 @@
             @QueryParam("access-rewrite-disabled") boolean accessRewriteDisabled,
             @QueryParam("show-tokens") boolean showTokens,
             @DefaultValue("true") @QueryParam("show-snippet") boolean showSnippet,
-            @QueryParam("cq") List<String> cq, 
+            @QueryParam("cq") List<String> cq,
             @QueryParam("engine") String engine) {
 
-        TokenContext context =
-                (TokenContext) securityContext.getUserPrincipal();
+        TokenContext context = (TokenContext) securityContext
+                .getUserPrincipal();
 
         String result;
         try {
             scopeService.verifyScope(context, OAuth2Scope.SEARCH);
             result = searchService.search(engine, context.getUsername(),
                     headers, q, ql, v, cq, fields, pipes, pageIndex,
-                    pageInteger, ctx, pageLength, cutoff,
-                    accessRewriteDisabled, showTokens, showSnippet);
+                    pageInteger, ctx, pageLength, cutoff, accessRewriteDisabled,
+                    showTokens, showSnippet);
         }
         catch (KustvaktException e) {
             throw kustvaktResponseHandler.throwit(e);
@@ -262,15 +261,15 @@
             @PathParam("matchId") String matchId,
             @QueryParam("foundry") Set<String> foundries,
             @QueryParam("layer") Set<String> layers,
-            @QueryParam("spans") Boolean spans, 
+            @QueryParam("spans") Boolean spans,
             // Highlights may also be a list of valid highlight classes
             @QueryParam("hls") Boolean highlights) throws KustvaktException {
 
         return retrieveMatchInfo(ctx, headers, locale, corpusId, docId, textId,
-                                 matchId, foundries, layers, spans, "true", "false",
-                                 "sentence", highlights);
+                matchId, foundries, layers, spans, "true", "false", "sentence",
+                highlights);
     }
-    
+
     @GET
     @Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
     @Path("{version}/corpus/{corpusId}/{docId}/{textId}/{matchId}")
@@ -283,10 +282,10 @@
             @PathParam("matchId") String matchId,
             @QueryParam("foundry") Set<String> foundries,
             @QueryParam("layer") Set<String> layers,
-            @QueryParam("spans") Boolean spans, 
-            @DefaultValue("true") @QueryParam("show-snippet") String snippetStr, 
-            @DefaultValue("false") @QueryParam("show-tokens") String tokensStr, 
-            @QueryParam("expand") String expansion, 
+            @QueryParam("spans") Boolean spans,
+            @DefaultValue("true") @QueryParam("show-snippet") String snippetStr,
+            @DefaultValue("false") @QueryParam("show-tokens") String tokensStr,
+            @QueryParam("expand") String expansion,
             // Highlights may also be a list of valid highlight classes
             @QueryParam("hls") Boolean highlights) throws KustvaktException {
 
@@ -342,10 +341,8 @@
     public Response getMetadata (@PathParam("corpusId") String corpusId,
             @PathParam("docId") String docId,
             @PathParam("textId") String textId,
-            @QueryParam("fields") String fields,
-            @Context SecurityContext ctx,
-            @Context HttpHeaders headers
-    ) throws KustvaktException {
+            @QueryParam("fields") String fields, @Context SecurityContext ctx,
+            @Context HttpHeaders headers) throws KustvaktException {
         TokenContext tokenContext = (TokenContext) ctx.getUserPrincipal();
         try {
             String results = searchService.retrieveDocMetadata(corpusId, docId,
@@ -357,10 +354,10 @@
         }
     }
 
-//  EM: This web service requires Karang and is DISABLED.
-//    @POST
-//    @Path("{version}/colloc")
-//    @Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
+    //  EM: This web service requires Karang and is DISABLED.
+    //    @POST
+    //    @Path("{version}/colloc")
+    //    @Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
     public Response getCollocationBase (@QueryParam("q") String query) {
         String result;
         try {
diff --git a/full/src/main/java/de/ids_mannheim/korap/core/web/controller/StatisticController.java b/full/src/main/java/de/ids_mannheim/korap/core/web/controller/StatisticController.java
index 30ccaa4..6f86d2c 100644
--- a/full/src/main/java/de/ids_mannheim/korap/core/web/controller/StatisticController.java
+++ b/full/src/main/java/de/ids_mannheim/korap/core/web/controller/StatisticController.java
@@ -41,8 +41,8 @@
 public class StatisticController {
 
     private static final boolean DEBUG = false;
-    private static Logger jlog =
-            LogManager.getLogger(StatisticController.class);
+    private static Logger jlog = LogManager
+            .getLogger(StatisticController.class);
     @Autowired
     private CoreResponseHandler kustvaktResponseHandler;
     @Autowired
@@ -81,10 +81,9 @@
                 jlog.debug("Stats: " + stats);
             }
 
-            return Response
-                .ok(stats)
-                .header("X-Index-Revision", service.getIndexFingerprint())
-                .build();
+            return Response.ok(stats)
+                    .header("X-Index-Revision", service.getIndexFingerprint())
+                    .build();
         }
         catch (KustvaktException e) {
             throw kustvaktResponseHandler.throwit(e);
@@ -98,10 +97,9 @@
             String koralQuery) {
         try {
             String stats = service.retrieveStatisticsForKoralQuery(koralQuery);
-            return Response
-                .ok(stats)
-                .header("X-Index-Revision", service.getIndexFingerprint())
-                .build();
+            return Response.ok(stats)
+                    .header("X-Index-Revision", service.getIndexFingerprint())
+                    .build();
         }
         catch (KustvaktException e) {
             throw kustvaktResponseHandler.throwit(e);
diff --git a/full/src/main/java/de/ids_mannheim/korap/dao/AnnotationDao.java b/full/src/main/java/de/ids_mannheim/korap/dao/AnnotationDao.java
index 0ebfe42..4aa7cd4 100644
--- a/full/src/main/java/de/ids_mannheim/korap/dao/AnnotationDao.java
+++ b/full/src/main/java/de/ids_mannheim/korap/dao/AnnotationDao.java
@@ -24,7 +24,8 @@
 import jakarta.persistence.criteria.Root;
 
 /**
- * AnnotationDao manages queries to database regarding annotations including
+ * AnnotationDao manages queries to database regarding annotations
+ * including
  * foundry and layer pairs.
  * 
  * @author margaretha
@@ -44,8 +45,8 @@
     @SuppressWarnings("unchecked")
     public List<AnnotationLayer> getAllFoundryLayerPairs () {
         CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<AnnotationLayer> query =
-                criteriaBuilder.createQuery(AnnotationLayer.class);
+        CriteriaQuery<AnnotationLayer> query = criteriaBuilder
+                .createQuery(AnnotationLayer.class);
         Root<AnnotationLayer> layer = query.from(AnnotationLayer.class);
         layer.fetch(AnnotationLayer_.foundry);
         layer.fetch(AnnotationLayer_.layer);
@@ -72,8 +73,8 @@
 
         CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
         CriteriaQuery<Object> query = criteriaBuilder.createQuery();
-        Root<AnnotationLayer> annotationPair =
-                query.from(AnnotationLayer.class);
+        Root<AnnotationLayer> annotationPair = query
+                .from(AnnotationLayer.class);
         annotationPair.fetch(AnnotationLayer_.foundry);
         annotationPair.fetch(AnnotationLayer_.layer);
         annotationPair.fetch(AnnotationLayer_.keys);
@@ -97,8 +98,8 @@
                 Predicate layerPredicate = criteriaBuilder.equal(annotationPair
                         .get(AnnotationLayer_.layer).get(Annotation_.code),
                         layer);
-                Predicate andPredicate =
-                        criteriaBuilder.and(foundryPredicate, layerPredicate);
+                Predicate andPredicate = criteriaBuilder.and(foundryPredicate,
+                        layerPredicate);
                 query.where(andPredicate);
             }
         }
@@ -109,8 +110,8 @@
 
     public Annotation retrieveAnnotation (String code, String type) {
         CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<Annotation> query =
-                criteriaBuilder.createQuery(Annotation.class);
+        CriteriaQuery<Annotation> query = criteriaBuilder
+                .createQuery(Annotation.class);
 
         Root<Annotation> annotation = query.from(Annotation.class);
         Predicate predicates = criteriaBuilder.and(
@@ -132,8 +133,8 @@
         Annotation ann2 = retrieveAnnotation(layer, AnnotationType.LAYER);
 
         CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<AnnotationLayer> query =
-                criteriaBuilder.createQuery(AnnotationLayer.class);
+        CriteriaQuery<AnnotationLayer> query = criteriaBuilder
+                .createQuery(AnnotationLayer.class);
 
         Root<AnnotationLayer> annotation = query.from(AnnotationLayer.class);
         Predicate predicates = criteriaBuilder.and(
@@ -188,8 +189,8 @@
     @Transactional
     public AnnotationKey createAnnotationKey (AnnotationLayer layer,
             Annotation key) {
-        AnnotationKey annotation =
-                new AnnotationKey(layer.getId(), key.getId());
+        AnnotationKey annotation = new AnnotationKey(layer.getId(),
+                key.getId());
         entityManager.persist(annotation);
         return annotation;
     }
@@ -198,8 +199,8 @@
             Annotation key) {
 
         CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<AnnotationKey> query =
-                criteriaBuilder.createQuery(AnnotationKey.class);
+        CriteriaQuery<AnnotationKey> query = criteriaBuilder
+                .createQuery(AnnotationKey.class);
 
         Root<AnnotationKey> annotation = query.from(AnnotationKey.class);
         Predicate predicates = criteriaBuilder.and(
diff --git a/full/src/main/java/de/ids_mannheim/korap/dao/DefaultSettingDao.java b/full/src/main/java/de/ids_mannheim/korap/dao/DefaultSettingDao.java
index f99990e..a6bfeee 100644
--- a/full/src/main/java/de/ids_mannheim/korap/dao/DefaultSettingDao.java
+++ b/full/src/main/java/de/ids_mannheim/korap/dao/DefaultSettingDao.java
@@ -60,7 +60,7 @@
             throws KustvaktException {
         ParameterChecker.checkObjectValue(username, "defaultSetting");
         DefaultSetting defaultSetting = retrieveDefaultSetting(username);
-        if (defaultSetting != null){
+        if (defaultSetting != null) {
             entityManager.remove(defaultSetting);
         }
     }
@@ -70,8 +70,8 @@
         ParameterChecker.checkStringValue(username, "username");
 
         CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<DefaultSetting> query =
-                criteriaBuilder.createQuery(DefaultSetting.class);
+        CriteriaQuery<DefaultSetting> query = criteriaBuilder
+                .createQuery(DefaultSetting.class);
         Root<DefaultSetting> defaultSetting = query.from(DefaultSetting.class);
 
         query.select(defaultSetting);
diff --git a/full/src/main/java/de/ids_mannheim/korap/dao/PrivilegeDao.java b/full/src/main/java/de/ids_mannheim/korap/dao/PrivilegeDao.java
index f9c05e6..ad1e77b 100644
--- a/full/src/main/java/de/ids_mannheim/korap/dao/PrivilegeDao.java
+++ b/full/src/main/java/de/ids_mannheim/korap/dao/PrivilegeDao.java
@@ -57,8 +57,8 @@
     @SuppressWarnings("unchecked")
     public List<Privilege> retrievePrivilegeByRoleId (int roleId) {
         CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<Privilege> query =
-                criteriaBuilder.createQuery(Privilege.class);
+        CriteriaQuery<Privilege> query = criteriaBuilder
+                .createQuery(Privilege.class);
 
         Root<Privilege> root = query.from(Privilege.class);
         root.fetch(Privilege_.role);
diff --git a/full/src/main/java/de/ids_mannheim/korap/dao/QueryAccessDao.java b/full/src/main/java/de/ids_mannheim/korap/dao/QueryAccessDao.java
index d341f38..5448b49 100644
--- a/full/src/main/java/de/ids_mannheim/korap/dao/QueryAccessDao.java
+++ b/full/src/main/java/de/ids_mannheim/korap/dao/QueryAccessDao.java
@@ -49,22 +49,19 @@
         ParameterChecker.checkIntegerValue(accessId, "accessId");
 
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<QueryAccess> query =
-                builder.createQuery(QueryAccess.class);
+        CriteriaQuery<QueryAccess> query = builder
+                .createQuery(QueryAccess.class);
 
-        Root<QueryAccess> access =
-                query.from(QueryAccess.class);
+        Root<QueryAccess> access = query.from(QueryAccess.class);
         query.select(access);
-        query.where(
-                builder.equal(access.get(QueryAccess_.id), accessId));
+        query.where(builder.equal(access.get(QueryAccess_.id), accessId));
         Query q = entityManager.createQuery(query);
-        try{
+        try {
             return (QueryAccess) q.getSingleResult();
         }
         catch (NoResultException e) {
             throw new KustvaktException(StatusCodes.NO_RESOURCE_FOUND,
-                    "Query access is not found",
-                    String.valueOf(accessId));
+                    "Query access is not found", String.valueOf(accessId));
         }
     }
 
@@ -74,13 +71,12 @@
         ParameterChecker.checkIntegerValue(queryId, "queryId");
 
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<QueryAccess> query =
-                builder.createQuery(QueryAccess.class);
+        CriteriaQuery<QueryAccess> query = builder
+                .createQuery(QueryAccess.class);
 
-        Root<QueryAccess> access =
-                query.from(QueryAccess.class);
-        Join<QueryAccess, QueryDO> accessQuery =
-                access.join(QueryAccess_.query);
+        Root<QueryAccess> access = query.from(QueryAccess.class);
+        Join<QueryAccess, QueryDO> accessQuery = access
+                .join(QueryAccess_.query);
 
         Predicate p = builder.and(
                 builder.equal(accessQuery.get(QueryDO_.id), queryId),
@@ -98,17 +94,17 @@
         ParameterChecker.checkStringValue(queryName, "queryName");
 
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<QueryAccess> query =
-                builder.createQuery(QueryAccess.class);
+        CriteriaQuery<QueryAccess> query = builder
+                .createQuery(QueryAccess.class);
 
-        Root<QueryAccess> access =
-                query.from(QueryAccess.class);
-        Join<QueryAccess, QueryDO> accessQuery =
-                access.join(QueryAccess_.query);
+        Root<QueryAccess> access = query.from(QueryAccess.class);
+        Join<QueryAccess, QueryDO> accessQuery = access
+                .join(QueryAccess_.query);
 
         Predicate p = builder.and(
                 builder.equal(accessQuery.get(QueryDO_.name), queryName),
-                builder.equal(accessQuery.get(QueryDO_.createdBy), queryCreator),
+                builder.equal(accessQuery.get(QueryDO_.createdBy),
+                        queryCreator),
                 builder.equal(access.get(QueryAccess_.status),
                         QueryAccessStatus.ACTIVE));
         query.select(access);
@@ -116,15 +112,13 @@
         TypedQuery<QueryAccess> q = entityManager.createQuery(query);
         return q.getResultList();
     }
-    
-    public List<QueryAccess> retrieveAllAccess ()
-            throws KustvaktException {
+
+    public List<QueryAccess> retrieveAllAccess () throws KustvaktException {
 
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<QueryAccess> query =
-                builder.createQuery(QueryAccess.class);
-        Root<QueryAccess> access =
-                query.from(QueryAccess.class);
+        CriteriaQuery<QueryAccess> query = builder
+                .createQuery(QueryAccess.class);
+        Root<QueryAccess> access = query.from(QueryAccess.class);
         query.select(access);
         TypedQuery<QueryAccess> q = entityManager.createQuery(query);
         return q.getResultList();
@@ -136,13 +130,12 @@
         ParameterChecker.checkStringValue(queryName, "queryName");
 
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<QueryAccess> query =
-                builder.createQuery(QueryAccess.class);
+        CriteriaQuery<QueryAccess> query = builder
+                .createQuery(QueryAccess.class);
 
-        Root<QueryAccess> access =
-                query.from(QueryAccess.class);
-        Join<QueryAccess, QueryDO> accessQuery =
-                access.join(QueryAccess_.query);
+        Root<QueryAccess> access = query.from(QueryAccess.class);
+        Join<QueryAccess, QueryDO> accessQuery = access
+                .join(QueryAccess_.query);
 
         Predicate conditions = builder.and(
                 builder.equal(accessQuery.get(QueryDO_.createdBy),
@@ -159,13 +152,12 @@
         ParameterChecker.checkIntegerValue(groupId, "groupId");
 
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<QueryAccess> query =
-                builder.createQuery(QueryAccess.class);
+        CriteriaQuery<QueryAccess> query = builder
+                .createQuery(QueryAccess.class);
 
-        Root<QueryAccess> access =
-                query.from(QueryAccess.class);
-        Join<QueryAccess, UserGroup> accessQuery =
-                access.join(QueryAccess_.userGroup);
+        Root<QueryAccess> access = query.from(QueryAccess.class);
+        Join<QueryAccess, UserGroup> accessQuery = access
+                .join(QueryAccess_.userGroup);
 
         query.select(access);
         query.where(builder.equal(accessQuery.get(UserGroup_.id), groupId));
@@ -178,18 +170,17 @@
         ParameterChecker.checkIntegerValue(groupId, "groupId");
 
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<QueryAccess> query =
-                builder.createQuery(QueryAccess.class);
+        CriteriaQuery<QueryAccess> query = builder
+                .createQuery(QueryAccess.class);
 
-        Root<QueryAccess> access =
-                query.from(QueryAccess.class);
-        Join<QueryAccess, UserGroup> accessQuery =
-                access.join(QueryAccess_.userGroup);
+        Root<QueryAccess> access = query.from(QueryAccess.class);
+        Join<QueryAccess, UserGroup> accessQuery = access
+                .join(QueryAccess_.userGroup);
 
-        Predicate p =
-                builder.and(builder.equal(accessQuery.get(UserGroup_.id), groupId),
-                        builder.equal(access.get(QueryAccess_.status),
-                                QueryAccessStatus.ACTIVE));
+        Predicate p = builder.and(
+                builder.equal(accessQuery.get(UserGroup_.id), groupId),
+                builder.equal(access.get(QueryAccess_.status),
+                        QueryAccessStatus.ACTIVE));
 
         query.select(access);
         query.where(p);
@@ -212,13 +203,12 @@
         ParameterChecker.checkIntegerValue(queryId, "queryId");
 
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<QueryAccess> query =
-                builder.createQuery(QueryAccess.class);
+        CriteriaQuery<QueryAccess> query = builder
+                .createQuery(QueryAccess.class);
 
-        Root<QueryAccess> access =
-                query.from(QueryAccess.class);
-        Join<QueryAccess, QueryDO> accessQuery =
-                access.join(QueryAccess_.query);
+        Root<QueryAccess> access = query.from(QueryAccess.class);
+        Join<QueryAccess, QueryDO> accessQuery = access
+                .join(QueryAccess_.query);
 
         Predicate p = builder.and(
                 builder.equal(accessQuery.get(QueryDO_.id), queryId),
@@ -241,9 +231,8 @@
         }
     }
 
-    public void createAccessToQuery (QueryDO query,
-            UserGroup userGroup, String createdBy,
-            QueryAccessStatus status) {
+    public void createAccessToQuery (QueryDO query, UserGroup userGroup,
+            String createdBy, QueryAccessStatus status) {
         QueryAccess queryAccess = new QueryAccess();
         queryAccess.setQuery(query);
         queryAccess.setUserGroup(userGroup);
diff --git a/full/src/main/java/de/ids_mannheim/korap/dao/QueryDao.java b/full/src/main/java/de/ids_mannheim/korap/dao/QueryDao.java
index 366188b..e17582a 100644
--- a/full/src/main/java/de/ids_mannheim/korap/dao/QueryDao.java
+++ b/full/src/main/java/de/ids_mannheim/korap/dao/QueryDao.java
@@ -53,11 +53,11 @@
     @PersistenceContext
     private EntityManager entityManager;
 
-    public int createQuery (String name, ResourceType type,
-            QueryType queryType, CorpusAccess requiredAccess, String koralQuery,
-            String definition, String description, String status,
-            boolean isCached, String createdBy, String query,
-            String queryLanguage) throws KustvaktException {
+    public int createQuery (String name, ResourceType type, QueryType queryType,
+            CorpusAccess requiredAccess, String koralQuery, String definition,
+            String description, String status, boolean isCached,
+            String createdBy, String query, String queryLanguage)
+            throws KustvaktException {
 
         QueryDO q = new QueryDO();
         q.setName(name);
@@ -103,18 +103,17 @@
         if (status != null && !status.isEmpty()) {
             queryDO.setStatus(status);
         }
-        if(queryStr!=null && !queryStr.isEmpty()) {
+        if (queryStr != null && !queryStr.isEmpty()) {
             queryDO.setQuery(queryStr);
         }
-        if(queryLanguage!=null && !queryLanguage.isEmpty()) {
+        if (queryLanguage != null && !queryLanguage.isEmpty()) {
             queryDO.setQueryLanguage(queryLanguage);
         }
         queryDO.setCached(isCached);
         entityManager.merge(queryDO);
     }
 
-    public void deleteQuery (QueryDO query)
-            throws KustvaktException {
+    public void deleteQuery (QueryDO query) throws KustvaktException {
         if (!entityManager.contains(query)) {
             query = entityManager.merge(query);
         }
@@ -141,23 +140,23 @@
             String createdBy, QueryType queryType) throws KustvaktException {
 
         CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<QueryDO> criteriaQuery =
-                criteriaBuilder.createQuery(QueryDO.class);
+        CriteriaQuery<QueryDO> criteriaQuery = criteriaBuilder
+                .createQuery(QueryDO.class);
         Root<QueryDO> query = criteriaQuery.from(QueryDO.class);
 
         Predicate conditions = criteriaBuilder
                 .equal(query.get(QueryDO_.queryType), queryType);
         if (createdBy != null && !createdBy.isEmpty()) {
-            conditions = criteriaBuilder.and(conditions, criteriaBuilder.equal(
-                    query.get(QueryDO_.createdBy), createdBy));
+            conditions = criteriaBuilder.and(conditions, criteriaBuilder
+                    .equal(query.get(QueryDO_.createdBy), createdBy));
             if (type != null) {
-                conditions = criteriaBuilder.and(conditions, criteriaBuilder
-                        .equal(query.get(QueryDO_.type), type));
+                conditions = criteriaBuilder.and(conditions,
+                        criteriaBuilder.equal(query.get(QueryDO_.type), type));
             }
         }
         else if (type != null) {
-            conditions = criteriaBuilder.and(conditions, criteriaBuilder
-                    .equal(query.get(QueryDO_.type), type));
+            conditions = criteriaBuilder.and(conditions,
+                    criteriaBuilder.equal(query.get(QueryDO_.type), type));
         }
 
         criteriaQuery.select(query);
@@ -170,12 +169,11 @@
         ParameterChecker.checkIntegerValue(id, "id");
 
         CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<QueryDO> criteriaQuery =
-                criteriaBuilder.createQuery(QueryDO.class);
+        CriteriaQuery<QueryDO> criteriaQuery = criteriaBuilder
+                .createQuery(QueryDO.class);
         Root<QueryDO> query = criteriaQuery.from(QueryDO.class);
         criteriaQuery.select(query);
-        criteriaQuery.where(criteriaBuilder.equal(query.get(QueryDO_.id),
-                id));
+        criteriaQuery.where(criteriaBuilder.equal(query.get(QueryDO_.id), id));
 
         QueryDO qe = null;
         try {
@@ -196,14 +194,13 @@
         ParameterChecker.checkStringValue(queryName, "queryName");
 
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<QueryDO> criteriaQuery =
-                builder.createQuery(QueryDO.class);
+        CriteriaQuery<QueryDO> criteriaQuery = builder
+                .createQuery(QueryDO.class);
 
         Root<QueryDO> query = criteriaQuery.from(QueryDO.class);
 
         Predicate condition = builder.and(
-                builder.equal(query.get(QueryDO_.createdBy),
-                        createdBy),
+                builder.equal(query.get(QueryDO_.createdBy), createdBy),
                 builder.equal(query.get(QueryDO_.name), queryName));
 
         criteriaQuery.select(query);
@@ -228,20 +225,17 @@
     }
 
     @SuppressWarnings("unchecked")
-    public List<QueryDO> retrieveOwnerQuery (String userId,
-            QueryType queryType) throws KustvaktException {
+    public List<QueryDO> retrieveOwnerQuery (String userId, QueryType queryType)
+            throws KustvaktException {
         ParameterChecker.checkStringValue(userId, "userId");
 
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<QueryDO> cq =
-                builder.createQuery(QueryDO.class);
+        CriteriaQuery<QueryDO> cq = builder.createQuery(QueryDO.class);
 
         Root<QueryDO> query = cq.from(QueryDO.class);
         Predicate conditions = builder.and(
-                builder.equal(query.get(QueryDO_.createdBy),
-                        userId),
-                builder.equal(query.get(QueryDO_.queryType),
-                        queryType));
+                builder.equal(query.get(QueryDO_.createdBy), userId),
+                builder.equal(query.get(QueryDO_.queryType), queryType));
 
         cq.select(query);
         cq.where(conditions);
@@ -256,15 +250,13 @@
         ParameterChecker.checkStringValue(userId, "userId");
 
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<QueryDO> cq =
-                builder.createQuery(QueryDO.class);
+        CriteriaQuery<QueryDO> cq = builder.createQuery(QueryDO.class);
 
         Root<QueryDO> query = cq.from(QueryDO.class);
         cq.select(query);
 
         Predicate p = builder.and(
-                builder.equal(query.get(QueryDO_.createdBy),
-                        userId),
+                builder.equal(query.get(QueryDO_.createdBy), userId),
                 builder.equal(query.get(QueryDO_.type), type));
         cq.where(p);
 
@@ -273,17 +265,15 @@
     }
 
     @SuppressWarnings("unchecked")
-    public List<QueryDO> retrieveGroupQueryByUser (String userId, QueryType queryType)
-            throws KustvaktException {
+    public List<QueryDO> retrieveGroupQueryByUser (String userId,
+            QueryType queryType) throws KustvaktException {
         ParameterChecker.checkStringValue(userId, "userId");
 
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<QueryDO> cq =
-                builder.createQuery(QueryDO.class);
+        CriteriaQuery<QueryDO> cq = builder.createQuery(QueryDO.class);
 
         Root<QueryDO> query = cq.from(QueryDO.class);
-        Join<QueryDO, QueryAccess> access =
-                query.join(QueryDO_.queryAccess);
+        Join<QueryDO, QueryAccess> access = query.join(QueryDO_.queryAccess);
 
         // Predicate corpusStatus = builder.and(
         // builder.notEqual(access.get(QueryAccess_.status),
@@ -291,28 +281,27 @@
         // builder.notEqual(access.get(QueryAccess_.status),
         // VirtualCorpusAccessStatus.DELETED));
 
-        Predicate type = builder
-                .equal(query.get(QueryDO_.queryType), queryType);
-                
-        Predicate accessStatus =
-                builder.notEqual(access.get(QueryAccess_.status),
-                        QueryAccessStatus.DELETED);
+        Predicate type = builder.equal(query.get(QueryDO_.queryType),
+                queryType);
 
-        Predicate userGroupStatus =
-                builder.notEqual(access.get(QueryAccess_.userGroup)
-                        .get(UserGroup_.status), UserGroupStatus.DELETED);
+        Predicate accessStatus = builder.notEqual(
+                access.get(QueryAccess_.status), QueryAccessStatus.DELETED);
+
+        Predicate userGroupStatus = builder.notEqual(
+                access.get(QueryAccess_.userGroup).get(UserGroup_.status),
+                UserGroupStatus.DELETED);
         Join<UserGroup, UserGroupMember> members = access
                 .join(QueryAccess_.userGroup).join(UserGroup_.members);
 
         Predicate memberStatus = builder.equal(
                 members.get(UserGroupMember_.status), GroupMemberStatus.ACTIVE);
 
-        Predicate user =
-                builder.equal(members.get(UserGroupMember_.userId), userId);
+        Predicate user = builder.equal(members.get(UserGroupMember_.userId),
+                userId);
 
         cq.select(query);
-        cq.where(
-                builder.and(type, accessStatus, userGroupStatus, memberStatus, user));
+        cq.where(builder.and(type, accessStatus, userGroupStatus, memberStatus,
+                user));
 
         Query q = entityManager.createQuery(cq);
         return q.getResultList();
@@ -324,15 +313,13 @@
         ParameterChecker.checkObjectValue(queryType, "queryType");
 
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<QueryDO> criteriaQuery =
-                builder.createQuery(QueryDO.class);
+        CriteriaQuery<QueryDO> criteriaQuery = builder
+                .createQuery(QueryDO.class);
 
         Root<QueryDO> query = criteriaQuery.from(QueryDO.class);
         Predicate predicate = builder.and(
-                builder.equal(query.get(QueryDO_.queryType),
-                        queryType),
-                builder.or(builder.equal(
-                        query.get(QueryDO_.createdBy), userId),
+                builder.equal(query.get(QueryDO_.queryType), queryType),
+                builder.or(builder.equal(query.get(QueryDO_.createdBy), userId),
                         builder.equal(query.get(QueryDO_.type),
                                 ResourceType.SYSTEM)));
 
@@ -361,17 +348,18 @@
         ParameterChecker.checkIntegerValue(groupId, "groupId");
 
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<QueryDO> criteriaQuery =
-                builder.createQuery(QueryDO.class);
+        CriteriaQuery<QueryDO> criteriaQuery = builder
+                .createQuery(QueryDO.class);
 
         Root<QueryDO> query = criteriaQuery.from(QueryDO.class);
-        Join<QueryDO, QueryAccess> queryAccess =
-                query.join(QueryDO_.queryAccess);
-        Join<QueryAccess, UserGroup> accessGroup =
-                queryAccess.join(QueryAccess_.userGroup);
+        Join<QueryDO, QueryAccess> queryAccess = query
+                .join(QueryDO_.queryAccess);
+        Join<QueryAccess, UserGroup> accessGroup = queryAccess
+                .join(QueryAccess_.userGroup);
 
         criteriaQuery.select(query);
-        criteriaQuery.where(builder.equal(accessGroup.get(UserGroup_.id), groupId));
+        criteriaQuery
+                .where(builder.equal(accessGroup.get(UserGroup_.id), groupId));
         Query q = entityManager.createQuery(criteriaQuery);
         return q.getResultList();
     }
diff --git a/full/src/main/java/de/ids_mannheim/korap/dao/ResourceDao.java b/full/src/main/java/de/ids_mannheim/korap/dao/ResourceDao.java
index 002d4ea..c121669 100644
--- a/full/src/main/java/de/ids_mannheim/korap/dao/ResourceDao.java
+++ b/full/src/main/java/de/ids_mannheim/korap/dao/ResourceDao.java
@@ -40,8 +40,8 @@
      */
     public List<Resource> getAllResources () {
         CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<Resource> query =
-                criteriaBuilder.createQuery(Resource.class);
+        CriteriaQuery<Resource> query = criteriaBuilder
+                .createQuery(Resource.class);
         Root<Resource> resource = query.from(Resource.class);
         query.select(resource);
 
@@ -51,8 +51,8 @@
 
     public Resource retrieveResource (String id) {
         CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<Resource> query =
-                criteriaBuilder.createQuery(Resource.class);
+        CriteriaQuery<Resource> query = criteriaBuilder
+                .createQuery(Resource.class);
         Root<Resource> resource = query.from(Resource.class);
         query.select(resource);
         query.where(criteriaBuilder.equal(resource.get(Resource_.id), id));
diff --git a/full/src/main/java/de/ids_mannheim/korap/dao/RoleDao.java b/full/src/main/java/de/ids_mannheim/korap/dao/RoleDao.java
index 47ddd18..5481d30 100644
--- a/full/src/main/java/de/ids_mannheim/korap/dao/RoleDao.java
+++ b/full/src/main/java/de/ids_mannheim/korap/dao/RoleDao.java
@@ -87,8 +87,8 @@
         CriteriaQuery<Role> query = criteriaBuilder.createQuery(Role.class);
 
         Root<Role> root = query.from(Role.class);
-        ListJoin<Role, UserGroupMember> memberRole =
-                root.join(Role_.userGroupMembers);
+        ListJoin<Role, UserGroupMember> memberRole = root
+                .join(Role_.userGroupMembers);
 
         query.select(root);
         query.where(criteriaBuilder.equal(memberRole.get(UserGroupMember_.id),
diff --git a/full/src/main/java/de/ids_mannheim/korap/dao/UserDao.java b/full/src/main/java/de/ids_mannheim/korap/dao/UserDao.java
index 51ab9c1..61c24af 100644
--- a/full/src/main/java/de/ids_mannheim/korap/dao/UserDao.java
+++ b/full/src/main/java/de/ids_mannheim/korap/dao/UserDao.java
@@ -5,7 +5,8 @@
 import de.ids_mannheim.korap.user.KorAPUser;
 import de.ids_mannheim.korap.user.User;
 
-/** Dummy DAO for testing using basic authentication.
+/**
+ * Dummy DAO for testing using basic authentication.
  * 
  * @author margaretha
  *
@@ -19,5 +20,4 @@
         return user;
     }
 
-
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/dao/UserGroupDao.java b/full/src/main/java/de/ids_mannheim/korap/dao/UserGroupDao.java
index 82ec01e..8a91e9c 100644
--- a/full/src/main/java/de/ids_mannheim/korap/dao/UserGroupDao.java
+++ b/full/src/main/java/de/ids_mannheim/korap/dao/UserGroupDao.java
@@ -55,8 +55,8 @@
     @Autowired
     private RoleDao roleDao;
 
-    public int createGroup (String name, String description,
-            String createdBy, UserGroupStatus status) throws KustvaktException {
+    public int createGroup (String name, String description, String createdBy,
+            UserGroupStatus status) throws KustvaktException {
         ParameterChecker.checkStringValue(name, "name");
         ParameterChecker.checkStringValue(createdBy, "createdBy");
         ParameterChecker.checkObjectValue(status, "UserGroupStatus");
@@ -117,7 +117,7 @@
         ParameterChecker.checkObjectValue(group, "user-group");
         entityManager.merge(group);
     }
-    
+
     /**
      * Retrieves the UserGroup by the given group id. This methods
      * does not
@@ -140,8 +140,8 @@
         ParameterChecker.checkIntegerValue(groupId, "groupId");
 
         CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<UserGroup> query =
-                criteriaBuilder.createQuery(UserGroup.class);
+        CriteriaQuery<UserGroup> query = criteriaBuilder
+                .createQuery(UserGroup.class);
 
         Root<UserGroup> root = query.from(UserGroup.class);
         if (fetchMembers) {
@@ -176,13 +176,13 @@
         ParameterChecker.checkStringValue(userId, "userId");
 
         CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<UserGroup> query =
-                criteriaBuilder.createQuery(UserGroup.class);
+        CriteriaQuery<UserGroup> query = criteriaBuilder
+                .createQuery(UserGroup.class);
 
         Root<UserGroup> root = query.from(UserGroup.class);
 
-        ListJoin<UserGroup, UserGroupMember> members =
-                root.join(UserGroup_.members);
+        ListJoin<UserGroup, UserGroupMember> members = root
+                .join(UserGroup_.members);
         Predicate restrictions = criteriaBuilder.and(
                 criteriaBuilder.equal(root.get(UserGroup_.status),
                         UserGroupStatus.ACTIVE),
@@ -207,13 +207,13 @@
         }
     }
 
-    public UserGroup retrieveGroupByName (String groupName, boolean fetchMembers)
-            throws KustvaktException {
+    public UserGroup retrieveGroupByName (String groupName,
+            boolean fetchMembers) throws KustvaktException {
         ParameterChecker.checkStringValue(groupName, "groupName");
 
         CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<UserGroup> query =
-                criteriaBuilder.createQuery(UserGroup.class);
+        CriteriaQuery<UserGroup> query = criteriaBuilder
+                .createQuery(UserGroup.class);
 
         Root<UserGroup> root = query.from(UserGroup.class);
         if (fetchMembers) {
@@ -238,14 +238,12 @@
         ParameterChecker.checkIntegerValue(queryId, "queryId");
 
         CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<UserGroup> criteriaQuery =
-                criteriaBuilder.createQuery(UserGroup.class);
+        CriteriaQuery<UserGroup> criteriaQuery = criteriaBuilder
+                .createQuery(UserGroup.class);
 
         Root<UserGroup> root = criteriaQuery.from(UserGroup.class);
-        Join<UserGroup, QueryAccess> access =
-                root.join(UserGroup_.queryAccess);
-        Join<QueryAccess, QueryDO> query =
-                access.join(QueryAccess_.query);
+        Join<UserGroup, QueryAccess> access = root.join(UserGroup_.queryAccess);
+        Join<QueryAccess, QueryDO> query = access.join(QueryAccess_.query);
 
         Predicate p = criteriaBuilder.and(
                 criteriaBuilder.equal(root.get(UserGroup_.status),
@@ -283,8 +281,8 @@
             UserGroupStatus status) throws KustvaktException {
 
         CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<UserGroup> query =
-                criteriaBuilder.createQuery(UserGroup.class);
+        CriteriaQuery<UserGroup> query = criteriaBuilder
+                .createQuery(UserGroup.class);
 
         Root<UserGroup> root = query.from(UserGroup.class);
 
@@ -292,8 +290,8 @@
 
         if (userId != null && !userId.isEmpty()) {
 
-            ListJoin<UserGroup, UserGroupMember> members =
-                    root.join(UserGroup_.members);
+            ListJoin<UserGroup, UserGroupMember> members = root
+                    .join(UserGroup_.members);
             restrictions = criteriaBuilder.and(criteriaBuilder
                     .equal(members.get(UserGroupMember_.userId), userId));
 
@@ -303,8 +301,8 @@
             }
         }
         else if (status != null) {
-            restrictions =
-                    criteriaBuilder.equal(root.get(UserGroup_.status), status);
+            restrictions = criteriaBuilder.equal(root.get(UserGroup_.status),
+                    status);
 
         }
 
@@ -335,9 +333,8 @@
         entityManager.persist(accessGroup);
     }
 
-    public void addQueryToGroup (List<QueryDO> queries,
-            String createdBy, UserGroup group,
-            QueryAccessStatus status) {
+    public void addQueryToGroup (List<QueryDO> queries, String createdBy,
+            UserGroup group, QueryAccessStatus status) {
 
         for (QueryDO q : queries) {
             addQueryToGroup(q, createdBy, status, group);
@@ -350,25 +347,22 @@
         ParameterChecker.checkIntegerValue(groupId, "groupId");
 
         CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<QueryAccess> criteriaQuery =
-                criteriaBuilder.createQuery(QueryAccess.class);
+        CriteriaQuery<QueryAccess> criteriaQuery = criteriaBuilder
+                .createQuery(QueryAccess.class);
 
         Root<QueryAccess> root = criteriaQuery.from(QueryAccess.class);
-        Join<QueryAccess, QueryDO> queryAccess =
-                root.join(QueryAccess_.query);
-        Join<QueryAccess, UserGroup> group =
-                root.join(QueryAccess_.userGroup);
+        Join<QueryAccess, QueryDO> queryAccess = root.join(QueryAccess_.query);
+        Join<QueryAccess, UserGroup> group = root.join(QueryAccess_.userGroup);
 
-        Predicate query = criteriaBuilder
-                .equal(queryAccess.get(QueryDO_.id), queryId);
-        Predicate userGroup =
-                criteriaBuilder.equal(group.get(UserGroup_.id), groupId);
+        Predicate query = criteriaBuilder.equal(queryAccess.get(QueryDO_.id),
+                queryId);
+        Predicate userGroup = criteriaBuilder.equal(group.get(UserGroup_.id),
+                groupId);
 
         criteriaQuery.select(root);
         criteriaQuery.where(criteriaBuilder.and(query, userGroup));
         Query q = entityManager.createQuery(criteriaQuery);
-        QueryAccess access =
-                (QueryAccess) q.getSingleResult();
+        QueryAccess access = (QueryAccess) q.getSingleResult();
         entityManager.remove(access);
     }
 
diff --git a/full/src/main/java/de/ids_mannheim/korap/dao/UserGroupMemberDao.java b/full/src/main/java/de/ids_mannheim/korap/dao/UserGroupMemberDao.java
index 7fe96c5..c399fd6 100644
--- a/full/src/main/java/de/ids_mannheim/korap/dao/UserGroupMemberDao.java
+++ b/full/src/main/java/de/ids_mannheim/korap/dao/UserGroupMemberDao.java
@@ -78,8 +78,8 @@
         ParameterChecker.checkIntegerValue(groupId, "groupId");
 
         CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<UserGroupMember> query =
-                criteriaBuilder.createQuery(UserGroupMember.class);
+        CriteriaQuery<UserGroupMember> query = criteriaBuilder
+                .createQuery(UserGroupMember.class);
 
         Root<UserGroupMember> root = query.from(UserGroupMember.class);
 
@@ -110,8 +110,8 @@
         ParameterChecker.checkIntegerValue(groupId, "groupId");
 
         CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<UserGroupMember> query =
-                criteriaBuilder.createQuery(UserGroupMember.class);
+        CriteriaQuery<UserGroupMember> query = criteriaBuilder
+                .createQuery(UserGroupMember.class);
 
         Root<UserGroupMember> root = query.from(UserGroupMember.class);
         Join<UserGroupMember, Role> memberRole = root.join("roles");
@@ -146,8 +146,8 @@
     public List<UserGroupMember> retrieveMemberByGroupId (int groupId,
             boolean isAdmin) throws KustvaktException {
         CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<UserGroupMember> query =
-                criteriaBuilder.createQuery(UserGroupMember.class);
+        CriteriaQuery<UserGroupMember> query = criteriaBuilder
+                .createQuery(UserGroupMember.class);
 
         Root<UserGroupMember> root = query.from(UserGroupMember.class);
 
@@ -169,7 +169,7 @@
         }
         catch (NoResultException e) {
             throw new KustvaktException(StatusCodes.NO_RESULT_FOUND,
-                    "No member in group " + groupId+" is found",
+                    "No member in group " + groupId + " is found",
                     String.valueOf(groupId));
         }
     }
diff --git a/full/src/main/java/de/ids_mannheim/korap/dto/FoundryDto.java b/full/src/main/java/de/ids_mannheim/korap/dto/FoundryDto.java
index c8f68b5..beb344c 100644
--- a/full/src/main/java/de/ids_mannheim/korap/dto/FoundryDto.java
+++ b/full/src/main/java/de/ids_mannheim/korap/dto/FoundryDto.java
@@ -30,7 +30,7 @@
     @Getter
     @Setter
     @JsonInclude(Include.NON_EMPTY)
-//    @JsonSerialize(include=Inclusion.NON_EMPTY) // old codehouse annotation used by jersey
+    //    @JsonSerialize(include=Inclusion.NON_EMPTY) // old codehouse annotation used by jersey
     public class Layer {
         private String code;
         private String description;
@@ -40,8 +40,8 @@
     @Getter
     @Setter
     @JsonInclude(Include.NON_EMPTY)
-//    @JsonSerialize(include=Inclusion.NON_EMPTY) // old codehouse annotation used by jersey
-    public class Key implements Comparable<Key>{
+    //    @JsonSerialize(include=Inclusion.NON_EMPTY) // old codehouse annotation used by jersey
+    public class Key implements Comparable<Key> {
 
         private String code;
         private String description;
@@ -50,10 +50,10 @@
         public Key (String code) {
             this.code = code;
         }
-        
+
         @Override
         public int compareTo (Key k) {
-            return this.code.compareTo(k.code); 
+            return this.code.compareTo(k.code);
         }
     }
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/dto/InstalledPluginDto.java b/full/src/main/java/de/ids_mannheim/korap/dto/InstalledPluginDto.java
index eb17a8e..ac31ba0 100644
--- a/full/src/main/java/de/ids_mannheim/korap/dto/InstalledPluginDto.java
+++ b/full/src/main/java/de/ids_mannheim/korap/dto/InstalledPluginDto.java
@@ -24,7 +24,7 @@
     private String redirectUri;
     @JsonProperty("installed_date")
     private String installedDate;
-    
+
     public InstalledPluginDto (InstalledPlugin plugin) {
         OAuth2Client client = plugin.getClient();
         setClientId(client.getId());
diff --git a/full/src/main/java/de/ids_mannheim/korap/dto/QueryAccessDto.java b/full/src/main/java/de/ids_mannheim/korap/dto/QueryAccessDto.java
index 9687317..84b8b3f 100644
--- a/full/src/main/java/de/ids_mannheim/korap/dto/QueryAccessDto.java
+++ b/full/src/main/java/de/ids_mannheim/korap/dto/QueryAccessDto.java
@@ -22,8 +22,9 @@
 
     @Override
     public String toString () {
-        return "accessId=" + accessId + ", createdBy=" + createdBy + " , queryId="
-                + queryId + ", queryName=" + queryName + ", userGroupId=" + userGroupId
-                + ", userGroupName=" + userGroupName;
+        return "accessId=" + accessId + ", createdBy=" + createdBy
+                + " , queryId=" + queryId + ", queryName=" + queryName
+                + ", userGroupId=" + userGroupId + ", userGroupName="
+                + userGroupName;
     }
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/dto/QueryDto.java b/full/src/main/java/de/ids_mannheim/korap/dto/QueryDto.java
index fe221cf..6d31fd6 100644
--- a/full/src/main/java/de/ids_mannheim/korap/dto/QueryDto.java
+++ b/full/src/main/java/de/ids_mannheim/korap/dto/QueryDto.java
@@ -8,8 +8,9 @@
 import lombok.Getter;
 import lombok.Setter;
 
-/** Defines the structure of {@link QueryDO} description to be 
- *  sent as JSON objects in HTTP responses. 
+/**
+ * Defines the structure of {@link QueryDO} description to be
+ * sent as JSON objects in HTTP responses.
  * 
  * @author margaretha
  *
@@ -26,12 +27,12 @@
     private String description;
     private String requiredAccess;
     private String createdBy;
-    
+
     private int numberOfDoc;
     private int numberOfParagraphs;
     private int numberOfSentences;
     private int numberOfTokens;
-    
+
     private String query;
     private String queryLanguage;
     private JsonNode koralQuery;
diff --git a/full/src/main/java/de/ids_mannheim/korap/dto/UserGroupDto.java b/full/src/main/java/de/ids_mannheim/korap/dto/UserGroupDto.java
index a2b2732..273d52e 100644
--- a/full/src/main/java/de/ids_mannheim/korap/dto/UserGroupDto.java
+++ b/full/src/main/java/de/ids_mannheim/korap/dto/UserGroupDto.java
@@ -9,8 +9,9 @@
 import lombok.Getter;
 import lombok.Setter;
 
-/** Defines the structure of UserGroup description, e.g.
- *  to be sent as JSON objects in HTTP response. 
+/**
+ * Defines the structure of UserGroup description, e.g.
+ * to be sent as JSON objects in HTTP response.
  * 
  * @author margaretha
  *
@@ -24,10 +25,10 @@
     private String description;
     private String owner;
     private UserGroupStatus status;
-    
+
     @JsonInclude(JsonInclude.Include.NON_EMPTY)
     private List<UserGroupMemberDto> members;
-    
+
     private GroupMemberStatus userMemberStatus;
     private List<String> userRoles;
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/dto/UserGroupMemberDto.java b/full/src/main/java/de/ids_mannheim/korap/dto/UserGroupMemberDto.java
index bf3cfea..23cfa3d 100644
--- a/full/src/main/java/de/ids_mannheim/korap/dto/UserGroupMemberDto.java
+++ b/full/src/main/java/de/ids_mannheim/korap/dto/UserGroupMemberDto.java
@@ -6,8 +6,10 @@
 import lombok.Getter;
 import lombok.Setter;
 
-/** Defines UserGroupMember description, e.g. to be sent as 
- *  JSON objects in HTTP Responses.
+/**
+ * Defines UserGroupMember description, e.g. to be sent as
+ * JSON objects in HTTP Responses.
+ * 
  * @author margaretha
  *
  */
diff --git a/full/src/main/java/de/ids_mannheim/korap/dto/converter/AnnotationConverter.java b/full/src/main/java/de/ids_mannheim/korap/dto/converter/AnnotationConverter.java
index b192cfd..a1cc536 100644
--- a/full/src/main/java/de/ids_mannheim/korap/dto/converter/AnnotationConverter.java
+++ b/full/src/main/java/de/ids_mannheim/korap/dto/converter/AnnotationConverter.java
@@ -94,7 +94,7 @@
                 for (AnnotationKey ak : f.getKeys()) {
                     Annotation a = ak.getKey();
                     Map<String, String> values = new TreeMap<>();
-                    
+
                     Key key = dto.new Key(a.getCode());
                     if (language.equals("de")) {
                         key.setDescription(a.getGermanDescription());
@@ -136,16 +136,14 @@
 
     private Map<String, List<AnnotationLayer>> createFoundryMap (
             List<AnnotationLayer> pairs) {
-        Map<String, List<AnnotationLayer>> foundries =
-                new HashMap<String, List<AnnotationLayer>>();
+        Map<String, List<AnnotationLayer>> foundries = new HashMap<String, List<AnnotationLayer>>();
         for (AnnotationLayer p : pairs) {
             String foundryCode = p.getFoundry().getCode();
             if (foundries.containsKey(foundryCode)) {
                 foundries.get(foundryCode).add(p);
             }
             else {
-                List<AnnotationLayer> foundryList =
-                        new ArrayList<AnnotationLayer>();
+                List<AnnotationLayer> foundryList = new ArrayList<AnnotationLayer>();
                 foundryList.add(p);
                 foundries.put(foundryCode, foundryList);
             }
diff --git a/full/src/main/java/de/ids_mannheim/korap/dto/converter/ResourceConverter.java b/full/src/main/java/de/ids_mannheim/korap/dto/converter/ResourceConverter.java
index b4ff8eb..d04576c 100644
--- a/full/src/main/java/de/ids_mannheim/korap/dto/converter/ResourceConverter.java
+++ b/full/src/main/java/de/ids_mannheim/korap/dto/converter/ResourceConverter.java
@@ -23,8 +23,8 @@
 public class ResourceConverter {
 
     public List<ResourceDto> convertToResourcesDto (List<Resource> resources) {
-        List<ResourceDto> resourceDtoList =
-                new ArrayList<ResourceDto>(resources.size());
+        List<ResourceDto> resourceDtoList = new ArrayList<ResourceDto>(
+                resources.size());
         ResourceDto dto;
         Map<String, String> titles;
         HashMap<Integer, String> layers;
diff --git a/full/src/main/java/de/ids_mannheim/korap/dto/converter/UserGroupConverter.java b/full/src/main/java/de/ids_mannheim/korap/dto/converter/UserGroupConverter.java
index cf5878f..706cc21 100644
--- a/full/src/main/java/de/ids_mannheim/korap/dto/converter/UserGroupConverter.java
+++ b/full/src/main/java/de/ids_mannheim/korap/dto/converter/UserGroupConverter.java
@@ -43,8 +43,8 @@
         }
 
         if (members != null) {
-            ArrayList<UserGroupMemberDto> memberDtos =
-                    new ArrayList<>(members.size());
+            ArrayList<UserGroupMemberDto> memberDtos = new ArrayList<>(
+                    members.size());
             for (UserGroupMember member : members) {
 
                 UserGroupMemberDto memberDto = new UserGroupMemberDto();
diff --git a/full/src/main/java/de/ids_mannheim/korap/encryption/DefaultEncryption.java b/full/src/main/java/de/ids_mannheim/korap/encryption/DefaultEncryption.java
index aaee8d2..6792ff3 100644
--- a/full/src/main/java/de/ids_mannheim/korap/encryption/DefaultEncryption.java
+++ b/full/src/main/java/de/ids_mannheim/korap/encryption/DefaultEncryption.java
@@ -17,56 +17,47 @@
 
     private SecureRandom randomizer;
 
-
     public DefaultEncryption () {
         randomizer = new SecureRandom();
     }
 
-
     @Override
     public String secureHash (String input, String salt)
             throws KustvaktException {
         return null;
     }
 
-
     @Override
     public String secureHash (String input) {
         return null;
     }
 
-
     @Override
     public boolean checkHash (String plain, String hash, String salt) {
         return false;
     }
 
-
     @Override
     public boolean checkHash (String plain, String hash) {
         return false;
     }
 
-
     @Override
     public String createToken (boolean hash, Object ... obj) {
         return createToken();
 
     }
 
-
     @Override
     public String createToken () {
         return new BigInteger(100, randomizer).toString(20);
     }
 
-
     @Override
     public String createRandomNumber (Object ... obj) {
         return createToken();
     }
 
-
     @Override
     public String encodeBase () {
         return null;
diff --git a/full/src/main/java/de/ids_mannheim/korap/encryption/KustvaktEncryption.java b/full/src/main/java/de/ids_mannheim/korap/encryption/KustvaktEncryption.java
index 211e6e5..610f69c 100644
--- a/full/src/main/java/de/ids_mannheim/korap/encryption/KustvaktEncryption.java
+++ b/full/src/main/java/de/ids_mannheim/korap/encryption/KustvaktEncryption.java
@@ -18,18 +18,15 @@
 public class KustvaktEncryption implements EncryptionIface {
 
     private static final String ALGORITHM = "SHA-256";
-    private static Logger jlog = LogManager
-            .getLogger(KustvaktEncryption.class);
+    private static Logger jlog = LogManager.getLogger(KustvaktEncryption.class);
 
     private final FullConfiguration config;
 
-
     public KustvaktEncryption (FullConfiguration config) {
         jlog.info("initializing KorAPEncryption implementation");
         this.config = config;
     }
 
-
     public static boolean matchTokenByteCode (Object param) {
         if (!(param instanceof String))
             return false;
@@ -38,12 +35,10 @@
         return 64 == bytes.length;
     }
 
-
     private String encodeBase (byte[] bytes) throws EncoderException {
         return Base64.encodeBase64String(bytes);
     }
 
-
     @Override
     public String encodeBase () {
         try {
@@ -54,12 +49,10 @@
         }
     }
 
-
     public String secureHash (String input) {
         return secureHash(input, "");
     }
 
-
     @Override
     public String secureHash (String input, String salt) {
         String hashString = "";
@@ -75,7 +68,8 @@
                     for (byte b : digest)
                         hashString += String.format("%02x", b);
                 }
-                catch (UnsupportedEncodingException | NoSuchAlgorithmException e) {
+                catch (UnsupportedEncodingException
+                        | NoSuchAlgorithmException e) {
                     e.printStackTrace();
                 }
                 break;
@@ -83,14 +77,12 @@
                 hashString = bcryptHash(input, salt);
                 break;
             default:
-                jlog.warn("Invalid value: "+ config.getSecureHashAlgorithm());
+                jlog.warn("Invalid value: " + config.getSecureHashAlgorithm());
                 break;
         }
         return hashString;
     }
 
-
-
     public String hash (String input) {
         String hashString = "";
         MessageDigest md;
@@ -113,7 +105,6 @@
         return hashString;
     }
 
-
     /**
      * // some sort of algorithm to create token and isSystem
      * regularly the integrity
@@ -136,9 +127,9 @@
         return SecureRGenerator.getNextSecureRandom(size);
     }
 
-
     /**
      * does this need to be equal for every iteration?!
+     * 
      * @param hash
      * @param obj
      * @return
@@ -162,19 +153,17 @@
 
     }
 
-
     @Override
     public String createToken () {
         return RandomStringUtils.randomAlphanumeric(64);
-        
-        // EM: code from MH
-//        String encoded;
-//        String v = RandomStringUtils.randomAlphanumeric(64);
-//        encoded = hash(v);
-//        jlog.trace("creating new token {}", encoded);
-//        return encoded;
-    }
 
+        // EM: code from MH
+        //        String encoded;
+        //        String v = RandomStringUtils.randomAlphanumeric(64);
+        //        encoded = hash(v);
+        //        jlog.trace("creating new token {}", encoded);
+        //        return encoded;
+    }
 
     @Override
     public String createRandomNumber (Object ... obj) {
@@ -187,7 +176,6 @@
         return createToken(false, obj);
     }
 
-
     @Override
     public boolean checkHash (String plain, String hash, String salt) {
         String pw = "";
@@ -209,7 +197,6 @@
         return pw.equals(hash);
     }
 
-
     @Override
     public boolean checkHash (String plain, String hash) {
         switch (config.getSecureHashAlgorithm()) {
@@ -228,14 +215,12 @@
         return false;
     }
 
-
     private String bcryptHash (String text, String salt) {
         if (salt == null || salt.isEmpty())
             salt = BCrypt.gensalt(config.getLoadFactor());
         return BCrypt.hashpw(text, salt);
     }
 
-
     @Override
     public String toString () {
         return this.getClass().getCanonicalName();
@@ -248,8 +233,8 @@
         protected static final int ID_RANDOM_SIZE = 128;
         protected static final int CORPUS_RANDOM_SIZE = 64;
         private static final char[] HEX_DIGIT = { '0', '1', '2', '3', '4', '5',
-                '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'z', 'x',
-                'h', 'q', 'w' };
+                '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'z', 'x', 'h',
+                'q', 'w' };
         private static final SecureRandom sRandom__;
 
         static {
@@ -261,7 +246,6 @@
             }
         }
 
-
         public static byte[] getNextSecureRandom (int bits) {
             if (bits % 8 != 0) {
                 throw new IllegalArgumentException(
@@ -275,7 +259,6 @@
             return bytes;
         }
 
-
         public static String toHex (byte[] bytes) {
             if (bytes == null) {
                 return null;
@@ -289,7 +272,6 @@
             return buffer.toString();
         }
 
-
         private static String byteToHex (byte b) {
             char[] array = { HEX_DIGIT[(b >> 4 & 0xF)], HEX_DIGIT[(b & 0xF)] };
             return new String(array);
diff --git a/full/src/main/java/de/ids_mannheim/korap/encryption/RandomCodeGenerator.java b/full/src/main/java/de/ids_mannheim/korap/encryption/RandomCodeGenerator.java
index fe7bab7..e6ff6e0 100644
--- a/full/src/main/java/de/ids_mannheim/korap/encryption/RandomCodeGenerator.java
+++ b/full/src/main/java/de/ids_mannheim/korap/encryption/RandomCodeGenerator.java
@@ -35,13 +35,13 @@
     public static List<Character> charList = alphanumeric.chars()
             .mapToObj(c -> (char) c).collect(Collectors.toList());
 
-    public final static List<String> LIMITED_CHARACTERS =
-            Arrays.asList(new String[] { "3", "4", "6", "7", "9", "b", "d", "f",
-                    "h", "m", "n", "p", "r", "t", "F", "G", "H", "J", "L", "M",
-                    "N", "P", "R", "T" });
+    public final static List<String> LIMITED_CHARACTERS = Arrays
+            .asList(new String[] { "3", "4", "6", "7", "9", "b", "d", "f", "h",
+                    "m", "n", "p", "r", "t", "F", "G", "H", "J", "L", "M", "N",
+                    "P", "R", "T" });
 
     private Logger log = LogManager.getLogger(RandomCodeGenerator.class);
-    
+
     @Autowired
     public KustvaktConfiguration config;
 
@@ -56,8 +56,7 @@
         else {
             secureRandom = new SecureRandom();
         }
-        log.info(
-                "Secure random algorithm: " + secureRandom.getAlgorithm());
+        log.info("Secure random algorithm: " + secureRandom.getAlgorithm());
     }
 
     public String createRandomCode (KustvaktConfiguration c)
@@ -95,8 +94,7 @@
         StringBuffer s = new StringBuffer();
         for (char c : code.toCharArray()) {
             if (!charList.contains(c)) {
-                int n = ThreadLocalRandom.current().nextInt(0,
-                        charList.size());
+                int n = ThreadLocalRandom.current().nextInt(0, charList.size());
                 c = charList.get(n);
             }
             s.append(c);
diff --git a/full/src/main/java/de/ids_mannheim/korap/entity/Admin.java b/full/src/main/java/de/ids_mannheim/korap/entity/Admin.java
index 66a90aa..b0cbed9 100644
--- a/full/src/main/java/de/ids_mannheim/korap/entity/Admin.java
+++ b/full/src/main/java/de/ids_mannheim/korap/entity/Admin.java
@@ -10,7 +10,8 @@
 import lombok.Getter;
 import lombok.Setter;
 
-/** Describes admin users
+/**
+ * Describes admin users
  * 
  * @author margaretha
  *
diff --git a/full/src/main/java/de/ids_mannheim/korap/entity/InstalledPlugin.java b/full/src/main/java/de/ids_mannheim/korap/entity/InstalledPlugin.java
index efc0a01..12e19ce 100644
--- a/full/src/main/java/de/ids_mannheim/korap/entity/InstalledPlugin.java
+++ b/full/src/main/java/de/ids_mannheim/korap/entity/InstalledPlugin.java
@@ -20,7 +20,7 @@
 @Getter
 @Entity
 @Table(name = "installed_plugin")
-public class InstalledPlugin implements Comparable<InstalledPlugin>{
+public class InstalledPlugin implements Comparable<InstalledPlugin> {
 
     @Id
     @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -29,11 +29,11 @@
     private String installedBy;
     @Column(name = "installed_date")
     private ZonedDateTime installedDate;
-    
+
     @ManyToOne(fetch = FetchType.EAGER)
     @JoinColumn(name = "client_id")
     private OAuth2Client client;
-    
+
     // where a plugin is installed
     @ManyToOne(fetch = FetchType.LAZY)
     @JoinColumn(name = "super_client_id")
diff --git a/full/src/main/java/de/ids_mannheim/korap/entity/QueryAccess.java b/full/src/main/java/de/ids_mannheim/korap/entity/QueryAccess.java
index b0c0c29..42c7968 100644
--- a/full/src/main/java/de/ids_mannheim/korap/entity/QueryAccess.java
+++ b/full/src/main/java/de/ids_mannheim/korap/entity/QueryAccess.java
@@ -16,9 +16,10 @@
 import lombok.Getter;
 import lombok.Setter;
 
-/** Describes the relationship between virtual corpora and user groups, 
- *  i.e. which groups may access which virtual corpora, and the history 
- *  of group-access management.  
+/**
+ * Describes the relationship between virtual corpora and user groups,
+ * i.e. which groups may access which virtual corpora, and the history
+ * of group-access management.
  * 
  * @author margaretha
  * @see QueryDO
@@ -51,10 +52,8 @@
     @JoinColumn(name = "user_group_id", referencedColumnName = "id")
     private UserGroup userGroup;
 
-
     @Override
     public String toString () {
-        return "id=" + id + ", query= " + query
-                + ", userGroup= " + userGroup;
+        return "id=" + id + ", query= " + query + ", userGroup= " + userGroup;
     }
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/entity/QueryDO.java b/full/src/main/java/de/ids_mannheim/korap/entity/QueryDO.java
index 4c1b09e..77d8102 100644
--- a/full/src/main/java/de/ids_mannheim/korap/entity/QueryDO.java
+++ b/full/src/main/java/de/ids_mannheim/korap/entity/QueryDO.java
@@ -56,7 +56,7 @@
     private String createdBy;
     @Column(name = "is_cached")
     private boolean isCached;
-    
+
     @Enumerated(EnumType.STRING)
     @Column(name = "query_type")
     private QueryType queryType;
@@ -64,8 +64,7 @@
     @Column(name = "query_language")
     private String queryLanguage;
 
-    @OneToMany(mappedBy = "query", fetch = FetchType.LAZY,
-            cascade = CascadeType.REMOVE)
+    @OneToMany(mappedBy = "query", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE)
     private List<QueryAccess> queryAccess;
 
     @Override
diff --git a/full/src/main/java/de/ids_mannheim/korap/entity/Role.java b/full/src/main/java/de/ids_mannheim/korap/entity/Role.java
index 43e1770..f096c80 100644
--- a/full/src/main/java/de/ids_mannheim/korap/entity/Role.java
+++ b/full/src/main/java/de/ids_mannheim/korap/entity/Role.java
@@ -37,8 +37,7 @@
     @ManyToMany(mappedBy = "roles", fetch = FetchType.LAZY)
     private List<UserGroupMember> userGroupMembers;
 
-    @OneToMany(mappedBy = "role", fetch = FetchType.EAGER,
-            cascade = CascadeType.REMOVE)
+    @OneToMany(mappedBy = "role", fetch = FetchType.EAGER, cascade = CascadeType.REMOVE)
     private List<Privilege> privileges;
 
     public String toString () {
@@ -64,7 +63,7 @@
         }
         return false;
     }
-    
+
     @Override
     public int hashCode () {
         int hash = 7;
diff --git a/full/src/main/java/de/ids_mannheim/korap/entity/UserGroup.java b/full/src/main/java/de/ids_mannheim/korap/entity/UserGroup.java
index 74f0beb..9a7db7d 100644
--- a/full/src/main/java/de/ids_mannheim/korap/entity/UserGroup.java
+++ b/full/src/main/java/de/ids_mannheim/korap/entity/UserGroup.java
@@ -50,12 +50,10 @@
     @Enumerated(EnumType.STRING)
     private UserGroupStatus status;
 
-    @OneToMany(mappedBy = "group", fetch = FetchType.LAZY,
-            cascade = CascadeType.REMOVE)
+    @OneToMany(mappedBy = "group", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE)
     private List<UserGroupMember> members;
 
-    @OneToMany(mappedBy = "userGroup", fetch = FetchType.LAZY,
-            cascade = CascadeType.REMOVE)
+    @OneToMany(mappedBy = "userGroup", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE)
     private List<QueryAccess> queryAccess;
 
     @Override
diff --git a/full/src/main/java/de/ids_mannheim/korap/entity/UserGroupMember.java b/full/src/main/java/de/ids_mannheim/korap/entity/UserGroupMember.java
index 760277c..e1cc3e5 100644
--- a/full/src/main/java/de/ids_mannheim/korap/entity/UserGroupMember.java
+++ b/full/src/main/java/de/ids_mannheim/korap/entity/UserGroupMember.java
@@ -24,19 +24,20 @@
 import lombok.Getter;
 import lombok.Setter;
 
-/** Describes members of user groups. Only member of predefined role 
- *  group admin can see the rest of members.
+/**
+ * Describes members of user groups. Only member of predefined role
+ * group admin can see the rest of members.
  * 
- *  @author margaretha
- *  @see UserGroup
- *  @see Role
- *  @see PredefinedRole
+ * @author margaretha
+ * @see UserGroup
+ * @see Role
+ * @see PredefinedRole
  */
 @Setter
 @Getter
 @Entity
-@Table(name = "user_group_member",
-        indexes = { @Index(unique = true, columnList = "user_id, group_id") })
+@Table(name = "user_group_member", indexes = {
+        @Index(unique = true, columnList = "user_id, group_id") })
 public class UserGroupMember {
 
     @Id
@@ -48,7 +49,7 @@
     private String createdBy;
     @Column(name = "deleted_by")
     private String deletedBy;
-    
+
     // auto update in the database
     @Column(name = "status_date")
     private ZonedDateTime statusDate;
@@ -60,17 +61,14 @@
     @JoinColumn(name = "group_id")
     private UserGroup group;
 
-    /** Information about roles is deemed to be always necessary to describe a member.
+    /**
+     * Information about roles is deemed to be always necessary to
+     * describe a member.
      * 
      */
     @ManyToMany(fetch = FetchType.EAGER)
-    @JoinTable(name = "group_member_role",
-            joinColumns = @JoinColumn(name = "group_member_id",
-                    referencedColumnName = "id"),
-            inverseJoinColumns = @JoinColumn(name = "role_id",
-                    referencedColumnName = "id"),
-            uniqueConstraints = @UniqueConstraint(
-                    columnNames = { "group_member_id", "role_id" }))
+    @JoinTable(name = "group_member_role", joinColumns = @JoinColumn(name = "group_member_id", referencedColumnName = "id"), inverseJoinColumns = @JoinColumn(name = "role_id", referencedColumnName = "id"), uniqueConstraints = @UniqueConstraint(columnNames = {
+            "group_member_id", "role_id" }))
     private Set<Role> roles;
 
     @Override
diff --git a/full/src/main/java/de/ids_mannheim/korap/exceptions/DatabaseException.java b/full/src/main/java/de/ids_mannheim/korap/exceptions/DatabaseException.java
index a142ea7..f0c9bcf 100644
--- a/full/src/main/java/de/ids_mannheim/korap/exceptions/DatabaseException.java
+++ b/full/src/main/java/de/ids_mannheim/korap/exceptions/DatabaseException.java
@@ -9,26 +9,26 @@
 public class DatabaseException extends KustvaktException {
 
     private DatabaseException (Object userid, Integer status, String message,
-                         String args, Exception e) {
+                               String args, Exception e) {
         super(String.valueOf(userid), status, message, args, e);
     }
 
-    public DatabaseException (Object userid, String target, Integer status, String message,
-            String ... args) {
+    public DatabaseException (Object userid, String target, Integer status,
+                              String message, String ... args) {
         this(null, userid, target, status, message);
     }
 
-    public DatabaseException (Exception e, Object userid, String target, Integer status, String message,
-                        String ... args) {
+    public DatabaseException (Exception e, Object userid, String target,
+                              Integer status, String message, String ... args) {
         this(userid, status, message, Arrays.asList(args).toString(), e);
     }
 
-
-    public DatabaseException (KustvaktException e, Integer status, String ... args) {
-        this(e.getUserid(), e.getStatusCode(), e.getMessage(), e.getEntity(), e);
+    public DatabaseException (KustvaktException e, Integer status,
+                              String ... args) {
+        this(e.getUserid(), e.getStatusCode(), e.getMessage(), e.getEntity(),
+                e);
     }
 
-
     @Override
     public String string () {
         return "DBExcpt{" + "status=" + getStatusCode() + ", message="
diff --git a/full/src/main/java/de/ids_mannheim/korap/exceptions/EmptyResultException.java b/full/src/main/java/de/ids_mannheim/korap/exceptions/EmptyResultException.java
index d52238b..d687d39 100644
--- a/full/src/main/java/de/ids_mannheim/korap/exceptions/EmptyResultException.java
+++ b/full/src/main/java/de/ids_mannheim/korap/exceptions/EmptyResultException.java
@@ -12,7 +12,6 @@
         super(StatusCodes.NO_RESULT_FOUND, message, entity);
     }
 
-
     public EmptyResultException (String entity) {
         super(StatusCodes.NO_RESULT_FOUND, "No entity found for id", entity);
     }
diff --git a/full/src/main/java/de/ids_mannheim/korap/exceptions/KustvaktException.java b/full/src/main/java/de/ids_mannheim/korap/exceptions/KustvaktException.java
index 0915bb5..0311878 100644
--- a/full/src/main/java/de/ids_mannheim/korap/exceptions/KustvaktException.java
+++ b/full/src/main/java/de/ids_mannheim/korap/exceptions/KustvaktException.java
@@ -21,18 +21,18 @@
     private String userid;
     private Integer statusCode;
     private int responseStatus;
-    
+
     private String entity;
     private String notification;
     private boolean isNotification;
-//    private TokenType authType;
+    //    private TokenType authType;
     private URI redirectUri;
     private ErrorObject oauth2Error;
 
     public KustvaktException (int status) {
         this.statusCode = status;
     }
-    
+
     public KustvaktException (int status, String ... args) {
         super(args[0]);
         this.statusCode = status;
@@ -40,12 +40,13 @@
         this.entity = Arrays.asList(subarray).toString();
     }
 
-    public KustvaktException (int status, String notification, boolean isNotification) {
+    public KustvaktException (int status, String notification,
+                              boolean isNotification) {
         this.statusCode = status;
         this.notification = notification;
         this.isNotification = isNotification;
     }
-    
+
     public boolean hasNotification () {
         return isNotification;
     }
@@ -61,7 +62,6 @@
         this(userid, status, message, entity, null);
     }
 
-
     public KustvaktException (Object userid, int status, String message,
                               String entity, Exception e) {
         super(message, e);
@@ -70,7 +70,6 @@
         this.userid = String.valueOf(userid);
     }
 
-
     public KustvaktException (Object userid, int status, String entity) {
         super(StatusCodes.getMessage(status));
         this.statusCode = status;
@@ -83,20 +82,21 @@
         this.statusCode = status;
         this.entity = entity;
     }
-    
-    public KustvaktException (int status, String message, String entity, Throwable e) {
+
+    public KustvaktException (int status, String message, String entity,
+                              Throwable e) {
         super(message, e);
         this.statusCode = status;
         this.entity = entity;
     }
-    
+
     public KustvaktException (int status, String message, Throwable e) {
         super(message, e);
         this.statusCode = status;
     }
 
     public KustvaktException (int status, String message,
-            ErrorObject oauth2Error) {
+                              ErrorObject oauth2Error) {
         super(message);
         this.statusCode = status;
         this.oauth2Error = oauth2Error;
@@ -108,14 +108,11 @@
         this.statusCode = status;
     }
 
-
     public KustvaktException (String message, Throwable cause, int status) {
         super(message, cause);
         this.statusCode = status;
     }
 
-
-
     public KustvaktException (String notification) {
         this.notification = notification;
         isNotification = true;
diff --git a/full/src/main/java/de/ids_mannheim/korap/exceptions/StatusCodes.java b/full/src/main/java/de/ids_mannheim/korap/exceptions/StatusCodes.java
index 73f1c62..94778c6 100644
--- a/full/src/main/java/de/ids_mannheim/korap/exceptions/StatusCodes.java
+++ b/full/src/main/java/de/ids_mannheim/korap/exceptions/StatusCodes.java
@@ -32,7 +32,7 @@
     public static final int CACHING_VC = 116;
     public static final int NETWORK_ENDPOINT_NOT_AVAILABLE = 117;
     public static final int SEARCH_NETWORK_ENDPOINT_FAILED = 118;
-    
+
     /**
      * 200 status codes general JSON serialization error
      */
@@ -45,18 +45,19 @@
 
     /**
      * 300 status codes for query language and serialization
-     * see Koral (de.ids_mannheim.korap.query.serialize.util.StatusCodes)
+     * see Koral
+     * (de.ids_mannheim.korap.query.serialize.util.StatusCodes)
      */
 
     /**
-     *  400 status codes for rewrite functions
+     * 400 status codes for rewrite functions
      */
 
     public static final int REWRITE_ERROR_DEFAULT = 400;
     public static final int NON_PUBLIC_FIELD_IGNORED = 401;
     public static final int PIPE_FAILED = 402;
-    
-//    public static final int UNSUPPORTED_RESOURCE = 402;
+
+    //    public static final int UNSUPPORTED_RESOURCE = 402;
     //    public static final int REWRITE_FAILED = 403;
     //public static final int UNSUPPORTED_FOUNDRY = 403;
     //public static final int UNSUPPORTED_CORPUS = 404;
@@ -67,12 +68,10 @@
     //public static final int FOUNDRY_REWRITE = 408;
     //public static final int FOUNDRY_INJECTION = 409;
     //    public static final int MISSING_RESOURCE = 405;
-//    public static final int NO_POLICY_TARGET = 406;
-//    public static final int NO_POLICY_CONDITION = 407;
-//    public static final int NO_POLICY_PERMISSION = 408;
-//    public static final int NO_POLICIES = 409;
-
-
+    //    public static final int NO_POLICY_TARGET = 406;
+    //    public static final int NO_POLICY_CONDITION = 407;
+    //    public static final int NO_POLICY_PERMISSION = 408;
+    //    public static final int NO_POLICIES = 409;
 
     /**
      * 500 status codes for access control related components (also
@@ -81,7 +80,6 @@
     // todo: extend according to policy rewrite possible!
     // policy errors
 
-
     // database codes
     public static final int DB_GET_FAILED = 500;
     public static final int DB_INSERT_FAILED = 501;
@@ -94,7 +92,6 @@
     public static final int DB_UPDATE_SUCCESSFUL = 507;
     public static final int DB_ENTRY_EXISTS = 508;
 
-
     //    public static final int ARGUMENT_VALIDATION_FAILURE = 700;
     // public static final int ARGUMENT_VALIDATION_FAILURE = 701;
 
@@ -109,14 +106,12 @@
     public static final int GET_ACCOUNT_SUCCESSFUL = 706;
     public static final int GET_ACCOUNT_FAILED = 707;
 
-
     public static final int STATUS_OK = 1000;
     public static final int NOTHING_CHANGED = 1001;
     public static final int INVALID_REQUEST = 1002;
-    
-//    public static final int ACCESS_DENIED = 1003;
 
-    
+    //    public static final int ACCESS_DENIED = 1003;
+
     // User group and member 
     public static final int GROUP_MEMBER_EXISTS = 1601;
     public static final int GROUP_MEMBER_INACTIVE = 1602;
@@ -124,13 +119,13 @@
     public static final int GROUP_MEMBER_NOT_FOUND = 1604;
     public static final int INVITATION_EXPIRED = 1605;
     public static final int GROUP_DELETED = 1606;
-    
+
     /**
      * 1800 Oauth2
      */
 
     public static final int OAUTH2_SYSTEM_ERROR = 1800;
-    
+
     public static final int CLIENT_REGISTRATION_FAILED = 1801;
     public static final int CLIENT_DEREGISTRATION_FAILED = 1802;
     public static final int CLIENT_AUTHENTICATION_FAILED = 1803;
@@ -141,23 +136,22 @@
     public static final int INVALID_SCOPE = 1808;
     public static final int INVALID_AUTHORIZATION = 1809;
     public static final int INVALID_REFRESH_TOKEN = 1810;
-    
+
     public static final int UNSUPPORTED_GRANT_TYPE = 1811;
     public static final int UNSUPPORTED_AUTHENTICATION_METHOD = 1812;
     public static final int UNSUPPORTED_RESPONSE_TYPE = 1813;
-    
+
     public static final int USER_REAUTHENTICATION_REQUIRED = 1822;
-    
+
     public static final int INVALID_REFRESH_TOKEN_EXPIRY = 1830;
-    
+
     /**
      * 1850 Plugins
      */
 
     public static final int PLUGIN_NOT_PERMITTED = 1850;
     public static final int PLUGIN_HAS_BEEN_INSTALLED = 1851;
-    
-    
+
     /**
      * 1900 User account and logins
      */
@@ -174,15 +168,15 @@
     /**
      * 2000 status and error codes concerning authentication
      * 
-     * Response with WWW-Authenticate header will be created 
-     * for all KustvaktExceptions with status codes 2001 or greater  
-     *  
+     * Response with WWW-Authenticate header will be created
+     * for all KustvaktExceptions with status codes 2001 or greater
+     * 
      * MH: service level messages and callbacks
      */
 
     @Deprecated
     public static final int INCORRECT_ADMIN_TOKEN = 2000;
-    
+
     public static final int AUTHENTICATION_FAILED = 2001;
     public static final int LOGIN_FAILED = 2002;
     public static final int EXPIRED = 2003;
@@ -206,13 +200,13 @@
         this.props = ConfigLoader.loadProperties("codes.info");
     }
 
-
     public static final String getMessage (int code) {
         return getCodes().props.getProperty(String.valueOf(code));
     }
 
     public static StatusCodes getCodes () {
-        if (codes == null) codes = new StatusCodes();
+        if (codes == null)
+            codes = new StatusCodes();
         return codes;
     }
 
diff --git a/full/src/main/java/de/ids_mannheim/korap/exceptions/WrappedException.java b/full/src/main/java/de/ids_mannheim/korap/exceptions/WrappedException.java
index ed091f3..2d12165 100644
--- a/full/src/main/java/de/ids_mannheim/korap/exceptions/WrappedException.java
+++ b/full/src/main/java/de/ids_mannheim/korap/exceptions/WrappedException.java
@@ -12,21 +12,19 @@
 
     private static final long serialVersionUID = 1L;
 
-
     private WrappedException (Object userid, Integer status, String message,
                               String args, Exception rootCause) {
         super(String.valueOf(userid), status, message, args, rootCause);
     }
 
-
     public WrappedException (Object userid, Integer status, String ... args) {
         this(userid, status, "", Arrays.asList(args).toString(), null);
     }
 
-
     public WrappedException (KustvaktException e, Integer status,
                              String ... args) {
-        this(e.getUserid(), e.getStatusCode(), e.getMessage(), e.getEntity(), e);
+        this(e.getUserid(), e.getStatusCode(), e.getMessage(), e.getEntity(),
+                e);
     }
 
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/handlers/BatchBuilder.java b/full/src/main/java/de/ids_mannheim/korap/handlers/BatchBuilder.java
index bdc622d..c362773 100644
--- a/full/src/main/java/de/ids_mannheim/korap/handlers/BatchBuilder.java
+++ b/full/src/main/java/de/ids_mannheim/korap/handlers/BatchBuilder.java
@@ -25,12 +25,10 @@
 
     private JdbcOperations operations;
 
-
     public BatchBuilder (JdbcOperations operations) {
         this.operations = operations;
     }
 
-
     public <T> List<T> selectFromIDs (String query, Collection ids,
             RowMapper<T> mapper) {
         List l = new ArrayList(ids);
diff --git a/full/src/main/java/de/ids_mannheim/korap/handlers/RowMapperFactory.java b/full/src/main/java/de/ids_mannheim/korap/handlers/RowMapperFactory.java
index d2240ed..47ad065 100644
--- a/full/src/main/java/de/ids_mannheim/korap/handlers/RowMapperFactory.java
+++ b/full/src/main/java/de/ids_mannheim/korap/handlers/RowMapperFactory.java
@@ -18,7 +18,7 @@
  */
 public class RowMapperFactory {
 
-    public static class UserMapMapper implements RowMapper<Map<?,?>> {
+    public static class UserMapMapper implements RowMapper<Map<?, ?>> {
 
         @Override
         public Map<?, ?> mapRow (ResultSet rs, int rowNum) throws SQLException {
@@ -36,23 +36,23 @@
                 case 0:
                     user = getKorAP(rs);
                     break;
-//                case 1:
-//                    user = getShib(rs);
-//                    break;
+                //                case 1:
+                //                    user = getShib(rs);
+                //                    break;
                 default:
                     user = User.UserFactory.getDemoUser();
                     user.setId(rs.getInt("id"));
-                    user.setAccountCreation(rs.getTimestamp(
-                            Attributes.ACCOUNT_CREATION).getTime());
+                    user.setAccountCreation(
+                            rs.getTimestamp(Attributes.ACCOUNT_CREATION)
+                                    .getTime());
                     return user;
             }
             return user;
         }
 
-
         private KorAPUser getKorAP (ResultSet rs) throws SQLException {
-            KorAPUser user = User.UserFactory.getUser(rs
-                    .getString(Attributes.USERNAME));
+            KorAPUser user = User.UserFactory
+                    .getUser(rs.getString(Attributes.USERNAME));
             user.setPassword(rs.getString(Attributes.PASSWORD));
             user.setId(rs.getInt(Attributes.ID));
             user.setAccountLocked(rs.getBoolean(Attributes.ACCOUNTLOCK));
@@ -60,21 +60,19 @@
             user.setAccountLink(rs.getString(Attributes.ACCOUNTLINK));
             long l = rs.getLong(Attributes.URI_EXPIRATION);
 
-            URIParam param = new URIParam(
-                    rs.getString(Attributes.URI_FRAGMENT), l == 0 ? -1
-                            : new Timestamp(l).getTime());
+            URIParam param = new URIParam(rs.getString(Attributes.URI_FRAGMENT),
+                    l == 0 ? -1 : new Timestamp(l).getTime());
             user.addField(param);
             return user;
         }
 
-
-//        private ShibbolethUser getShib (ResultSet rs) throws SQLException {
-//            ShibbolethUser user = User.UserFactory.getShibInstance(
-//                    rs.getString(Attributes.USERNAME),
-//                    rs.getString(Attributes.MAIL), rs.getString(Attributes.CN));
-//            user.setId(rs.getInt(Attributes.ID));
-//            return user;
-//        }
+        //        private ShibbolethUser getShib (ResultSet rs) throws SQLException {
+        //            ShibbolethUser user = User.UserFactory.getShibInstance(
+        //                    rs.getString(Attributes.USERNAME),
+        //                    rs.getString(Attributes.MAIL), rs.getString(Attributes.CN));
+        //            user.setId(rs.getInt(Attributes.ID));
+        //            return user;
+        //        }
 
     }
 
diff --git a/full/src/main/java/de/ids_mannheim/korap/interfaces/EncryptionIface.java b/full/src/main/java/de/ids_mannheim/korap/interfaces/EncryptionIface.java
index 46f519a..fe0c722 100644
--- a/full/src/main/java/de/ids_mannheim/korap/interfaces/EncryptionIface.java
+++ b/full/src/main/java/de/ids_mannheim/korap/interfaces/EncryptionIface.java
@@ -10,11 +10,10 @@
 public interface EncryptionIface {
 
     public enum Encryption {
-                @Deprecated
+        @Deprecated
         SIMPLE, ESAPICYPHER, BCRYPT
     }
 
-
     /**
      * One-way hashing of String input. Used to canonicalize
      * 
@@ -25,10 +24,8 @@
     public String secureHash (String input, String salt)
             throws KustvaktException;
 
-
     public String secureHash (String input);
 
-
     /**
      * @param plain
      * @param hash
@@ -37,10 +34,8 @@
      */
     public boolean checkHash (String plain, String hash, String salt);
 
-
     public boolean checkHash (String plain, String hash);
 
-
     /**
      * create random String to be used as authentication token
      * 
@@ -48,10 +43,8 @@
      */
     public String createToken (boolean hash, Object ... obj);
 
-
     public String createToken ();
 
-
     /**
      * create a random Integer to be used as ID for databases
      * 
@@ -59,15 +52,12 @@
      */
     public String createRandomNumber (Object ... obj);
 
-
     public String encodeBase ();
 
-
-   // @Deprecated
+    // @Deprecated
     //public Map<String, Object> validateMap (Map<String, Object> map)
     //        throws KustvaktException;
 
-
     //@Deprecated
     //public String validateEntry (String input, String type)
     //        throws KustvaktException;
diff --git a/full/src/main/java/de/ids_mannheim/korap/interfaces/EntityHandlerIface.java b/full/src/main/java/de/ids_mannheim/korap/interfaces/EntityHandlerIface.java
index 9bcf614..5a3bcfe 100644
--- a/full/src/main/java/de/ids_mannheim/korap/interfaces/EntityHandlerIface.java
+++ b/full/src/main/java/de/ids_mannheim/korap/interfaces/EntityHandlerIface.java
@@ -11,26 +11,20 @@
  */
 public interface EntityHandlerIface {
 
-    User getAccount (String username) throws EmptyResultException,
-            KustvaktException;
-
+    User getAccount (String username)
+            throws EmptyResultException, KustvaktException;
 
     int updateAccount (User user) throws KustvaktException;
 
-
     int createAccount (User user) throws KustvaktException;
 
-
     int deleteAccount (Integer userid) throws KustvaktException;
 
-
     int truncate () throws KustvaktException;
 
-
     int resetPassphrase (String username, String uriToken, String passphrase)
             throws KustvaktException;
 
-
     int activateAccount (String username, String uriToken)
             throws KustvaktException;
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/constant/OAuth2ClientType.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/constant/OAuth2ClientType.java
index dd1da81..b682883 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/constant/OAuth2ClientType.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/constant/OAuth2ClientType.java
@@ -4,7 +4,7 @@
  * Defines possible OAuth2 client types.
  * 
  * Quoted from RFC 6749:
- * <ul> 
+ * <ul>
  * 
  * <li> <b>Confidential clients</b> are clients capable of maintaining
  * the confidentiality of their
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/constant/OAuth2Error.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/constant/OAuth2Error.java
index 4b76a26..aeb1cc8 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/constant/OAuth2Error.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/constant/OAuth2Error.java
@@ -54,8 +54,7 @@
      * The authorization grant type is not supported by the
      * authorization server.
      */
-    public static final String UNSUPPORTED_GRANT_TYPE =
-            "unsupported_grant_type";
+    public static final String UNSUPPORTED_GRANT_TYPE = "unsupported_grant_type";
 
     /**
      * The requested scope is invalid, unknown, or malformed.
@@ -74,8 +73,7 @@
      * The authorization server does not support obtaining an
      * authorization code using this method.
      */
-    public static final String UNSUPPORTED_RESPONSE_TYPE =
-            "unsupported_response_type";
+    public static final String UNSUPPORTED_RESPONSE_TYPE = "unsupported_response_type";
 
     /**
      * The authorization server encountered an unexpected
@@ -94,8 +92,7 @@
      * Service Unavailable HTTP status code cannot be returned
      * to the client via an HTTP redirect.)
      */
-    public static final String TEMPORARILY_UNAVAILABLE =
-            "temporarily_unavailable";
+    public static final String TEMPORARILY_UNAVAILABLE = "temporarily_unavailable";
 
     /**
      * The request requires higher privileges than provided by the
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/dao/AccessScopeDao.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/dao/AccessScopeDao.java
index 9a2579c..77a578d 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/dao/AccessScopeDao.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/dao/AccessScopeDao.java
@@ -33,8 +33,8 @@
     @SuppressWarnings("unchecked")
     public List<AccessScope> retrieveAccessScopes () {
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<AccessScope> query =
-                builder.createQuery(AccessScope.class);
+        CriteriaQuery<AccessScope> query = builder
+                .createQuery(AccessScope.class);
         Root<AccessScope> root = query.from(AccessScope.class);
         query.select(root);
         Query q = entityManager.createQuery(query);
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/dao/AccessTokenDao.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/dao/AccessTokenDao.java
index b2fec0b..35b2b75 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/dao/AccessTokenDao.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/dao/AccessTokenDao.java
@@ -65,8 +65,8 @@
         ParameterChecker.checkObjectValue(authenticationTime,
                 "authentication time");
 
-        ZonedDateTime now =
-                ZonedDateTime.now(ZoneId.of(Attributes.DEFAULT_TIME_ZONE));
+        ZonedDateTime now = ZonedDateTime
+                .now(ZoneId.of(Attributes.DEFAULT_TIME_ZONE));
 
         ZonedDateTime expiry;
         AccessToken accessToken = new AccessToken();
@@ -91,16 +91,17 @@
         entityManager.persist(accessToken);
     }
 
-    public void storeAccessToken (AccessToken accessToken) 
-                    throws KustvaktException {
+    public void storeAccessToken (AccessToken accessToken)
+            throws KustvaktException {
         ParameterChecker.checkObjectValue(accessToken, "access token");
         entityManager.persist(accessToken);
     }
+
     public AccessToken updateAccessToken (AccessToken accessToken)
             throws KustvaktException {
         ParameterChecker.checkObjectValue(accessToken, "access_token");
-        AccessToken cachedToken =
-                (AccessToken) this.getCacheValue(accessToken.getToken());
+        AccessToken cachedToken = (AccessToken) this
+                .getCacheValue(accessToken.getToken());
         if (cachedToken != null) {
             this.removeCacheEntry(accessToken.getToken());
         }
@@ -118,8 +119,8 @@
         }
 
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<AccessToken> query =
-                builder.createQuery(AccessToken.class);
+        CriteriaQuery<AccessToken> query = builder
+                .createQuery(AccessToken.class);
         Root<AccessToken> root = query.from(AccessToken.class);
         query.select(root);
         query.where(builder.equal(root.get(AccessToken_.token), accessToken));
@@ -145,8 +146,8 @@
         }
 
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<AccessToken> query =
-                builder.createQuery(AccessToken.class);
+        CriteriaQuery<AccessToken> query = builder
+                .createQuery(AccessToken.class);
         Root<AccessToken> root = query.from(AccessToken.class);
 
         Predicate condition = builder.and(
@@ -172,12 +173,12 @@
         OAuth2Client client = clientDao.retrieveClientById(clientId);
 
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<AccessToken> query =
-                builder.createQuery(AccessToken.class);
+        CriteriaQuery<AccessToken> query = builder
+                .createQuery(AccessToken.class);
         Root<AccessToken> root = query.from(AccessToken.class);
 
-        Predicate condition =
-                builder.equal(root.get(AccessToken_.client), client);
+        Predicate condition = builder.equal(root.get(AccessToken_.client),
+                client);
         if (username != null && !username.isEmpty()) {
             condition = builder.and(condition,
                     builder.equal(root.get(AccessToken_.userId), username));
@@ -194,8 +195,8 @@
         ParameterChecker.checkStringValue(username, "username");
 
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<AccessToken> query =
-                builder.createQuery(AccessToken.class);
+        CriteriaQuery<AccessToken> query = builder
+                .createQuery(AccessToken.class);
 
         Root<AccessToken> root = query.from(AccessToken.class);
         root.fetch(AccessToken_.client);
@@ -222,11 +223,11 @@
         List<AccessToken> invalidAccessTokens = retrieveInvalidAccessTokens();
         invalidAccessTokens.forEach(token -> entityManager.remove(token));
     }
-    
+
     public List<AccessToken> retrieveInvalidAccessTokens () {
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<AccessToken> query =
-                builder.createQuery(AccessToken.class);
+        CriteriaQuery<AccessToken> query = builder
+                .createQuery(AccessToken.class);
 
         Root<AccessToken> root = query.from(AccessToken.class);
         Predicate condition = builder.or(
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/dao/AuthorizationDaoImpl.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/dao/AuthorizationDaoImpl.java
index b66037b..ed7f218 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/dao/AuthorizationDaoImpl.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/dao/AuthorizationDaoImpl.java
@@ -63,8 +63,8 @@
         authorization.setUserAuthenticationTime(authenticationTime);
         authorization.setNonce(nonce);
 
-        ZonedDateTime now =
-                ZonedDateTime.now(ZoneId.of(Attributes.DEFAULT_TIME_ZONE));
+        ZonedDateTime now = ZonedDateTime
+                .now(ZoneId.of(Attributes.DEFAULT_TIME_ZONE));
         authorization.setCreatedDate(now);
         authorization.setExpiryDate(
                 now.plusSeconds(config.getAuthorizationCodeExpiry()));
@@ -79,12 +79,12 @@
         ParameterChecker.checkStringValue(code, "code");
 
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<Authorization> query =
-                builder.createQuery(Authorization.class);
+        CriteriaQuery<Authorization> query = builder
+                .createQuery(Authorization.class);
         Root<Authorization> root = query.from(Authorization.class);
 
-        Predicate restrictions =
-                builder.equal(root.get(Authorization_.code), code);
+        Predicate restrictions = builder.equal(root.get(Authorization_.code),
+                code);
 
         query.select(root);
         query.where(restrictions);
@@ -111,12 +111,12 @@
     public List<Authorization> retrieveAuthorizationsByClientId (
             String clientId) {
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<Authorization> query =
-                builder.createQuery(Authorization.class);
+        CriteriaQuery<Authorization> query = builder
+                .createQuery(Authorization.class);
         Root<Authorization> root = query.from(Authorization.class);
 
-        Predicate restrictions =
-                builder.equal(root.get(Authorization_.clientId), clientId);
+        Predicate restrictions = builder
+                .equal(root.get(Authorization_.clientId), clientId);
 
         query.select(root);
         query.where(restrictions);
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/dao/CachedAuthorizationDaoImpl.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/dao/CachedAuthorizationDaoImpl.java
index 5f74aed..20453fd 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/dao/CachedAuthorizationDaoImpl.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/dao/CachedAuthorizationDaoImpl.java
@@ -58,8 +58,8 @@
         authorization.setUserAuthenticationTime(authenticationTime);
         authorization.setNonce(nonce);
 
-        ZonedDateTime now =
-                ZonedDateTime.now(ZoneId.of(Attributes.DEFAULT_TIME_ZONE));
+        ZonedDateTime now = ZonedDateTime
+                .now(ZoneId.of(Attributes.DEFAULT_TIME_ZONE));
         authorization.setCreatedDate(now);
         authorization.setExpiryDate(
                 now.plusSeconds(config.getAuthorizationCodeExpiry()));
@@ -87,8 +87,8 @@
             throws KustvaktException {
 
         this.storeInCache(authorization.getCode(), authorization);
-        Authorization auth =
-                (Authorization) this.getCacheValue(authorization.getCode());
+        Authorization auth = (Authorization) this
+                .getCacheValue(authorization.getCode());
         return auth;
     }
 
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/dao/InstalledPluginDao.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/dao/InstalledPluginDao.java
index b2dfb39..46bc06b 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/dao/InstalledPluginDao.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/dao/InstalledPluginDao.java
@@ -53,8 +53,8 @@
         ParameterChecker.checkStringValue(installedBy, "installedBy");
 
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<InstalledPlugin> query =
-                builder.createQuery(InstalledPlugin.class);
+        CriteriaQuery<InstalledPlugin> query = builder
+                .createQuery(InstalledPlugin.class);
 
         Root<InstalledPlugin> root = query.from(InstalledPlugin.class);
         query.select(root);
@@ -82,8 +82,8 @@
         ParameterChecker.checkStringValue(installedBy, "installedBy");
 
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<InstalledPlugin> query =
-                builder.createQuery(InstalledPlugin.class);
+        CriteriaQuery<InstalledPlugin> query = builder
+                .createQuery(InstalledPlugin.class);
 
         Root<InstalledPlugin> root = query.from(InstalledPlugin.class);
         query.select(root);
@@ -104,8 +104,8 @@
 
     public void uninstallPlugin (String superClientId, String clientId,
             String username) throws KustvaktException {
-        InstalledPlugin plugin =
-                retrieveInstalledPlugin(superClientId, clientId, username);
+        InstalledPlugin plugin = retrieveInstalledPlugin(superClientId,
+                clientId, username);
         entityManager.remove(plugin);
     }
 
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/dao/OAuth2ClientDao.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/dao/OAuth2ClientDao.java
index 9aa7bb8..0e118d5 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/dao/OAuth2ClientDao.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/dao/OAuth2ClientDao.java
@@ -85,19 +85,21 @@
             client.setPermitted(true);
         }
         if (refreshTokenExpiry <= 0) {
-            if (type.equals(OAuth2ClientType.CONFIDENTIAL)){
+            if (type.equals(OAuth2ClientType.CONFIDENTIAL)) {
                 refreshTokenExpiry = config.getRefreshTokenLongExpiry();
             }
         }
-        else if (type.equals(OAuth2ClientType.PUBLIC)){
-            throw new KustvaktException(StatusCodes.INVALID_REFRESH_TOKEN_EXPIRY,
+        else if (type.equals(OAuth2ClientType.PUBLIC)) {
+            throw new KustvaktException(
+                    StatusCodes.INVALID_REFRESH_TOKEN_EXPIRY,
                     "Custom refresh token expiry is only applicable for confidential clients");
         }
-        else if (refreshTokenExpiry > 31536000 ){
-            throw new KustvaktException(StatusCodes.INVALID_REFRESH_TOKEN_EXPIRY,
+        else if (refreshTokenExpiry > 31536000) {
+            throw new KustvaktException(
+                    StatusCodes.INVALID_REFRESH_TOKEN_EXPIRY,
                     "Maximum refresh token expiry is 31536000 seconds (1 year)");
         }
-        
+
         client.setRefreshTokenExpiry(refreshTokenExpiry);
         entityManager.persist(client);
     }
@@ -108,8 +110,8 @@
         ParameterChecker.checkStringValue(clientId, "client_id");
 
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<OAuth2Client> query =
-                builder.createQuery(OAuth2Client.class);
+        CriteriaQuery<OAuth2Client> query = builder
+                .createQuery(OAuth2Client.class);
 
         Root<OAuth2Client> root = query.from(OAuth2Client.class);
         query.select(root);
@@ -148,12 +150,12 @@
         ParameterChecker.checkStringValue(username, "username");
 
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<OAuth2Client> query =
-                builder.createQuery(OAuth2Client.class);
+        CriteriaQuery<OAuth2Client> query = builder
+                .createQuery(OAuth2Client.class);
 
         Root<OAuth2Client> client = query.from(OAuth2Client.class);
-        Join<OAuth2Client, RefreshToken> refreshToken =
-                client.join(OAuth2Client_.refreshTokens);
+        Join<OAuth2Client, RefreshToken> refreshToken = client
+                .join(OAuth2Client_.refreshTokens);
         Predicate condition = builder.and(
                 builder.equal(refreshToken.get(RefreshToken_.userId), username),
                 builder.equal(refreshToken.get(RefreshToken_.isRevoked), false),
@@ -174,12 +176,12 @@
         ParameterChecker.checkStringValue(username, "username");
 
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<OAuth2Client> query =
-                builder.createQuery(OAuth2Client.class);
+        CriteriaQuery<OAuth2Client> query = builder
+                .createQuery(OAuth2Client.class);
 
         Root<OAuth2Client> client = query.from(OAuth2Client.class);
-        Join<OAuth2Client, AccessToken> accessToken =
-                client.join(OAuth2Client_.accessTokens);
+        Join<OAuth2Client, AccessToken> accessToken = client
+                .join(OAuth2Client_.accessTokens);
         Predicate condition = builder.and(
                 builder.equal(accessToken.get(AccessToken_.userId), username),
                 builder.equal(accessToken.get(AccessToken_.isRevoked), false),
@@ -200,8 +202,8 @@
         ParameterChecker.checkStringValue(username, "username");
 
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<OAuth2Client> query =
-                builder.createQuery(OAuth2Client.class);
+        CriteriaQuery<OAuth2Client> query = builder
+                .createQuery(OAuth2Client.class);
 
         Root<OAuth2Client> client = query.from(OAuth2Client.class);
         query.select(client);
@@ -215,12 +217,12 @@
     public List<OAuth2Client> retrievePlugins (boolean isPermittedOnly)
             throws KustvaktException {
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<OAuth2Client> query =
-                builder.createQuery(OAuth2Client.class);
+        CriteriaQuery<OAuth2Client> query = builder
+                .createQuery(OAuth2Client.class);
 
         Root<OAuth2Client> client = query.from(OAuth2Client.class);
-        Predicate restrictions =
-                builder.isNotNull(client.get(OAuth2Client_.SOURCE));
+        Predicate restrictions = builder
+                .isNotNull(client.get(OAuth2Client_.SOURCE));
         if (isPermittedOnly) {
             restrictions = builder.and(restrictions,
                     builder.isTrue(client.get(OAuth2Client_.IS_PERMITTED)));
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/dao/RefreshTokenDao.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/dao/RefreshTokenDao.java
index 0c68485..19da4ff 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/dao/RefreshTokenDao.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/dao/RefreshTokenDao.java
@@ -50,8 +50,8 @@
         ParameterChecker.checkObjectValue(client, "client");
         ParameterChecker.checkObjectValue(scopes, "scopes");
 
-        ZonedDateTime now =
-                ZonedDateTime.now(ZoneId.of(Attributes.DEFAULT_TIME_ZONE));
+        ZonedDateTime now = ZonedDateTime
+                .now(ZoneId.of(Attributes.DEFAULT_TIME_ZONE));
 
         RefreshToken token = new RefreshToken();
         token.setToken(refreshToken);
@@ -79,8 +79,8 @@
         ParameterChecker.checkStringValue(token, "refresh_token");
 
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<RefreshToken> query =
-                builder.createQuery(RefreshToken.class);
+        CriteriaQuery<RefreshToken> query = builder
+                .createQuery(RefreshToken.class);
         Root<RefreshToken> root = query.from(RefreshToken.class);
         root.fetch(RefreshToken_.client);
 
@@ -97,8 +97,8 @@
         ParameterChecker.checkStringValue(username, "username");
 
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<RefreshToken> query =
-                builder.createQuery(RefreshToken.class);
+        CriteriaQuery<RefreshToken> query = builder
+                .createQuery(RefreshToken.class);
 
         Root<RefreshToken> root = query.from(RefreshToken.class);
         Predicate condition = builder.and(
@@ -122,12 +122,12 @@
         OAuth2Client client = clientDao.retrieveClientById(clientId);
 
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<RefreshToken> query =
-                builder.createQuery(RefreshToken.class);
+        CriteriaQuery<RefreshToken> query = builder
+                .createQuery(RefreshToken.class);
         Root<RefreshToken> root = query.from(RefreshToken.class);
 
-        Predicate condition =
-                builder.equal(root.get(RefreshToken_.client), client);
+        Predicate condition = builder.equal(root.get(RefreshToken_.client),
+                client);
         if (username != null && !username.isEmpty()) {
             condition = builder.and(condition,
                     builder.equal(root.get(RefreshToken_.userId), username));
@@ -144,8 +144,8 @@
         ParameterChecker.checkStringValue(username, "username");
 
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<RefreshToken> query =
-                builder.createQuery(RefreshToken.class);
+        CriteriaQuery<RefreshToken> query = builder
+                .createQuery(RefreshToken.class);
 
         Root<RefreshToken> root = query.from(RefreshToken.class);
         root.fetch(RefreshToken_.client);
@@ -172,11 +172,11 @@
         List<RefreshToken> invalidRefreshTokens = retrieveInvalidRefreshTokens();
         invalidRefreshTokens.forEach(token -> entityManager.remove(token));
     }
-    
+
     public List<RefreshToken> retrieveInvalidRefreshTokens () {
         CriteriaBuilder builder = entityManager.getCriteriaBuilder();
-        CriteriaQuery<RefreshToken> query =
-                builder.createQuery(RefreshToken.class);
+        CriteriaQuery<RefreshToken> query = builder
+                .createQuery(RefreshToken.class);
 
         Root<RefreshToken> root = query.from(RefreshToken.class);
         Predicate condition = builder.or(
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/dto/OAuth2TokenDto.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/dto/OAuth2TokenDto.java
index 6afb4ca..684acd5 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/dto/OAuth2TokenDto.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/dto/OAuth2TokenDto.java
@@ -90,8 +90,7 @@
         return userAuthenticationTime;
     }
 
-    public void setUserAuthenticationTime (
-            String userAuthenticationTime) {
+    public void setUserAuthenticationTime (String userAuthenticationTime) {
         this.userAuthenticationTime = userAuthenticationTime;
     }
 
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/dto/OAuth2UserClientDto.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/dto/OAuth2UserClientDto.java
index c417a60..f499fe0 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/dto/OAuth2UserClientDto.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/dto/OAuth2UserClientDto.java
@@ -11,9 +11,10 @@
 import de.ids_mannheim.korap.utils.JsonUtils;
 
 /**
- * Please use {@link OAuth2ClientInfoDto} instead. 
+ * Please use {@link OAuth2ClientInfoDto} instead.
  * 
- * This class is not used anymore to describe OAuth2 clients of a user.
+ * This class is not used anymore to describe OAuth2 clients of a
+ * user.
  * 
  * @author margaretha
  *
@@ -37,7 +38,7 @@
     private String registrationDate;
     @JsonProperty("refresh_token_expiry")
     private int refreshTokenExpiry;
-    
+
     private boolean permitted;
     private JsonNode source;
 
@@ -55,11 +56,11 @@
             this.setRefreshTokenExpiry(client.getRefreshTokenExpiry());
         }
         String source = client.getSource();
-        if (source!=null) {
+        if (source != null) {
             this.setSource(JsonUtils.readTree(client.getSource()));
         }
     }
-    
+
     public String getClientName () {
         return clientName;
     }
@@ -119,20 +120,23 @@
     public JsonNode getSource () {
         return source;
     }
+
     public void setSource (JsonNode source) {
         this.source = source;
     }
-    
+
     public String getRegistrationDate () {
         return registrationDate;
     }
+
     public void setRegistrationDate (String registrationDate) {
         this.registrationDate = registrationDate;
     }
-    
+
     public int getRefreshTokenExpiry () {
         return refreshTokenExpiry;
     }
+
     public void setRefreshTokenExpiry (int refreshTokenExpiry) {
         this.refreshTokenExpiry = refreshTokenExpiry;
     }
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/entity/AccessScope.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/entity/AccessScope.java
index 7903146..85f0fcf 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/entity/AccessScope.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/entity/AccessScope.java
@@ -63,8 +63,8 @@
 
         return false;
     }
-    
-@Override
+
+    @Override
     public int hashCode () {
         return this.getId().hashCode();
     }
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/entity/AccessToken.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/entity/AccessToken.java
index 04acc5e..9e0fd8d 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/entity/AccessToken.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/entity/AccessToken.java
@@ -45,8 +45,8 @@
     private ZonedDateTime expiryDate;
     @Column(name = "user_id")
     private String userId;
-//    @Column(name = "client_id")
-//    private String clientId;
+    //    @Column(name = "client_id")
+    //    private String clientId;
     @Column(name = "is_revoked")
     private boolean isRevoked;
     @Column(name = "user_auth_time", updatable = false)
@@ -57,19 +57,14 @@
     // private Authorization authorization;
 
     @ManyToMany(fetch = FetchType.EAGER)
-    @JoinTable(name = "oauth2_access_token_scope",
-            joinColumns = @JoinColumn(name = "token_id",
-                    referencedColumnName = "id"),
-            inverseJoinColumns = @JoinColumn(name = "scope_id",
-                    referencedColumnName = "id"),
-            uniqueConstraints = @UniqueConstraint(
-                    columnNames = { "token_id", "scope_id" }))
+    @JoinTable(name = "oauth2_access_token_scope", joinColumns = @JoinColumn(name = "token_id", referencedColumnName = "id"), inverseJoinColumns = @JoinColumn(name = "scope_id", referencedColumnName = "id"), uniqueConstraints = @UniqueConstraint(columnNames = {
+            "token_id", "scope_id" }))
     private Set<AccessScope> scopes;
 
     @ManyToOne(fetch = FetchType.LAZY)
     @JoinColumn(name = "refresh_token")
     private RefreshToken refreshToken;
-    
+
     @ManyToOne(fetch = FetchType.LAZY)
     @JoinColumn(name = "client")
     private OAuth2Client client;
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/entity/Authorization.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/entity/Authorization.java
index 386434f..acaf081 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/entity/Authorization.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/entity/Authorization.java
@@ -54,13 +54,8 @@
     private String nonce;
 
     @ManyToMany(fetch = FetchType.EAGER)
-    @JoinTable(name = "oauth2_authorization_scope",
-            joinColumns = @JoinColumn(name = "authorization_id",
-                    referencedColumnName = "id"),
-            inverseJoinColumns = @JoinColumn(name = "scope_id",
-                    referencedColumnName = "id"),
-            uniqueConstraints = @UniqueConstraint(
-                    columnNames = { "authorization_id", "scope_id" }))
+    @JoinTable(name = "oauth2_authorization_scope", joinColumns = @JoinColumn(name = "authorization_id", referencedColumnName = "id"), inverseJoinColumns = @JoinColumn(name = "scope_id", referencedColumnName = "id"), uniqueConstraints = @UniqueConstraint(columnNames = {
+            "authorization_id", "scope_id" }))
     private Set<AccessScope> scopes;
 
     @Override
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/entity/OAuth2Client.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/entity/OAuth2Client.java
index eac5d31..5f29815 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/entity/OAuth2Client.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/entity/OAuth2Client.java
@@ -15,14 +15,15 @@
 import de.ids_mannheim.korap.entity.InstalledPlugin;
 import de.ids_mannheim.korap.oauth2.constant.OAuth2ClientType;
 
-/** Describe oauth2_client database table mapping.
+/**
+ * Describe oauth2_client database table mapping.
  * 
  * @author margaretha
  *
  */
 @Entity
 @Table(name = "oauth2_client")
-public class OAuth2Client implements Comparable<OAuth2Client>{
+public class OAuth2Client implements Comparable<OAuth2Client> {
 
     @Id
     private String id;
@@ -39,28 +40,28 @@
     private String registeredBy;
     @Column(name = "registration_date", updatable = false)
     private ZonedDateTime registrationDate;
-    
+
     // How long a refresh token for this client should be valid
     // in seconds. Maximum 31536000 seconds equivalent to 1 year     
     @Column(name = "refresh_token_expiry")
     private int refreshTokenExpiry;
-    
+
     private String description;
     private String url;
 
     private String source;
     @Column(name = "is_permitted")
     private boolean isPermitted;
-    
+
     @OneToMany(fetch = FetchType.LAZY, mappedBy = "client")
     private List<RefreshToken> refreshTokens;
-    
+
     @OneToMany(fetch = FetchType.LAZY, mappedBy = "client")
     private List<AccessToken> accessTokens;
-    
+
     @OneToMany(fetch = FetchType.LAZY, mappedBy = "client")
     private List<InstalledPlugin> installedPlugins;
-    
+
     @Override
     public String toString () {
         return "id=" + id + ", name=" + name + ", secret=" + secret + ", type="
@@ -73,7 +74,7 @@
     public int compareTo (OAuth2Client o) {
         return this.getName().compareTo(o.getName());
     }
-    
+
     public boolean isSuper () {
         return isSuper;
     }
@@ -129,10 +130,11 @@
     public void setRegisteredBy (String registeredBy) {
         this.registeredBy = registeredBy;
     }
-    
+
     public ZonedDateTime getRegistrationDate () {
         return registrationDate;
     }
+
     public void setRegistrationDate (ZonedDateTime registrationDate) {
         this.registrationDate = registrationDate;
     }
@@ -164,14 +166,15 @@
     public boolean isPermitted () {
         return isPermitted;
     }
-    
+
     public void setPermitted (boolean isPermitted) {
         this.isPermitted = isPermitted;
     }
-    
+
     public int getRefreshTokenExpiry () {
         return refreshTokenExpiry;
     }
+
     public void setRefreshTokenExpiry (int refreshTokenExpiry) {
         this.refreshTokenExpiry = refreshTokenExpiry;
     }
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/entity/RefreshToken.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/entity/RefreshToken.java
index ff22e25..db70d6a 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/entity/RefreshToken.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/entity/RefreshToken.java
@@ -19,7 +19,8 @@
 
 /**
  * Describes oauth2_refresh_token database table mapping and refresh
- * token relations to access scopes, access tokens, and oauth2 clients.
+ * token relations to access scopes, access tokens, and oauth2
+ * clients.
  * 
  * @author margaretha
  *
@@ -53,13 +54,8 @@
     private OAuth2Client client;
 
     @ManyToMany(fetch = FetchType.EAGER)
-    @JoinTable(name = "oauth2_refresh_token_scope",
-            joinColumns = @JoinColumn(name = "token_id",
-                    referencedColumnName = "id"),
-            inverseJoinColumns = @JoinColumn(name = "scope_id",
-                    referencedColumnName = "id"),
-            uniqueConstraints = @UniqueConstraint(
-                    columnNames = { "token_id", "scope_id" }))
+    @JoinTable(name = "oauth2_refresh_token_scope", joinColumns = @JoinColumn(name = "token_id", referencedColumnName = "id"), inverseJoinColumns = @JoinColumn(name = "scope_id", referencedColumnName = "id"), uniqueConstraints = @UniqueConstraint(columnNames = {
+            "token_id", "scope_id" }))
     private Set<AccessScope> scopes;
 
     public String getToken () {
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/service/DummyOAuth2ScopeServiceImpl.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/service/DummyOAuth2ScopeServiceImpl.java
index d1e7945..38e039a 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/service/DummyOAuth2ScopeServiceImpl.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/service/DummyOAuth2ScopeServiceImpl.java
@@ -7,7 +7,7 @@
 
 public class DummyOAuth2ScopeServiceImpl implements OAuth2ScopeService {
 
-      @Override
+    @Override
     public void verifyScope (TokenContext context, OAuth2Scope requiredScope)
             throws KustvaktException {
         // TODO Auto-generated method stub
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2AuthorizationService.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2AuthorizationService.java
index 19cf2e1..36b027f 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2AuthorizationService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2AuthorizationService.java
@@ -33,7 +33,8 @@
 import de.ids_mannheim.korap.oauth2.entity.Authorization;
 import de.ids_mannheim.korap.oauth2.entity.OAuth2Client;
 
-/** Describes business logic behind OAuth2 authorization requests.
+/**
+ * Describes business logic behind OAuth2 authorization requests.
  * 
  * @author margaretha
  *
@@ -41,11 +42,11 @@
 @Service(value = "authorizationService")
 public class OAuth2AuthorizationService {
 
-    public static Logger jlog =
-            LogManager.getLogger(OAuth2AuthorizationService.class);
+    public static Logger jlog = LogManager
+            .getLogger(OAuth2AuthorizationService.class);
 
     public static boolean DEBUG = false;
-    
+
     @Autowired
     private RandomCodeGenerator codeGenerator;
     @Autowired
@@ -59,25 +60,24 @@
 
     @Autowired
     protected FullConfiguration config;
-    
+
     public State createAuthorizationState (String state) {
         State authState = null;
-        if (state!=null && !state.isEmpty())
+        if (state != null && !state.isEmpty())
             authState = new State(state);
         return authState;
     }
-    
+
     public AuthorizationErrorResponse createAuthorizationError (
             KustvaktException e, String state) {
         State authState = createAuthorizationState(state);
         ErrorObject error = e.getOauth2Error();
         error = error.setDescription(e.getMessage());
-        AuthorizationErrorResponse errorResponse =
-                new AuthorizationErrorResponse(e.getRedirectUri(),
-                        error,authState, null);
+        AuthorizationErrorResponse errorResponse = new AuthorizationErrorResponse(
+                e.getRedirectUri(), error, authState, null);
         return errorResponse;
     }
-    
+
     public URI requestAuthorizationCode (URI requestURI, String clientId,
             String redirectUri, String scope, String state, String username,
             ZonedDateTime authenticationTime) throws KustvaktException {
@@ -95,7 +95,7 @@
             createAuthorization(username, clientId, redirectUri, scope,
                     code.toString(), authenticationTime, null);
             return responseURI;
-            
+
         }
         catch (KustvaktException e) {
             e.setRedirectUri(redirectURI);
@@ -104,8 +104,7 @@
     }
 
     private URI createAuthorizationResponse (URI requestURI, URI redirectURI,
-            String code, String state)
-            throws KustvaktException {
+            String code, String state) throws KustvaktException {
         AuthorizationRequest authRequest = null;
         try {
             authRequest = AuthorizationRequest.parse(requestURI);
@@ -114,10 +113,9 @@
                     .equals(new ResponseType(ResponseType.Value.CODE))) {
 
                 State authState = createAuthorizationState(state);
-                AuthorizationSuccessResponse response =
-                        new AuthorizationSuccessResponse(redirectURI,
-                                new AuthorizationCode(code), null, authState,
-                                null);
+                AuthorizationSuccessResponse response = new AuthorizationSuccessResponse(
+                        redirectURI, new AuthorizationCode(code), null,
+                        authState, null);
                 return response.toURI();
             }
             else {
@@ -129,13 +127,14 @@
             }
         }
         catch (ParseException e) {
-            KustvaktException ke =
-                    new KustvaktException(StatusCodes.INVALID_REQUEST,
-                            e.getMessage(), OAuth2Error.INVALID_REQUEST_URI);
+            KustvaktException ke = new KustvaktException(
+                    StatusCodes.INVALID_REQUEST, e.getMessage(),
+                    OAuth2Error.INVALID_REQUEST_URI);
             throw ke;
         }
 
     }
+
     @Deprecated
     public String createAuthorization (String username, String clientId,
             String redirectUri, Set<String> scopeSet, String code,
@@ -152,7 +151,7 @@
                 scopes, redirectUri, authenticationTime, nonce);
         return String.join(" ", scopeSet);
     }
-    
+
     /**
      * Authorization code request does not require client
      * authentication, but only checks if the client id exists.
@@ -176,7 +175,8 @@
             throw new KustvaktException(StatusCodes.MISSING_PARAMETER,
                     "scope is required", OAuth2Error.INVALID_SCOPE);
         }
-        Set<AccessScope> accessScopes = scopeService.convertToAccessScope(scope);
+        Set<AccessScope> accessScopes = scopeService
+                .convertToAccessScope(scope);
 
         authorizationDao.storeAuthorizationCode(clientId, username, code,
                 accessScopes, redirectUri, authenticationTime, nonce);
@@ -217,19 +217,19 @@
             throws KustvaktException {
 
         String registeredUri = client.getRedirectURI();
-        
+
         if (redirectUri != null && !redirectUri.isEmpty()) {
             // check if the redirect URI the same as that in DB
-            if (!redirectURIValidator.isValid(redirectUri) ||
-                    (registeredUri != null && !registeredUri.isEmpty()
-                    && !redirectUri.equals(registeredUri))) {
+            if (!redirectURIValidator.isValid(redirectUri)
+                    || (registeredUri != null && !registeredUri.isEmpty()
+                            && !redirectUri.equals(registeredUri))) {
                 throw new KustvaktException(StatusCodes.INVALID_REDIRECT_URI,
                         "Invalid redirect URI", OAuth2Error.INVALID_REQUEST);
             }
         }
         // redirect_uri is not required in client registration
         else if (registeredUri != null && !registeredUri.isEmpty()) {
-                redirectUri = registeredUri;
+            redirectUri = registeredUri;
         }
         else {
             throw new KustvaktException(StatusCodes.MISSING_REDIRECT_URI,
@@ -244,14 +244,14 @@
             throw new KustvaktException(StatusCodes.INVALID_REDIRECT_URI,
                     "Invalid redirect URI", OAuth2Error.INVALID_REQUEST);
         }
-        
+
         return redirectURI;
     }
-    
+
     public KustvaktException checkRedirectUri (KustvaktException e,
-            String clientId, String redirectUri){
+            String clientId, String redirectUri) {
         int statusCode = e.getStatusCode();
-        if (clientId!=null && !clientId.isEmpty()
+        if (clientId != null && !clientId.isEmpty()
                 && statusCode != StatusCodes.CLIENT_NOT_FOUND
                 && statusCode != StatusCodes.AUTHORIZATION_FAILED
                 && statusCode != StatusCodes.INVALID_REDIRECT_URI) {
@@ -265,16 +265,20 @@
             if (redirectUri != null && !redirectUri.isEmpty()) {
                 if (registeredUri != null && !registeredUri.isEmpty()
                         && !redirectUri.equals(registeredUri)) {
-                    return new KustvaktException(StatusCodes.INVALID_REDIRECT_URI,
-                            "Invalid redirect URI", OAuth2Error.INVALID_REQUEST);
+                    return new KustvaktException(
+                            StatusCodes.INVALID_REDIRECT_URI,
+                            "Invalid redirect URI",
+                            OAuth2Error.INVALID_REQUEST);
                 }
                 else {
                     try {
                         e.setRedirectUri(new URI(redirectUri));
                     }
                     catch (URISyntaxException e1) {
-                        return new KustvaktException(StatusCodes.INVALID_REDIRECT_URI,
-                                "Invalid redirect URI", OAuth2Error.INVALID_REQUEST);
+                        return new KustvaktException(
+                                StatusCodes.INVALID_REDIRECT_URI,
+                                "Invalid redirect URI",
+                                OAuth2Error.INVALID_REQUEST);
                     }
                     e.setResponseStatus(HttpStatus.SC_TEMPORARY_REDIRECT);
                 }
@@ -284,14 +288,17 @@
                     e.setRedirectUri(new URI(registeredUri));
                 }
                 catch (URISyntaxException e1) {
-                    return new KustvaktException(StatusCodes.INVALID_REDIRECT_URI,
-                            "Invalid redirect URI", OAuth2Error.INVALID_REQUEST);
+                    return new KustvaktException(
+                            StatusCodes.INVALID_REDIRECT_URI,
+                            "Invalid redirect URI",
+                            OAuth2Error.INVALID_REQUEST);
                 }
                 e.setResponseStatus(HttpStatus.SC_TEMPORARY_REDIRECT);
             }
             else {
                 return new KustvaktException(StatusCodes.MISSING_REDIRECT_URI,
-                        "Missing parameter: redirect URI", OAuth2Error.INVALID_REQUEST);
+                        "Missing parameter: redirect URI",
+                        OAuth2Error.INVALID_REQUEST);
             }
         }
 
@@ -327,7 +334,7 @@
             if (redirectURI == null || redirectURI.isEmpty()) {
                 throw new KustvaktException(StatusCodes.INVALID_REDIRECT_URI,
                         "Missing redirect URI", OAuth2Error.INVALID_GRANT);
-            }    
+            }
             if (!authorizedUri.equals(redirectURI)) {
                 throw new KustvaktException(StatusCodes.INVALID_REDIRECT_URI,
                         "Invalid redirect URI", OAuth2Error.INVALID_GRANT);
@@ -355,8 +362,8 @@
     }
 
     private boolean isExpired (ZonedDateTime expiryDate) {
-        ZonedDateTime now =
-                ZonedDateTime.now(ZoneId.of(Attributes.DEFAULT_TIME_ZONE));
+        ZonedDateTime now = ZonedDateTime
+                .now(ZoneId.of(Attributes.DEFAULT_TIME_ZONE));
         if (DEBUG) {
             jlog.debug("createdDate: " + expiryDate);
             jlog.debug("expiration: " + expiryDate + ", now: " + now);
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2ClientService.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2ClientService.java
index 55d85ab..3781458 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2ClientService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2ClientService.java
@@ -60,10 +60,10 @@
  */
 @Service
 public class OAuth2ClientService {
-    
-//    public static final UrlValidator redirectURIValidator =
-//            new UrlValidator(new String[] { "http", "https" },
-//                    UrlValidator.NO_FRAGMENTS + UrlValidator.ALLOW_LOCAL_URLS);
+
+    //    public static final UrlValidator redirectURIValidator =
+    //            new UrlValidator(new String[] { "http", "https" },
+    //                    UrlValidator.NO_FRAGMENTS + UrlValidator.ALLOW_LOCAL_URLS);
 
     @Autowired
     private OAuth2TokenService tokenService;
@@ -93,15 +93,18 @@
     public OAuth2ClientDto registerClient (OAuth2ClientJson clientJson,
             String registeredBy) throws KustvaktException {
         try {
-            ParameterChecker.checkNameValue(clientJson.getName(), "client_name");
-            ParameterChecker.checkObjectValue(clientJson.getType(), "client_type");
-            ParameterChecker.checkStringValue(clientJson.getName(), "client_description");
+            ParameterChecker.checkNameValue(clientJson.getName(),
+                    "client_name");
+            ParameterChecker.checkObjectValue(clientJson.getType(),
+                    "client_type");
+            ParameterChecker.checkStringValue(clientJson.getName(),
+                    "client_description");
         }
         catch (KustvaktException e) {
             throw new KustvaktException(e.getStatusCode(), e.getMessage(),
                     OAuth2Error.INVALID_REQUEST);
         }
-    
+
         String url = clientJson.getUrl();
         if (url != null && !url.isEmpty()) {
             if (!urlValidator.isValid(url)) {
@@ -114,7 +117,7 @@
         if (redirectURI != null && !redirectURI.isEmpty()
                 && !redirectURIValidator.isValid(redirectURI)) {
             throw new KustvaktException(StatusCodes.INVALID_REDIRECT_URI,
-                   "Invalid redirect URI", OAuth2Error.INVALID_REQUEST);
+                    "Invalid redirect URI", OAuth2Error.INVALID_REQUEST);
         }
 
         // boolean isNative = isNativeClient(url, redirectURI);
@@ -140,17 +143,16 @@
 
         String id = codeGenerator.createRandomCode();
         id = codeGenerator.filterRandomCode(id);
-        
+
         try {
             clientDao.registerClient(id, secretHashcode, clientJson.getName(),
                     clientJson.getType(), url, redirectURI, registeredBy,
                     clientJson.getDescription(),
-                    clientJson.getRefreshTokenExpiry(),
-                    clientJson.getSource());
+                    clientJson.getRefreshTokenExpiry(), clientJson.getSource());
         }
         catch (KustvaktException e) {
-            throw new KustvaktException(e.getStatusCode(),
-                    e.getMessage(), OAuth2Error.INVALID_REQUEST);
+            throw new KustvaktException(e.getStatusCode(), e.getMessage(),
+                    OAuth2Error.INVALID_REQUEST);
         }
         catch (Exception e) {
             Throwable cause = e;
@@ -212,7 +214,7 @@
             throws KustvaktException {
 
         OAuth2Client client = clientDao.retrieveClientById(clientId);
-        
+
         if (adminDao.isAdmin(username)
                 || client.getRegisteredBy().equals(username)) {
 
@@ -229,23 +231,23 @@
             throws KustvaktException {
 
         // revoke all related authorization codes
-        List<Authorization> authList =
-                authorizationDao.retrieveAuthorizationsByClientId(clientId);
+        List<Authorization> authList = authorizationDao
+                .retrieveAuthorizationsByClientId(clientId);
         for (Authorization authorization : authList) {
             authorization.setRevoked(true);
             authorizationDao.updateAuthorization(authorization);
         }
 
         // revoke all related access tokens
-        List<AccessToken> tokens =
-                tokenDao.retrieveAccessTokenByClientId(clientId,null);
+        List<AccessToken> tokens = tokenDao
+                .retrieveAccessTokenByClientId(clientId, null);
         for (AccessToken token : tokens) {
             token.setRevoked(true);
             tokenDao.updateAccessToken(token);
         }
 
-        List<RefreshToken> refreshTokens =
-                refreshDao.retrieveRefreshTokenByClientId(clientId,null);
+        List<RefreshToken> refreshTokens = refreshDao
+                .retrieveRefreshTokenByClientId(clientId, null);
         for (RefreshToken token : refreshTokens) {
             token.setRevoked(true);
             refreshDao.updateRefreshToken(token);
@@ -281,18 +283,18 @@
             String clientSecret) throws KustvaktException {
         return authenticateClient(clientId, clientSecret, false);
     }
-    
+
     public OAuth2Client authenticateClient (String clientId,
             String clientSecret, boolean isSuper) throws KustvaktException {
         String errorClient = "client";
         if (isSuper) {
             errorClient = "super_client";
         }
-        
+
         if (clientId == null || clientId.isEmpty()) {
             throw new KustvaktException(
                     StatusCodes.CLIENT_AUTHENTICATION_FAILED,
-                    "Missing parameter: "+errorClient+"_id",
+                    "Missing parameter: " + errorClient + "_id",
                     OAuth2Error.INVALID_REQUEST);
         }
 
@@ -307,7 +309,7 @@
             if (client.getType().equals(OAuth2ClientType.CONFIDENTIAL)) {
                 throw new KustvaktException(
                         StatusCodes.CLIENT_AUTHENTICATION_FAILED,
-                        "Missing parameter: "+errorClient+"_secret",
+                        "Missing parameter: " + errorClient + "_secret",
                         OAuth2Error.INVALID_REQUEST);
             }
         }
@@ -315,14 +317,15 @@
             if (client.getType().equals(OAuth2ClientType.CONFIDENTIAL)) {
                 throw new KustvaktException(
                         StatusCodes.CLIENT_AUTHENTICATION_FAILED,
-                        errorClient+"_secret was not registered",
+                        errorClient + "_secret was not registered",
                         OAuth2Error.INVALID_CLIENT);
             }
         }
         else if (!encryption.checkHash(clientSecret, client.getSecret())) {
             throw new KustvaktException(
                     StatusCodes.CLIENT_AUTHENTICATION_FAILED,
-                    "Invalid "+errorClient+" credentials", OAuth2Error.INVALID_CLIENT);
+                    "Invalid " + errorClient + " credentials",
+                    OAuth2Error.INVALID_CLIENT);
         }
     }
 
@@ -341,14 +344,14 @@
     public OAuth2ClientInfoDto retrieveClientInfo (String clientId)
             throws KustvaktException {
         OAuth2Client client = clientDao.retrieveClientById(clientId);
-//        if (adminDao.isAdmin(username)
-//                || username.equals(client.getRegisteredBy())) {
-            return new OAuth2ClientInfoDto(client);
-//        }
-//        else {
-//            throw new KustvaktException(StatusCodes.AUTHORIZATION_FAILED,
-//                    "Unauthorized operation for user: " + username, username);
-//        }
+        //        if (adminDao.isAdmin(username)
+        //                || username.equals(client.getRegisteredBy())) {
+        return new OAuth2ClientInfoDto(client);
+        //        }
+        //        else {
+        //            throw new KustvaktException(StatusCodes.AUTHORIZATION_FAILED,
+        //                    "Unauthorized operation for user: " + username, username);
+        //        }
     }
 
     public OAuth2Client retrieveClient (String clientId)
@@ -358,33 +361,32 @@
 
     public List<OAuth2ClientInfoDto> listUserAuthorizedClients (String username)
             throws KustvaktException {
-        List<OAuth2Client> userClients =
-                clientDao.retrieveUserAuthorizedClients(username);
+        List<OAuth2Client> userClients = clientDao
+                .retrieveUserAuthorizedClients(username);
         userClients.addAll(clientDao.retrieveClientsByAccessTokens(username));
-        
+
         List<String> clientIds = new ArrayList<>();
         List<OAuth2Client> uniqueClients = new ArrayList<>();
-        for (OAuth2Client c : userClients){
+        for (OAuth2Client c : userClients) {
             String id = c.getId();
-            if (!clientIds.contains(id)){
+            if (!clientIds.contains(id)) {
                 clientIds.add(id);
                 uniqueClients.add(c);
-            }        
+            }
         }
-        
+
         Collections.sort(uniqueClients);
         return createClientDtos(uniqueClients);
     }
-    
+
     public List<OAuth2ClientInfoDto> listUserRegisteredClients (String username)
             throws KustvaktException {
-        List<OAuth2Client> userClients =
-                clientDao.retrieveUserRegisteredClients(username);
+        List<OAuth2Client> userClients = clientDao
+                .retrieveUserRegisteredClients(username);
         Collections.sort(userClients);
         return createClientDtos(userClients);
     }
-    
-       
+
     public List<OAuth2ClientInfoDto> listPlugins (boolean isPermitted)
             throws KustvaktException {
 
@@ -392,46 +394,47 @@
         Collections.sort(plugins);
         return createClientDtos(plugins);
     }
-    
+
     public List<InstalledPluginDto> listInstalledPlugins (String superClientId,
             String username) throws KustvaktException {
 
-        List<InstalledPlugin> plugins =
-                pluginDao.retrieveInstalledPlugins(superClientId, username);
+        List<InstalledPlugin> plugins = pluginDao
+                .retrieveInstalledPlugins(superClientId, username);
         Collections.sort(plugins); // by client name
-        
-        List<InstalledPluginDto> list = new ArrayList<InstalledPluginDto>(plugins.size());
+
+        List<InstalledPluginDto> list = new ArrayList<InstalledPluginDto>(
+                plugins.size());
         for (InstalledPlugin p : plugins) {
             list.add(new InstalledPluginDto(p));
         }
-        
+
         return list;
     }
-    
+
     public InstalledPluginDto installPlugin (String superClientId,
             String clientId, String installedBy) throws KustvaktException {
-        
+
         OAuth2Client client = clientDao.retrieveClientById(clientId);
         if (!client.isPermitted()) {
             throw new KustvaktException(StatusCodes.PLUGIN_NOT_PERMITTED,
                     "Plugin is not permitted", clientId);
         }
-        
-        if (isPluginInstalled(superClientId,clientId,installedBy)) {
+
+        if (isPluginInstalled(superClientId, clientId, installedBy)) {
             throw new KustvaktException(StatusCodes.PLUGIN_HAS_BEEN_INSTALLED,
                     "Plugin has been installed", clientId);
         }
-        
+
         OAuth2Client superClient = clientDao.retrieveClientById(superClientId);
-        InstalledPlugin plugin =
-                pluginDao.storeUserPlugin(superClient, client, installedBy);
-        
+        InstalledPlugin plugin = pluginDao.storeUserPlugin(superClient, client,
+                installedBy);
+
         InstalledPluginDto dto = new InstalledPluginDto(plugin);
         return dto;
     }
-    
-    public void uninstallPlugin (String superClientId,
-            String clientId, String username) throws KustvaktException {
+
+    public void uninstallPlugin (String superClientId, String clientId,
+            String username) throws KustvaktException {
         pluginDao.uninstallPlugin(superClientId, clientId, username);
         tokenService.revokeAllClientTokensForUser(clientId, username);
     }
@@ -452,7 +455,8 @@
             List<OAuth2Client> userClients) throws KustvaktException {
         List<OAuth2ClientInfoDto> dtoList = new ArrayList<>(userClients.size());
         for (OAuth2Client uc : userClients) {
-            if (uc.isSuper()) continue;
+            if (uc.isSuper())
+                continue;
             OAuth2ClientInfoDto dto = new OAuth2ClientInfoDto(uc);
             dtoList.add(dto);
         }
@@ -465,7 +469,7 @@
 
     public void verifySuperClient (String clientId, String clientSecret)
             throws KustvaktException {
-        OAuth2Client client = authenticateClient(clientId, clientSecret,true);
+        OAuth2Client client = authenticateClient(clientId, clientSecret, true);
         if (!client.isSuper()) {
             throw new KustvaktException(StatusCodes.CLIENT_AUTHORIZATION_FAILED,
                     "Only super client is allowed to use this service",
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2InitClientService.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2InitClientService.java
index 3846cdf..25b07dd 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2InitClientService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2InitClientService.java
@@ -23,10 +23,9 @@
 @Service
 public class OAuth2InitClientService {
 
-    private static Logger log =
-            LogManager.getLogger(OAuth2InitClientService.class);
-    public static String OAUTH2_CLIENT_JSON_INPUT_FILE =
-            "initial_super_client.json";
+    private static Logger log = LogManager
+            .getLogger(OAuth2InitClientService.class);
+    public static String OAUTH2_CLIENT_JSON_INPUT_FILE = "initial_super_client.json";
     public static String OUTPUT_FILENAME = "super_client_info";
     public static String TEST_OUTPUT_FILENAME = "test_super_client_info";
 
@@ -50,35 +49,35 @@
 
         if (!f.exists()) {
             OAuth2ClientJson json = readOAuth2ClientJsonFile();
-            OAuth2ClientDto clientDto =
-                    clientService.registerClient(json, "system");
+            OAuth2ClientDto clientDto = clientService.registerClient(json,
+                    "system");
             String clientId = clientDto.getClient_id();
             OAuth2Client client = clientService.retrieveClient(clientId);
             client.setSuper(true);
             clientDao.updateClient(client);
             JsonUtils.writeFile(path, clientDto);
-            
+
             log.info(
-                    "Initial super client has been successfully registered. See "+path);
+                    "Initial super client has been successfully registered. See "
+                            + path);
         }
         else {
             JsonNode node = JsonUtils.readFile(path, JsonNode.class);
             String existingClientId = node.at("/client_id").asText();
             String clientSecret = node.at("/client_secret").asText();
             String secretHashcode = encryption.secureHash(clientSecret);
-            
+
             try {
                 clientService.retrieveClient(existingClientId);
-                log.info(
-                        "Super client info file exists. Initial super client "
+                log.info("Super client info file exists. Initial super client "
                         + "registration is cancelled.");
             }
             catch (Exception e) {
                 log.info("Super client info file exists but the client "
                         + "doesn't exist in the database.");
                 OAuth2ClientJson json = readOAuth2ClientJsonFile();
-                OAuth2ClientDto clientDto =
-                        clientService.registerClient(json, "system");
+                OAuth2ClientDto clientDto = clientService.registerClient(json,
+                        "system");
                 String clientId = clientDto.getClient_id();
                 OAuth2Client client = clientService.retrieveClient(clientId);
                 client.setSuper(true);
@@ -89,15 +88,16 @@
         }
     }
 
-    private OAuth2ClientJson readOAuth2ClientJsonFile () throws IOException, KustvaktException {
+    private OAuth2ClientJson readOAuth2ClientJsonFile ()
+            throws IOException, KustvaktException {
         File f = new File(OAUTH2_CLIENT_JSON_INPUT_FILE);
         if (f.exists()) {
             return JsonUtils.readFile(OAUTH2_CLIENT_JSON_INPUT_FILE,
                     OAuth2ClientJson.class);
         }
         else {
-            InputStream is = getClass().getClassLoader()
-                    .getResourceAsStream("json/"+OAUTH2_CLIENT_JSON_INPUT_FILE);
+            InputStream is = getClass().getClassLoader().getResourceAsStream(
+                    "json/" + OAUTH2_CLIENT_JSON_INPUT_FILE);
             return JsonUtils.read(is, OAuth2ClientJson.class);
         }
 
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2ScopeService.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2ScopeService.java
index 53bfaf0..e51b83a 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2ScopeService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2ScopeService.java
@@ -14,8 +14,10 @@
      * Verifies whether the given token context contains the required
      * scope
      * 
-     * @param context a token context containing authorized scopes
-     * @param requiredScope the required scope
+     * @param context
+     *            a token context containing authorized scopes
+     * @param requiredScope
+     *            the required scope
      * @throws KustvaktException
      */
     void verifyScope (TokenContext context, OAuth2Scope requiredScope)
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2ScopeServiceImpl.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2ScopeServiceImpl.java
index f8430aa..acf236b 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2ScopeServiceImpl.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2ScopeServiceImpl.java
@@ -22,7 +22,8 @@
 import de.ids_mannheim.korap.oauth2.entity.AccessScope;
 import de.ids_mannheim.korap.security.context.TokenContext;
 
-/** Defines business logic related to OAuth2 scopes.
+/**
+ * Defines business logic related to OAuth2 scopes.
  * 
  * @author margaretha
  *
@@ -47,26 +48,24 @@
             throws KustvaktException {
 
         List<AccessScope> definedScopes = accessScopeDao.retrieveAccessScopes();
-        Set<AccessScope> requestedScopes =
-                new HashSet<AccessScope>(scopes.size());
+        Set<AccessScope> requestedScopes = new HashSet<AccessScope>(
+                scopes.size());
         int index;
         OAuth2Scope oauth2Scope = null;
         for (String scope : scopes) {
             try {
-                oauth2Scope =
-                        Enum.valueOf(OAuth2Scope.class, scope.toUpperCase());
+                oauth2Scope = Enum.valueOf(OAuth2Scope.class,
+                        scope.toUpperCase());
             }
             catch (IllegalArgumentException e) {
                 throw new KustvaktException(StatusCodes.INVALID_SCOPE,
-                        "Invalid scope",
-                        OAuth2Error.INVALID_SCOPE);
+                        "Invalid scope", OAuth2Error.INVALID_SCOPE);
             }
 
             index = definedScopes.indexOf(new AccessScope(oauth2Scope));
             if (index == -1) {
                 throw new KustvaktException(StatusCodes.INVALID_SCOPE,
-                        "Invalid scope",
-                        OAuth2Error.INVALID_SCOPE);
+                        "Invalid scope", OAuth2Error.INVALID_SCOPE);
             }
             else {
                 requestedScopes.add(definedScopes.get(index));
@@ -74,32 +73,30 @@
         }
         return requestedScopes;
     }
-    
+
     public Set<AccessScope> convertToAccessScope (String scopes)
             throws KustvaktException {
 
         String[] scopeArray = scopes.split("\\s+");
         List<AccessScope> definedScopes = accessScopeDao.retrieveAccessScopes();
-        Set<AccessScope> requestedScopes =
-                new HashSet<AccessScope>(scopeArray.length);
+        Set<AccessScope> requestedScopes = new HashSet<AccessScope>(
+                scopeArray.length);
         int index;
         OAuth2Scope oauth2Scope = null;
         for (String scope : scopeArray) {
             try {
-                oauth2Scope =
-                        Enum.valueOf(OAuth2Scope.class, scope.toUpperCase());
+                oauth2Scope = Enum.valueOf(OAuth2Scope.class,
+                        scope.toUpperCase());
             }
             catch (IllegalArgumentException e) {
                 throw new KustvaktException(StatusCodes.INVALID_SCOPE,
-                        "Invalid scope",
-                        OAuth2Error.INVALID_SCOPE);
+                        "Invalid scope", OAuth2Error.INVALID_SCOPE);
             }
 
             index = definedScopes.indexOf(new AccessScope(oauth2Scope));
             if (index == -1) {
                 throw new KustvaktException(StatusCodes.INVALID_SCOPE,
-                        "Invalid scope",
-                        OAuth2Error.INVALID_SCOPE);
+                        "Invalid scope", OAuth2Error.INVALID_SCOPE);
             }
             else {
                 requestedScopes.add(definedScopes.get(index));
@@ -131,9 +128,9 @@
     public Set<String> filterScopes (Set<String> scopes,
             Set<String> defaultScopes) {
         Stream<String> stream = scopes.stream();
-        Set<String> filteredScopes =
-                stream.filter(scope -> defaultScopes.contains(scope))
-                        .collect(Collectors.toSet());
+        Set<String> filteredScopes = stream
+                .filter(scope -> defaultScopes.contains(scope))
+                .collect(Collectors.toSet());
         return filteredScopes;
     }
 
@@ -147,7 +144,7 @@
             throw new KustvaktException(StatusCodes.AUTHORIZATION_FAILED,
                     "Authentication required. Please log in!");
         }
-        
+
         if (!adminDao.isAdmin(context.getUsername())
                 && context.getTokenType().equals(TokenType.BEARER)) {
             Map<String, Object> parameters = context.getParameters();
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2TokenService.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2TokenService.java
index 0af4df4..48faecd 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2TokenService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2TokenService.java
@@ -69,7 +69,7 @@
     protected FullConfiguration config;
     @Autowired
     private AuthenticationManager authenticationManager;
-    
+
     @Autowired
     private RandomCodeGenerator randomGenerator;
 
@@ -95,12 +95,12 @@
      * @return an authorization
      * @throws KustvaktException
      */
-    protected Authorization retrieveAuthorization (
-            String authorizationCode, String redirectURI, String clientId,
-            String clientSecret) throws KustvaktException {
+    protected Authorization retrieveAuthorization (String authorizationCode,
+            String redirectURI, String clientId, String clientSecret)
+            throws KustvaktException {
 
-        Authorization authorization =
-                authorizationService.retrieveAuthorization(authorizationCode);
+        Authorization authorization = authorizationService
+                .retrieveAuthorization(authorizationCode);
         try {
             clientService.authenticateClient(clientId, clientSecret);
             authorization = authorizationService
@@ -113,7 +113,6 @@
         return authorization;
     }
 
-
     public ZonedDateTime authenticateUser (String username, String password,
             Set<String> scopes) throws KustvaktException {
         if (username == null || username.isEmpty()) {
@@ -133,34 +132,32 @@
                 config.getOAuth2passwordAuthentication(), username, password,
                 attributes);
 
-        ZonedDateTime authenticationTime =
-                ZonedDateTime.now(ZoneId.of(Attributes.DEFAULT_TIME_ZONE));
+        ZonedDateTime authenticationTime = ZonedDateTime
+                .now(ZoneId.of(Attributes.DEFAULT_TIME_ZONE));
         return authenticationTime;
     }
 
-    public AccessTokenResponse requestAccessToken (
-            TokenRequest tokenRequest, String clientId, String clientSecret)
-            throws KustvaktException {
+    public AccessTokenResponse requestAccessToken (TokenRequest tokenRequest,
+            String clientId, String clientSecret) throws KustvaktException {
 
         AuthorizationGrant authGrant = tokenRequest.getAuthorizationGrant();
         GrantType grantType = authGrant.getType();
         Scope scope = tokenRequest.getScope();
         Set<String> scopeSet = new HashSet<>();
-        if (scope !=null)
+        if (scope != null)
             scopeSet.addAll(scope.toStringList());
-        
+
         if (grantType.equals(GrantType.AUTHORIZATION_CODE)) {
             AuthorizationCodeGrant codeGrant = (AuthorizationCodeGrant) authGrant;
             String authCode = codeGrant.getAuthorizationCode().getValue();
             URI uri = codeGrant.getRedirectionURI();
             String redirectionURI = (uri != null) ? uri.toString() : null;
-            
+
             return requestAccessTokenWithAuthorizationCode(authCode,
                     redirectionURI, clientId, clientSecret);
         }
         else if (grantType.equals(GrantType.PASSWORD)) {
-            ResourceOwnerPasswordCredentialsGrant passwordGrant =
-                    (ResourceOwnerPasswordCredentialsGrant) authGrant;
+            ResourceOwnerPasswordCredentialsGrant passwordGrant = (ResourceOwnerPasswordCredentialsGrant) authGrant;
             String username = passwordGrant.getUsername();
             String password = passwordGrant.getPassword().getValue();
             return requestAccessTokenWithPassword(clientId, clientSecret,
@@ -183,7 +180,6 @@
         }
 
     }
-    
 
     /**
      * Revokes all access token associated with the given refresh
@@ -207,8 +203,7 @@
      */
     private AccessTokenResponse requestAccessTokenWithRefreshToken (
             String refreshTokenStr, Set<String> requestScopes, String clientId,
-            String clientSecret)
-            throws KustvaktException {
+            String clientSecret) throws KustvaktException {
 
         if (refreshTokenStr == null || refreshTokenStr.isEmpty()) {
             throw new KustvaktException(StatusCodes.MISSING_PARAMETER,
@@ -216,7 +211,8 @@
                     OAuth2Error.INVALID_REQUEST);
         }
 
-        OAuth2Client oAuth2Client = clientService.authenticateClient(clientId, clientSecret);
+        OAuth2Client oAuth2Client = clientService.authenticateClient(clientId,
+                clientSecret);
 
         RefreshToken refreshToken;
         try {
@@ -243,11 +239,10 @@
                     "Refresh token is expired", OAuth2Error.INVALID_GRANT);
         }
 
-        Set<AccessScope> tokenScopes =
-                new HashSet<>(refreshToken.getScopes());
+        Set<AccessScope> tokenScopes = new HashSet<>(refreshToken.getScopes());
         if (requestScopes != null && !requestScopes.isEmpty()) {
-            tokenScopes =
-                    scopeService.verifyRefreshScope(requestScopes, tokenScopes);
+            tokenScopes = scopeService.verifyRefreshScope(requestScopes,
+                    tokenScopes);
             requestScopes = scopeService
                     .convertAccessScopesToStringSet(tokenScopes);
         }
@@ -283,11 +278,11 @@
      * @return an {@link AccessTokenResponse}
      * @throws KustvaktException
      */
-    private AccessTokenResponse requestAccessTokenWithAuthorizationCode (String code,
-            String redirectionURI, String clientId, String clientSecret)
-            throws KustvaktException {
-        Authorization authorization = retrieveAuthorization(code, redirectionURI,
-                clientId, clientSecret);
+    private AccessTokenResponse requestAccessTokenWithAuthorizationCode (
+            String code, String redirectionURI, String clientId,
+            String clientSecret) throws KustvaktException {
+        Authorization authorization = retrieveAuthorization(code,
+                redirectionURI, clientId, clientSecret);
 
         Set<String> scopes = scopeService
                 .convertAccessScopesToStringSet(authorization.getScopes());
@@ -330,8 +325,8 @@
             String clientSecret, String username, String password,
             Set<String> scopes) throws KustvaktException {
 
-        OAuth2Client client =
-                clientService.authenticateClient(clientId, clientSecret);
+        OAuth2Client client = clientService.authenticateClient(clientId,
+                clientSecret);
         if (!client.isSuper()) {
             throw new KustvaktException(StatusCodes.CLIENT_AUTHORIZATION_FAILED,
                     "Password grant is not allowed for third party clients",
@@ -344,24 +339,25 @@
             // scopes = config.getDefaultAccessScopes();
         }
 
-        ZonedDateTime authenticationTime =
-                authenticateUser(username, password, scopes);
+        ZonedDateTime authenticationTime = authenticateUser(username, password,
+                scopes);
 
-        Set<AccessScope> accessScopes =
-                scopeService.convertToAccessScope(scopes);
-        
+        Set<AccessScope> accessScopes = scopeService
+                .convertToAccessScope(scopes);
+
         if (config.getOAuth2passwordAuthentication()
                 .equals(AuthenticationMethod.LDAP)) {
             try {
                 //username = LdapAuth3.getEmail(username, config.getLdapConfig());
-                username = LdapAuth3.getUsername(username, config.getLdapConfig());
+                username = LdapAuth3.getUsername(username,
+                        config.getLdapConfig());
             }
             catch (LDAPException e) {
                 throw new KustvaktException(StatusCodes.LDAP_BASE_ERRCODE,
                         e.getExceptionMessage());
             }
         }
-        
+
         return createsAccessTokenResponse(scopes, accessScopes, clientId,
                 username, authenticationTime, client);
     }
@@ -391,7 +387,8 @@
         }
 
         // OAuth2Client client =
-        OAuth2Client oAuth2Client = clientService.authenticateClient(clientId, clientSecret);
+        OAuth2Client oAuth2Client = clientService.authenticateClient(clientId,
+                clientSecret);
 
         // if (!client.isNative()) {
         // throw new KustvaktException(
@@ -401,15 +398,15 @@
         // OAuth2Error.UNAUTHORIZED_CLIENT);
         // }
 
-        ZonedDateTime authenticationTime =
-                ZonedDateTime.now(ZoneId.of(Attributes.DEFAULT_TIME_ZONE));
+        ZonedDateTime authenticationTime = ZonedDateTime
+                .now(ZoneId.of(Attributes.DEFAULT_TIME_ZONE));
 
         scopes = scopeService.filterScopes(scopes,
                 config.getClientCredentialsScopes());
-        Set<AccessScope> accessScopes =
-                scopeService.convertToAccessScope(scopes);
+        Set<AccessScope> accessScopes = scopeService
+                .convertToAccessScope(scopes);
         return createsAccessTokenResponse(scopes, accessScopes, clientId, null,
-                authenticationTime,oAuth2Client);
+                authenticationTime, oAuth2Client);
     }
 
     /**
@@ -420,8 +417,10 @@
      * Base64.
      * 
      * <br /><br />
-     * Additionally, a refresh token is issued for confidential clients. 
-     * It can be used to request a new access token without requiring user
+     * Additionally, a refresh token is issued for confidential
+     * clients.
+     * It can be used to request a new access token without requiring
+     * user
      * re-authentication.
      * 
      * @param scopes
@@ -446,7 +445,7 @@
 
         String random = randomGenerator.createRandomCode();
         random += randomGenerator.createRandomCode();
-        
+
         if (clientService.isPublicClient(client)) {
             // refresh token == null, getAccessTokenLongExpiry
             return createsAccessTokenResponse(null, scopes, accessScopes,
@@ -468,30 +467,29 @@
             ZonedDateTime authenticationTime) throws KustvaktException {
 
         String accessToken = randomGenerator.createRandomCode();
-        accessToken +=randomGenerator.createRandomCode();
+        accessToken += randomGenerator.createRandomCode();
         tokenDao.storeAccessToken(accessToken, refreshToken, accessScopes,
                 userId, clientId, authenticationTime);
 
         Tokens tokens = null;
-        if (refreshToken !=null) {
+        if (refreshToken != null) {
             BearerAccessToken bearerToken = new BearerAccessToken(accessToken,
                     (long) config.getAccessTokenExpiry(), Scope.parse(scopes));
-            com.nimbusds.oauth2.sdk.token.RefreshToken rf =
-                    new com.nimbusds.oauth2.sdk.token.RefreshToken(
-                            refreshToken.getToken());
+            com.nimbusds.oauth2.sdk.token.RefreshToken rf = new com.nimbusds.oauth2.sdk.token.RefreshToken(
+                    refreshToken.getToken());
             tokens = new Tokens(bearerToken, rf);
         }
         else {
-              BearerAccessToken bearerToken = new BearerAccessToken(accessToken,
-              (long) config.getAccessTokenLongExpiry(), Scope.parse(scopes));
-              tokens = new Tokens(bearerToken, null);
+            BearerAccessToken bearerToken = new BearerAccessToken(accessToken,
+                    (long) config.getAccessTokenLongExpiry(),
+                    Scope.parse(scopes));
+            tokens = new Tokens(bearerToken, null);
         }
         return new AccessTokenResponse(tokens);
-    }        
+    }
 
-
-    public void revokeToken (String clientId, String clientSecret,
-            String token, String tokenType) throws KustvaktException {
+    public void revokeToken (String clientId, String clientSecret, String token,
+            String tokenType) throws KustvaktException {
         clientService.authenticateClient(clientId, clientSecret);
         if (tokenType != null && tokenType.equals("refresh_token")) {
             if (!revokeRefreshToken(token)) {
@@ -518,10 +516,10 @@
             throw e;
         }
     }
-    
+
     private void revokeAccessToken (AccessToken accessToken)
             throws KustvaktException {
-        if (accessToken != null){
+        if (accessToken != null) {
             accessToken.setRevoked(true);
             tokenDao.updateAccessToken(accessToken);
         }
@@ -541,10 +539,10 @@
 
     public boolean revokeRefreshToken (RefreshToken refreshToken)
             throws KustvaktException {
-        if (refreshToken != null){
+        if (refreshToken != null) {
             refreshToken.setRevoked(true);
             refreshDao.updateRefreshToken(refreshToken);
-    
+
             Set<AccessToken> accessTokenList = refreshToken.getAccessTokens();
             for (AccessToken accessToken : accessTokenList) {
                 accessToken.setRevoked(true);
@@ -567,13 +565,13 @@
 
         revokeAllClientTokensForUser(clientId, username);
     }
-    
+
     public void revokeAllClientTokensForUser (String clientId, String username)
             throws KustvaktException {
         OAuth2Client client = clientService.retrieveClient(clientId);
         if (clientService.isPublicClient(client)) {
-            List<AccessToken> accessTokens =
-                    tokenDao.retrieveAccessTokenByClientId(clientId, username);
+            List<AccessToken> accessTokens = tokenDao
+                    .retrieveAccessTokenByClientId(clientId, username);
             for (AccessToken t : accessTokens) {
                 revokeAccessToken(t);
             }
@@ -586,7 +584,7 @@
             }
         }
     }
-    
+
     public void revokeTokensViaSuperClient (String username,
             String superClientId, String superClientSecret, String token)
             throws KustvaktException {
@@ -597,30 +595,33 @@
                     StatusCodes.CLIENT_AUTHENTICATION_FAILED);
         }
 
-        RefreshToken refreshToken =
-                refreshDao.retrieveRefreshToken(token, username);
+        RefreshToken refreshToken = refreshDao.retrieveRefreshToken(token,
+                username);
         if (!revokeRefreshToken(refreshToken)) {
-            AccessToken accessToken =
-                    tokenDao.retrieveAccessToken(token, username);
+            AccessToken accessToken = tokenDao.retrieveAccessToken(token,
+                    username);
             revokeAccessToken(accessToken);
         }
     }
-    
-    public List<OAuth2TokenDto> listUserRefreshToken (String username, String superClientId,
-            String superClientSecret, String clientId) throws KustvaktException {
-        
-        OAuth2Client client = clientService.authenticateClient(superClientId, superClientSecret);
+
+    public List<OAuth2TokenDto> listUserRefreshToken (String username,
+            String superClientId, String superClientSecret, String clientId)
+            throws KustvaktException {
+
+        OAuth2Client client = clientService.authenticateClient(superClientId,
+                superClientSecret);
         if (!client.isSuper()) {
             throw new KustvaktException(StatusCodes.CLIENT_AUTHORIZATION_FAILED,
                     "Only super client is allowed.",
                     OAuth2Error.UNAUTHORIZED_CLIENT);
         }
 
-        List<RefreshToken> tokens = refreshDao.retrieveRefreshTokenByUser(username, clientId);
+        List<RefreshToken> tokens = refreshDao
+                .retrieveRefreshTokenByUser(username, clientId);
         List<OAuth2TokenDto> dtoList = new ArrayList<>(tokens.size());
-        for (RefreshToken t : tokens){
+        for (RefreshToken t : tokens) {
             OAuth2Client tokenClient = t.getClient();
-            if (tokenClient.getId().equals(client.getId())){
+            if (tokenClient.getId().equals(client.getId())) {
                 continue;
             }
             OAuth2TokenDto dto = new OAuth2TokenDto();
@@ -628,19 +629,20 @@
             dto.setClientName(tokenClient.getName());
             dto.setClientUrl(tokenClient.getUrl());
             dto.setClientDescription(tokenClient.getDescription());
-            
+
             DateTimeFormatter f = DateTimeFormatter.ISO_DATE_TIME;
             dto.setCreatedDate(t.getCreatedDate().format(f));
-            long difference = ChronoUnit.SECONDS.between(ZonedDateTime.now(), t.getExpiryDate());
+            long difference = ChronoUnit.SECONDS.between(ZonedDateTime.now(),
+                    t.getExpiryDate());
             dto.setExpiresIn(difference);
-            
+
             dto.setUserAuthenticationTime(
                     t.getUserAuthenticationTime().format(f));
             dto.setToken(t.getToken());
-            
+
             Set<AccessScope> accessScopes = t.getScopes();
             Set<String> scopes = new HashSet<>(accessScopes.size());
-            for (AccessScope s : accessScopes){
+            for (AccessScope s : accessScopes) {
                 scopes.add(s.getId().toString());
             }
             dto.setScope(scopes);
@@ -648,23 +650,25 @@
         }
         return dtoList;
     }
-    
-    public List<OAuth2TokenDto> listUserAccessToken (String username, String superClientId,
-            String superClientSecret, String clientId) throws KustvaktException {
-        
-        OAuth2Client superClient = clientService.authenticateClient(superClientId, superClientSecret);
+
+    public List<OAuth2TokenDto> listUserAccessToken (String username,
+            String superClientId, String superClientSecret, String clientId)
+            throws KustvaktException {
+
+        OAuth2Client superClient = clientService
+                .authenticateClient(superClientId, superClientSecret);
         if (!superClient.isSuper()) {
             throw new KustvaktException(StatusCodes.CLIENT_AUTHORIZATION_FAILED,
                     "Only super client is allowed.",
                     OAuth2Error.UNAUTHORIZED_CLIENT);
         }
 
-        List<AccessToken> tokens =
-                tokenDao.retrieveAccessTokenByUser(username, clientId);
+        List<AccessToken> tokens = tokenDao.retrieveAccessTokenByUser(username,
+                clientId);
         List<OAuth2TokenDto> dtoList = new ArrayList<>(tokens.size());
-        for (AccessToken t : tokens){
+        for (AccessToken t : tokens) {
             OAuth2Client tokenClient = t.getClient();
-            if (tokenClient.getId().equals(superClient.getId())){
+            if (tokenClient.getId().equals(superClient.getId())) {
                 continue;
             }
             OAuth2TokenDto dto = new OAuth2TokenDto();
@@ -672,20 +676,21 @@
             dto.setClientName(tokenClient.getName());
             dto.setClientUrl(tokenClient.getUrl());
             dto.setClientDescription(tokenClient.getDescription());
-            
+
             DateTimeFormatter f = DateTimeFormatter.ISO_DATE_TIME;
             dto.setCreatedDate(t.getCreatedDate().format(f));
-            
-            long difference = ChronoUnit.SECONDS.between(ZonedDateTime.now(), t.getExpiryDate());
+
+            long difference = ChronoUnit.SECONDS.between(ZonedDateTime.now(),
+                    t.getExpiryDate());
             dto.setExpiresIn(difference);
-                    
+
             dto.setUserAuthenticationTime(
                     t.getUserAuthenticationTime().format(f));
             dto.setToken(t.getToken());
-            
+
             Set<AccessScope> accessScopes = t.getScopes();
             Set<String> scopes = new HashSet<>(accessScopes.size());
-            for (AccessScope s : accessScopes){
+            for (AccessScope s : accessScopes) {
                 scopes.add(s.getId().toString());
             }
             dto.setScope(scopes);
diff --git a/full/src/main/java/de/ids_mannheim/korap/rewrite/CollectionCleanRewrite.java b/full/src/main/java/de/ids_mannheim/korap/rewrite/CollectionCleanRewrite.java
index 530eb86..f827871 100644
--- a/full/src/main/java/de/ids_mannheim/korap/rewrite/CollectionCleanRewrite.java
+++ b/full/src/main/java/de/ids_mannheim/korap/rewrite/CollectionCleanRewrite.java
@@ -9,7 +9,9 @@
 import de.ids_mannheim.korap.user.User;
 import edu.emory.mathcs.backport.java.util.Arrays;
 
-/** EM: not used anymore. This rewrite was to remove an empty koral:doc group in operands.
+/**
+ * EM: not used anymore. This rewrite was to remove an empty koral:doc
+ * group in operands.
  * 
  * @author hanl
  * @date 28/07/2015
@@ -23,7 +25,6 @@
         return node.wrapNode(jsonNode);
     }
 
-
     private JsonNode process (JsonNode root) {
         JsonNode sub = root;
         if (root.isObject()) {
@@ -50,8 +51,8 @@
             if (!root.equals(sub)) {
                 if (sub.isObject()) {
                     ObjectNode ob = (ObjectNode) root;
-                    ob.remove(Arrays.asList(new String[] { "@type",
-                            "operation", "operands" }));
+                    ob.remove(Arrays.asList(
+                            new String[] { "@type", "operation", "operands" }));
                     ob.putAll((ObjectNode) sub);
                 }
             }
@@ -59,13 +60,11 @@
         return root;
     }
 
-
     @Override
     public JsonNode rewriteResult (KoralNode node) {
         return null;
     }
 
-
     @Override
     public String at () {
         return "/collection";
diff --git a/full/src/main/java/de/ids_mannheim/korap/rewrite/CollectionConstraint.java b/full/src/main/java/de/ids_mannheim/korap/rewrite/CollectionConstraint.java
index 1ce9893..d2d3610 100644
--- a/full/src/main/java/de/ids_mannheim/korap/rewrite/CollectionConstraint.java
+++ b/full/src/main/java/de/ids_mannheim/korap/rewrite/CollectionConstraint.java
@@ -6,8 +6,9 @@
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
 import de.ids_mannheim.korap.user.User;
 
-/** EM: not used anymore. This rewrite was meant to remove doc from 
- * a collection by checking user access to the doc.  
+/**
+ * EM: not used anymore. This rewrite was meant to remove doc from
+ * a collection by checking user access to the doc.
  * 
  * @author hanl
  * @date 03/07/2015
@@ -21,46 +22,43 @@
             if (node.get("key").equals(Attributes.CORPUS_SIGLE)) {
                 String id = node.get("value");
                 // EM: MH checks if user has access to corpus
-//                KustvaktResource corpus = check(id, user);
-//                if (corpus == null)
-                    node.removeNode(new KoralNode.RewriteIdentifier(
-                            Attributes.CORPUS_SIGLE, id));
+                //                KustvaktResource corpus = check(id, user);
+                //                if (corpus == null)
+                node.removeNode(new KoralNode.RewriteIdentifier(
+                        Attributes.CORPUS_SIGLE, id));
             }
         }
         return node;
     }
 
-
     /**
      * @param id
      * @param user
      * @return boolean if true access granted
      */
-//    @Deprecated
-//    private KustvaktResource check (String id, User user) {
-//        // todo: can be used to circumvent access control if public filter not applied
-//        if (user == null)
-//            return null;
-//
-//        KustvaktResource corpus;
-//        try {
-//            SecurityManager m = SecurityManager
-//                    .findbyId(id, user, Corpus.class);
-//            corpus = m.getResource();
-//        }
-//        catch (RuntimeException | KustvaktException e) {
-//            return null;
-//        }
-//        return corpus;
-//    }
-
+    //    @Deprecated
+    //    private KustvaktResource check (String id, User user) {
+    //        // todo: can be used to circumvent access control if public filter not applied
+    //        if (user == null)
+    //            return null;
+    //
+    //        KustvaktResource corpus;
+    //        try {
+    //            SecurityManager m = SecurityManager
+    //                    .findbyId(id, user, Corpus.class);
+    //            corpus = m.getResource();
+    //        }
+    //        catch (RuntimeException | KustvaktException e) {
+    //            return null;
+    //        }
+    //        return corpus;
+    //    }
 
     @Override
     public JsonNode rewriteResult (KoralNode node) {
         return null;
     }
 
-
     @Override
     public String path () {
         return "collection";
diff --git a/full/src/main/java/de/ids_mannheim/korap/rewrite/CollectionRewrite.java b/full/src/main/java/de/ids_mannheim/korap/rewrite/CollectionRewrite.java
index 43681bd..0c3ee07 100644
--- a/full/src/main/java/de/ids_mannheim/korap/rewrite/CollectionRewrite.java
+++ b/full/src/main/java/de/ids_mannheim/korap/rewrite/CollectionRewrite.java
@@ -1,6 +1,5 @@
 package de.ids_mannheim.korap.rewrite;
 
-
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -23,39 +22,40 @@
 import de.ids_mannheim.korap.utils.JsonUtils;
 import de.ids_mannheim.korap.utils.KoralCollectionQueryBuilder;
 
-/** CollectionRewrite determines which availability field values are 
- *  possible for a user with respect to his mean and location of access.
- *  
- *  <br/><br/>
- *  KorAP differentiates 3 kinds of access:
- *  <ul>
- *      <li>FREE: without login</li> 
- *      <li>PUB: login outside IDS network</li> 
- *      <li>ALL: login within IDS network</li> 
- *  </ul>
- *  
- *  Each of these accesses corresponds to a regular expression of license 
- *  formats defined in kustvakt.conf. For a given access, only those 
- *  resources whose availability field matches its regular expression 
- *  are allowed to be retrieved. 
- *  
- *  
+/**
+ * CollectionRewrite determines which availability field values are
+ * possible for a user with respect to his mean and location of
+ * access.
+ * 
+ * <br/><br/>
+ * KorAP differentiates 3 kinds of access:
+ * <ul>
+ * <li>FREE: without login</li>
+ * <li>PUB: login outside IDS network</li>
+ * <li>ALL: login within IDS network</li>
+ * </ul>
+ * 
+ * Each of these accesses corresponds to a regular expression of
+ * license
+ * formats defined in kustvakt.conf. For a given access, only those
+ * resources whose availability field matches its regular expression
+ * are allowed to be retrieved.
+ * 
+ * 
  * @author margaretha
  * @last-update 21 Nov 2017
  * @see CorpusAccess
  */
 public class CollectionRewrite implements RewriteTask.RewriteQuery {
 
-    public static Logger jlog =
-            LogManager.getLogger(CollectionRewrite.class);
+    public static Logger jlog = LogManager.getLogger(CollectionRewrite.class);
 
     public static boolean DEBUG = false;
-    
+
     public CollectionRewrite () {
         super();
     }
 
-
     private List<String> checkAvailability (JsonNode node,
             List<String> originalAvailabilities,
             List<String> updatedAvailabilities, boolean isOperationOr) {
@@ -69,8 +69,8 @@
         }
 
         if (node.has("operands")) {
-            ArrayList<JsonNode> operands =
-                    Lists.newArrayList(node.at("/operands").elements());
+            ArrayList<JsonNode> operands = Lists
+                    .newArrayList(node.at("/operands").elements());
 
             if (node.at("/operation").asText()
                     .equals(KoralOperation.AND.toString())) {
@@ -78,7 +78,8 @@
                     updatedAvailabilities = checkAvailability(operands.get(i),
                             originalAvailabilities, updatedAvailabilities,
                             false);
-                    if (updatedAvailabilities.isEmpty()) break;
+                    if (updatedAvailabilities.isEmpty())
+                        break;
                 }
             }
             else {
@@ -113,7 +114,7 @@
                 updatedAvailabilities.remove(queryAvailability);
             }
             else if (isOperationOr) {
-                if (DEBUG) { 
+                if (DEBUG) {
                     jlog.debug("RESET availabilities 2");
                 }
                 updatedAvailabilities.clear();
@@ -153,8 +154,8 @@
         JsonNode rewrittenNode;
 
         if (jsonNode.has("collection")) {
-            List<String> avalabilityCopy =
-                    new ArrayList<String>(userAvailabilities.size());
+            List<String> avalabilityCopy = new ArrayList<String>(
+                    userAvailabilities.size());
             avalabilityCopy.addAll(userAvailabilities);
             if (DEBUG) {
                 jlog.debug("Availabilities: "
@@ -178,20 +179,19 @@
             if (DEBUG) {
                 jlog.debug("corpus query: " + builder.toString());
             }
-            rewrittenNode =
-                    JsonUtils.readTree(builder.toJSON()).at("/collection");
+            rewrittenNode = JsonUtils.readTree(builder.toJSON())
+                    .at("/collection");
             node.set("collection", rewrittenNode, identifier);
         }
 
         node = node.at("/collection");
-        if (DEBUG) { 
+        if (DEBUG) {
             jlog.debug("REWRITES: " + node.toString());
         }
-        
+
         return node;
     }
 
-
     private String buildAvailability (List<String> userAvailabilities) {
         StringBuilder sb = new StringBuilder();
         for (int i = 0; i < userAvailabilities.size(); i++) {
@@ -229,4 +229,3 @@
     }
 
 }
-
diff --git a/full/src/main/java/de/ids_mannheim/korap/rewrite/FoundryInject.java b/full/src/main/java/de/ids_mannheim/korap/rewrite/FoundryInject.java
index 9146e5f..73615e0 100644
--- a/full/src/main/java/de/ids_mannheim/korap/rewrite/FoundryInject.java
+++ b/full/src/main/java/de/ids_mannheim/korap/rewrite/FoundryInject.java
@@ -18,28 +18,30 @@
 
     @Autowired
     protected LayerMapper mapper;
-    
+
     @Override
     public KoralNode rewriteQuery (KoralNode node, KustvaktConfiguration config,
             User user) throws KustvaktException {
-        
+
         if (node.get("@type").equals("koral:span")) {
-            if (!node.isMissingNode("/wrap")){
+            if (!node.isMissingNode("/wrap")) {
                 node = node.at("/wrap");
                 JsonNode term = rewriteQuery(node, config, user).rawNode();
-                node.replaceAt("/wrap", term, new RewriteIdentifier("koral:term", "replace"));
+                node.replaceAt("/wrap", term,
+                        new RewriteIdentifier("koral:term", "replace"));
             }
         }
-        else if (node.get("@type").equals("koral:term") && !node.has("foundry")) {
+        else if (node.get("@type").equals("koral:term")
+                && !node.has("foundry")) {
             String layer;
-            if (node.has("layer")){
+            if (node.has("layer")) {
                 layer = node.get("layer");
             }
-            else{
+            else {
                 layer = node.get("key");
             }
             UserSettingProcessor settingProcessor = null;
-            if (user!=null){
+            if (user != null) {
                 settingProcessor = user.getUserSettingProcessor();
             }
             String foundry = mapper.findFoundry(layer, settingProcessor);
@@ -54,7 +56,6 @@
         return "query";
     }
 
-
     @Override
     public JsonNode rewriteResult (KoralNode node) {
         return null;
diff --git a/full/src/main/java/de/ids_mannheim/korap/rewrite/FoundryRewrite.java b/full/src/main/java/de/ids_mannheim/korap/rewrite/FoundryRewrite.java
index 60beaaf..c59097c 100644
--- a/full/src/main/java/de/ids_mannheim/korap/rewrite/FoundryRewrite.java
+++ b/full/src/main/java/de/ids_mannheim/korap/rewrite/FoundryRewrite.java
@@ -21,11 +21,10 @@
     public KoralNode rewriteQuery (KoralNode node, KustvaktConfiguration config,
             User user) throws KustvaktException {
         String username = user.getUsername();
-        String jsonSettings =
-                settingService.retrieveDefaultSettings(username);
+        String jsonSettings = settingService.retrieveDefaultSettings(username);
         if (jsonSettings != null) {
-            UserSettingProcessor processor =
-                    new UserSettingProcessor(jsonSettings);
+            UserSettingProcessor processor = new UserSettingProcessor(
+                    jsonSettings);
             user.setUserSettingProcessor(processor);
         }
         return super.rewriteQuery(node, config, user);
diff --git a/full/src/main/java/de/ids_mannheim/korap/rewrite/IdWriter.java b/full/src/main/java/de/ids_mannheim/korap/rewrite/IdWriter.java
index 1f0dad6..113c176 100644
--- a/full/src/main/java/de/ids_mannheim/korap/rewrite/IdWriter.java
+++ b/full/src/main/java/de/ids_mannheim/korap/rewrite/IdWriter.java
@@ -14,12 +14,10 @@
 
     private int counter;
 
-
     public IdWriter () {
         this.counter = 0;
     }
 
-
     @Override
     public KoralNode rewriteQuery (KoralNode node, KustvaktConfiguration config,
             User user) {
@@ -31,7 +29,6 @@
         return node;
     }
 
-
     private String extractToken (JsonNode token) {
         JsonNode wrap = token.path("wrap");
         if (!wrap.isMissingNode())
diff --git a/full/src/main/java/de/ids_mannheim/korap/rewrite/KoralNode.java b/full/src/main/java/de/ids_mannheim/korap/rewrite/KoralNode.java
index a8870b7..f05f864 100644
--- a/full/src/main/java/de/ids_mannheim/korap/rewrite/KoralNode.java
+++ b/full/src/main/java/de/ids_mannheim/korap/rewrite/KoralNode.java
@@ -16,40 +16,35 @@
     private KoralRewriteBuilder rewrites;
     private boolean remove;
 
-
     public KoralNode (JsonNode node) {
         this.node = node;
         this.rewrites = new KoralRewriteBuilder();
         this.remove = false;
     }
-    
+
     public KoralNode (JsonNode node, KoralRewriteBuilder rewrites) {
         this.node = node;
         this.rewrites = rewrites;
         this.remove = false;
     }
 
-
     public static KoralNode wrapNode (JsonNode node) {
         return new KoralNode(node);
     }
-    
+
     public void buildRewrites (JsonNode node) {
         this.rewrites.build(node);
     }
 
-
     public void buildRewrites () {
         this.rewrites.build(this.node);
     }
 
-
     @Override
     public String toString () {
         return this.node.toString();
     }
 
-
     public void put (String name, Object value) {
         if (this.node.isObject() && this.node.path(name).isMissingNode()) {
             ObjectNode node = (ObjectNode) this.node;
@@ -66,7 +61,6 @@
                     "node doesn't support this operation");
     }
 
-
     public void remove (Object identifier, RewriteIdentifier ident) {
         boolean set = false;
         if (this.node.isObject() && identifier instanceof String) {
@@ -88,7 +82,6 @@
         }
     }
 
-
     public void replace (String name, Object value, RewriteIdentifier ident) {
         if (this.node.isObject() && this.node.has(name)) {
             ObjectNode n = (ObjectNode) this.node;
@@ -105,12 +98,12 @@
             this.rewrites.add("override", name);
         }
     }
-    
+
     public void replaceAt (String path, Object value, RewriteIdentifier ident) {
         if (this.node.isObject() && !this.node.at(path).isMissingNode()) {
             ObjectNode n = (ObjectNode) this.node.at(path);
             n.removeAll();
-            n.putAll((ObjectNode)value);
+            n.putAll((ObjectNode) value);
 
             String name = path;
             if (ident != null)
@@ -130,7 +123,6 @@
             else if (value instanceof JsonNode)
                 n.put(name, (JsonNode) value);
 
-
             if (ident != null)
                 name = ident.toString();
 
@@ -143,7 +135,7 @@
             ObjectNode n = (ObjectNode) this.node;
             n.setAll(other);
         }
-        this.rewrites.add("insertion",null);
+        this.rewrites.add("insertion", null);
     }
 
     public String get (String name) {
@@ -152,14 +144,12 @@
         return null;
     }
 
-
     public KoralNode at (String name) {
-//        this.node = this.node.at(name);
-//        return this;
+        //        this.node = this.node.at(name);
+        //        return this;
         return new KoralNode(this.node.at(name), this.rewrites);
     }
 
-
     public boolean has (Object ident) {
         if (ident instanceof String)
             return this.node.has((String) ident);
@@ -168,12 +158,10 @@
         return false;
     }
 
-
     public JsonNode rawNode () {
         return this.node;
     }
 
-
     public void removeNode (RewriteIdentifier ident) {
         this.rewrites.add("deletion", ident.toString());
         this.remove = true;
@@ -183,48 +171,40 @@
 
         private String key, value;
 
-
         public RewriteIdentifier (String key, Object value) {
             this.key = key;
             this.value = value.toString();
         }
 
-
         @Override
         public String toString () {
             return key + "(" + value + ")";
         }
 
-
     }
 
-
     public boolean isRemove () {
         return this.remove;
     }
 
-
     public static class KoralRewriteBuilder {
 
         private List<KoralRewrite> rewrites;
 
-
         public KoralRewriteBuilder () {
             this.rewrites = new ArrayList<>();
         }
 
-
         public KoralRewriteBuilder add (String op, Object scope) {
             KoralRewrite rewrite = new KoralRewrite();
             rewrite.setOperation(op);
-            if (scope !=null){
+            if (scope != null) {
                 rewrite.setScope(scope.toString());
             }
             this.rewrites.add(rewrite);
             return this;
         }
 
-
         public JsonNode build (JsonNode node) {
             for (KoralRewrite rewrite : this.rewrites) {
                 if (rewrite.map.get("operation") == null)
@@ -252,20 +232,16 @@
 
     }
 
-
-
     private static class KoralRewrite {
 
         private Map<String, String> map;
 
-
         private KoralRewrite () {
             this.map = new LinkedHashMap<>();
             this.map.put("@type", "koral:rewrite");
             this.map.put("src", "Kustvakt");
         }
 
-
         public KoralRewrite setOperation (String op) {
             if (!op.startsWith("operation:"))
                 op = "operation:" + op;
@@ -273,7 +249,6 @@
             return this;
         }
 
-
         public KoralRewrite setScope (String scope) {
             this.map.put("scope", scope);
             return this;
@@ -281,21 +256,17 @@
 
     }
 
-
     public boolean isMissingNode (String string) {
         return this.node.at(string).isMissingNode();
     }
 
-
     public int size () {
         return this.node.size();
     }
 
-
     public KoralNode get (int i) {
-//        this.node = this.node.get(i);
+        //        this.node = this.node.get(i);
         return this.wrapNode(this.node.get(i));
     }
-    
-    
+
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/rewrite/LayerMapper.java b/full/src/main/java/de/ids_mannheim/korap/rewrite/LayerMapper.java
index 29360d9..59eb614 100644
--- a/full/src/main/java/de/ids_mannheim/korap/rewrite/LayerMapper.java
+++ b/full/src/main/java/de/ids_mannheim/korap/rewrite/LayerMapper.java
@@ -7,11 +7,13 @@
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
 import de.ids_mannheim.korap.user.UserSettingProcessor;
 
-/** EM:
- *  <ul>
- *  <li> Added default morphology foundry </li>
- *  <li> Made this class as a spring component</li>
- *  </ul>
+/**
+ * EM:
+ * <ul>
+ * <li> Added default morphology foundry </li>
+ * <li> Made this class as a spring component</li>
+ * </ul>
+ * 
  * @author hanl, margaretha
  * @date 14/10/2014
  */
@@ -55,10 +57,10 @@
                 // EM: added
                 case "s":
                     return (String) settings
-                            .get(Attributes.DEFAULT_FOUNDRY_STRUCTURE);    
+                            .get(Attributes.DEFAULT_FOUNDRY_STRUCTURE);
                 case "morphology":
                     return (String) settings
-                            .get(Attributes.DEFAULT_FOUNDRY_MORPHOLOGY);    
+                            .get(Attributes.DEFAULT_FOUNDRY_MORPHOLOGY);
                 default:
                     // if the layer is not in this specific listing, assume a default layer
                     // like orth or other tokenization layers
@@ -77,7 +79,7 @@
                     return config.getDefault_lemma();
                 case "surface":
                     return config.getDefault_orthography();
-                    // refers to "structure" and is used for paragraphs or sentence boundaries
+                // refers to "structure" and is used for paragraphs or sentence boundaries
                 case "s":
                     return config.getDefaultStructureFoundry();
                 //EM: added
@@ -91,23 +93,22 @@
         }
     }
 
-
     // relevance: map to access control id references. p is usually mapped to pos, l to lemma, etc.
     public String translateLayer (String layer) {
         switch (layer.toLowerCase().trim()) {
-        //            case "pos":
-        //                return "p";
-        //            case "lemma":
-        //                return "l";
+            //            case "pos":
+            //                return "p";
+            //            case "lemma":
+            //                return "l";
             case "m":
                 return "morphology"; // EM: changed msd to morphology
-//                return "msd";
-                //todo the orth layer does not need a foundry entry
+            //                return "msd";
+            //todo the orth layer does not need a foundry entry
             case "orth":
                 return "surface";
             // EM: layer t does not exist at all   
-//            case "t":
-//                return "surface";
+            //            case "t":
+            //                return "surface";
             // EM: this islegacy support    
             case "const":
                 return "c";
diff --git a/full/src/main/java/de/ids_mannheim/korap/rewrite/MetaConstraint.java b/full/src/main/java/de/ids_mannheim/korap/rewrite/MetaConstraint.java
index a9380b9..2838f67 100644
--- a/full/src/main/java/de/ids_mannheim/korap/rewrite/MetaConstraint.java
+++ b/full/src/main/java/de/ids_mannheim/korap/rewrite/MetaConstraint.java
@@ -11,7 +11,6 @@
  */
 public class MetaConstraint implements RewriteTask.RewriteNodeAt {
 
-
     @Override
     public KoralNode rewriteQuery (KoralNode node, KustvaktConfiguration config,
             User user) {
@@ -24,13 +23,11 @@
         return node;
     }
 
-
     @Override
     public JsonNode rewriteResult (KoralNode node) {
         return null;
     }
 
-
     @Override
     public String at () {
         return "/meta";
diff --git a/full/src/main/java/de/ids_mannheim/korap/rewrite/QueryReferenceRewrite.java b/full/src/main/java/de/ids_mannheim/korap/rewrite/QueryReferenceRewrite.java
index f14bf56..9521c72 100644
--- a/full/src/main/java/de/ids_mannheim/korap/rewrite/QueryReferenceRewrite.java
+++ b/full/src/main/java/de/ids_mannheim/korap/rewrite/QueryReferenceRewrite.java
@@ -20,7 +20,7 @@
  * Rewrites query reference with the corresponding koral
  * query describing the actual query fragment.
  * 
- * Based on VirtualCorpusRewrite. 
+ * Based on VirtualCorpusRewrite.
  *
  * @author diewald, margaretha
  *
@@ -32,9 +32,8 @@
     private QueryService service;
 
     @Override
-    public KoralNode rewriteQuery (KoralNode node,
-                                   KustvaktConfiguration config,
-                                   User user) throws KustvaktException {
+    public KoralNode rewriteQuery (KoralNode node, KustvaktConfiguration config,
+            User user) throws KustvaktException {
         if (node.has("query")) {
             node = node.at("/query");
             findQueryRef(user.getUsername(), node);
@@ -43,14 +42,13 @@
     }
 
     private void findQueryRef (String username, KoralNode koralNode)
-        throws KustvaktException {
+            throws KustvaktException {
         if (koralNode.has("@type")
-            && koralNode.get("@type").equals("koral:queryRef")) {
+                && koralNode.get("@type").equals("koral:queryRef")) {
             if (!koralNode.has("ref")) {
                 throw new KustvaktException(
-                    de.ids_mannheim.korap.util.StatusCodes.MISSING_QUERY_REFERENCE,
-                    "ref is not found"
-                    );
+                        de.ids_mannheim.korap.util.StatusCodes.MISSING_QUERY_REFERENCE,
+                        "ref is not found");
             }
             else {
                 String queryRefName = koralNode.get("ref");
@@ -63,8 +61,8 @@
                     }
                 }
 
-                QueryDO qr = service.searchQueryByName(username,
-                        queryRefName, queryRefOwner, QueryType.QUERY);
+                QueryDO qr = service.searchQueryByName(username, queryRefName,
+                        queryRefOwner, QueryType.QUERY);
 
                 if (qr == null) {
                     throw new KustvaktException(StatusCodes.NO_RESOURCE_FOUND,
@@ -76,13 +74,13 @@
                 // TODO:
                 //   checkVCAcess(q, username);
                 JsonNode qref = JsonUtils.readTree(qr.getKoralQuery());;
-                rewriteQuery(qref,koralNode);
+                rewriteQuery(qref, koralNode);
             }
         }
-        
+
         else if (koralNode.has("operands")) {
             KoralNode operands = koralNode.at("/operands");
-        
+
             for (int i = 0; i < operands.size(); i++) {
                 KoralNode operand = operands.get(i);
                 this.findQueryRef(username, operand);
@@ -91,9 +89,8 @@
         }
     }
 
-
     private void rewriteQuery (JsonNode qref, KoralNode koralNode)
-        throws KustvaktException {
+            throws KustvaktException {
         JsonNode jsonNode = koralNode.rawNode();
         koralNode.remove("@type",
                 new RewriteIdentifier("@type", jsonNode.at("/@type").asText()));
diff --git a/full/src/main/java/de/ids_mannheim/korap/rewrite/RewriteHandler.java b/full/src/main/java/de/ids_mannheim/korap/rewrite/RewriteHandler.java
index d674ba6..6bad856 100644
--- a/full/src/main/java/de/ids_mannheim/korap/rewrite/RewriteHandler.java
+++ b/full/src/main/java/de/ids_mannheim/korap/rewrite/RewriteHandler.java
@@ -27,7 +27,7 @@
  */
 // todo: do post processing!
 //todo: load rewritenode and rewritequery automatically from classpath by default, but namespaced from package
-public class RewriteHandler{
+public class RewriteHandler {
     //implements BeanInjectable {
 
     private static Logger jlog = LogManager.getLogger(RewriteHandler.class);
@@ -41,15 +41,15 @@
 
     public RewriteHandler (List<RewriteTask> rewriteTasks) {
         this();
-        for (RewriteTask t : rewriteTasks){
+        for (RewriteTask t : rewriteTasks) {
             addProcessor(t);
         }
     }
-    
+
     // EM: for testing
     public RewriteHandler (KustvaktConfiguration config) {
         this();
-        this.config=config;
+        this.config = config;
     }
 
     public RewriteHandler () {
@@ -63,7 +63,6 @@
         return this.failed_task_registration;
     }
 
-
     public boolean addProcessor (RewriteTask rewriter) {
         if (rewriter instanceof RewriteTask.RewriteKoralToken)
             return this.token_node_processors
@@ -79,7 +78,6 @@
         return false;
     }
 
-
     @Override
     public String toString () {
         StringBuilder b = new StringBuilder();
@@ -93,7 +91,6 @@
         return b.toString();
     }
 
-
     /**
      * expects extended RewriteNode/Query class with empty default
      * constructor
@@ -117,8 +114,6 @@
         return addProcessor(task);
     }
 
-
-
     public String processQuery (JsonNode root, User user)
             throws KustvaktException {
         RewriteProcess process = new RewriteProcess(root, user);
@@ -126,19 +121,16 @@
         return JsonUtils.toJSON(pre);
     }
 
-
     public String processQuery (String json, User user)
             throws KustvaktException {
         return processQuery(JsonUtils.readTree(json), user);
     }
 
-
     public String processResult (String json, User user)
             throws KustvaktException {
         return processResult(JsonUtils.readTree(json), user);
     }
 
-
     public String processResult (JsonNode node, User user)
             throws KustvaktException {
         RewriteProcess process = new RewriteProcess(node, user);
@@ -146,20 +138,16 @@
         return JsonUtils.toJSON(pre);
     }
 
-
     public void clear () {
         this.node_processors.clear();
         this.query_processors.clear();
         this.token_node_processors.clear();
     }
 
-
-//    public <T extends ContextHolder> void insertBeans (T beans) {
-//        this.beans = beans;
-//        this.config = beans.getConfiguration();
-//    }
-
-
+    //    public <T extends ContextHolder> void insertBeans (T beans) {
+    //        this.beans = beans;
+    //        this.config = beans.getConfiguration();
+    //    }
 
     public class RewriteProcess {
 
@@ -167,13 +155,11 @@
         private JsonNode root;
         private User user;
 
-
         private RewriteProcess (JsonNode root, User user) {
             this.root = root;
             this.user = user;
         }
 
-
         private KoralNode processNode (String key, JsonNode value,
                 boolean result) throws KustvaktException {
             KoralNode kroot = KoralNode.wrapNode(value);
@@ -211,10 +197,9 @@
             return kroot;
         }
 
-
         private JsonNode start (boolean result) throws KustvaktException {
-            if (DEBUG){
-                jlog.debug("Running rewrite process on query "+ root);
+            if (DEBUG) {
+                jlog.debug("Running rewrite process on query " + root);
             }
             if (root != null) {
                 Iterator<Map.Entry<String, JsonNode>> it = root.fields();
@@ -228,7 +213,6 @@
             return root;
         }
 
-
         /**
          * @param node
          * @param tasks
@@ -240,7 +224,8 @@
                 Collection<? extends RewriteTask> tasks, boolean result)
                 throws KustvaktException {
             if (RewriteHandler.this.config == null)
-                throw new RuntimeException("KustvaktConfiguration must be set!");
+                throw new RuntimeException(
+                        "KustvaktConfiguration must be set!");
 
             for (RewriteTask task : tasks) {
                 if (DEBUG) {
@@ -248,15 +233,15 @@
                     jlog.debug("on processor: " + task.getClass().toString());
                 }
 
-//                if (RewriteHandler.this.beans != null
-//                        && task instanceof BeanInjectable)
-//                    ((BeanInjectable) task)
-//                            .insertBeans(RewriteHandler.this.beans);
+                //                if (RewriteHandler.this.beans != null
+                //                        && task instanceof BeanInjectable)
+                //                    ((BeanInjectable) task)
+                //                            .insertBeans(RewriteHandler.this.beans);
 
                 if (task instanceof RewriteTask.IterableRewritePath) {
                     RewriteTask.IterableRewritePath rw = (RewriteTask.IterableRewritePath) task;
                     if (rw.path() != null && !rw.path().equals(rootNode)) {
-                        if (DEBUG){
+                        if (DEBUG) {
                             jlog.debug("skipping node: " + node);
                         }
                         continue;
@@ -280,7 +265,6 @@
             return node;
         }
 
-
         // fixme: merge with processNode!
         private void processFixedNode (JsonNode node,
                 Collection<RewriteTask> tasks, boolean post)
@@ -289,7 +273,8 @@
                 KoralNode next = KoralNode.wrapNode(node);
                 if (task instanceof RewriteTask.RewriteNodeAt) {
                     RewriteTask.RewriteNodeAt rwa = (RewriteTask.RewriteNodeAt) task;
-                    if ((rwa.at() != null && !node.at(rwa.at()).isMissingNode()))
+                    if ((rwa.at() != null
+                            && !node.at(rwa.at()).isMissingNode()))
                         next = next.at(rwa.at());
                 }
 
@@ -303,7 +288,6 @@
             }
         }
 
-
     }
 
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/rewrite/RewriteTask.java b/full/src/main/java/de/ids_mannheim/korap/rewrite/RewriteTask.java
index 79065a5..b015c0e 100644
--- a/full/src/main/java/de/ids_mannheim/korap/rewrite/RewriteTask.java
+++ b/full/src/main/java/de/ids_mannheim/korap/rewrite/RewriteTask.java
@@ -11,7 +11,6 @@
  */
 public interface RewriteTask {
 
-
     /**
      * unspecified query rewrite that gets injected the entire root
      * node during preprocessing
diff --git a/full/src/main/java/de/ids_mannheim/korap/rewrite/TreeConstraint.java b/full/src/main/java/de/ids_mannheim/korap/rewrite/TreeConstraint.java
index 1315c7a..81f254a 100644
--- a/full/src/main/java/de/ids_mannheim/korap/rewrite/TreeConstraint.java
+++ b/full/src/main/java/de/ids_mannheim/korap/rewrite/TreeConstraint.java
@@ -53,12 +53,10 @@
 
     private String pointer;
 
-
     public TreeConstraint () {
         super();
     }
 
-
     @Override
     public KoralNode rewriteQuery (KoralNode node, KustvaktConfiguration config,
             User user) {
@@ -67,13 +65,11 @@
         return node;
     }
 
-
     @Override
     public JsonNode rewriteResult (KoralNode node) {
         return null;
     }
 
-
     @Override
     public String at () {
         return null;
diff --git a/full/src/main/java/de/ids_mannheim/korap/rewrite/VirtualCorpusRewrite.java b/full/src/main/java/de/ids_mannheim/korap/rewrite/VirtualCorpusRewrite.java
index 7ea386f..3a64df9 100644
--- a/full/src/main/java/de/ids_mannheim/korap/rewrite/VirtualCorpusRewrite.java
+++ b/full/src/main/java/de/ids_mannheim/korap/rewrite/VirtualCorpusRewrite.java
@@ -70,9 +70,9 @@
                                     + "caching process",
                             koralNode.get("ref"));
                 }
-                
-                QueryDO vc =
-                        queryService.searchQueryByName(username, vcName, vcOwner, QueryType.VIRTUAL_CORPUS);
+
+                QueryDO vc = queryService.searchQueryByName(username, vcName,
+                        vcOwner, QueryType.VIRTUAL_CORPUS);
                 if (!vc.isCached()) {
                     rewriteVC(vc, koralNode);
                 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/security/context/KustvaktContext.java b/full/src/main/java/de/ids_mannheim/korap/security/context/KustvaktContext.java
index bd2843f..ac09489 100644
--- a/full/src/main/java/de/ids_mannheim/korap/security/context/KustvaktContext.java
+++ b/full/src/main/java/de/ids_mannheim/korap/security/context/KustvaktContext.java
@@ -15,30 +15,25 @@
 
     private TokenContext user;
 
-
     public KustvaktContext (final TokenContext user) {
         this.user = user;
     }
 
-
     @Override
     public Principal getUserPrincipal () {
         return this.user;
     }
 
-
     @Override
     public boolean isUserInRole (String role) {
         throw new UnsupportedOperationException();
     }
 
-
     @Override
     public boolean isSecure () {
         return false;
     }
 
-
     @Override
     public String getAuthenticationScheme () {
         return SecurityContext.BASIC_AUTH;
diff --git a/full/src/main/java/de/ids_mannheim/korap/security/context/TokenContext.java b/full/src/main/java/de/ids_mannheim/korap/security/context/TokenContext.java
index 23d2fa4..10b60ee 100644
--- a/full/src/main/java/de/ids_mannheim/korap/security/context/TokenContext.java
+++ b/full/src/main/java/de/ids_mannheim/korap/security/context/TokenContext.java
@@ -18,7 +18,7 @@
 import lombok.Setter;
 
 /**
- * EM: 
+ * EM:
  * - change datatype of tokenType from string to enum
  * - added authenticationTime
  * 
@@ -39,13 +39,12 @@
     private String token;
     private boolean secureRequired;
 
-//    @Getter(AccessLevel.PRIVATE)
+    //    @Getter(AccessLevel.PRIVATE)
     @Setter(AccessLevel.PRIVATE)
     private Map<String, Object> parameters;
     private String hostAddress;
     private String userAgent;
 
-
     public TokenContext () {
         this.parameters = new HashMap<>();
         this.setUsername("");
@@ -54,7 +53,6 @@
         this.setExpirationTime(-1);
     }
 
-
     private Map statusMap () {
         Map m = new HashMap();
         if (username != null && !username.isEmpty())
@@ -66,11 +64,10 @@
         return m;
     }
 
-
     public Map<String, Object> params () {
         return new HashMap<>(parameters);
     }
-    
+
     public boolean match (TokenContext other) {
         if (other.getToken().equals(this.token))
             if (this.getHostAddress().equals(this.hostAddress))
@@ -81,28 +78,23 @@
         return false;
     }
 
-
     public void addContextParameter (String key, String value) {
         this.parameters.put(key, value);
     }
 
-
     public void addParams (Map<String, Object> map) {
         for (Map.Entry<String, Object> e : map.entrySet())
             this.parameters.put(e.getKey(), String.valueOf(e.getValue()));
     }
 
-
     public void removeContextParameter (String key) {
         this.parameters.remove(key);
     }
 
-
     public void setExpirationTime (long date) {
         this.expirationTime = date;
     }
 
-
     // todo: complete
     public static TokenContext fromJSON (String s) throws KustvaktException {
         JsonNode node = JsonUtils.readTree(s);
@@ -114,7 +106,6 @@
         return c;
     }
 
-
     public static TokenContext fromOAuth2 (String s) throws KustvaktException {
         JsonNode node = JsonUtils.readTree(s);
         TokenContext c = new TokenContext();
@@ -129,41 +120,33 @@
         return c;
     }
 
-
     public boolean isValid () {
         return (this.username != null && !this.username.isEmpty())
                 && (this.token != null && !this.token.isEmpty())
                 && (this.tokenType != null);
     }
 
-
     public String getToken () {
         return token;
     }
 
-
     public String toJson () throws KustvaktException {
         return JsonUtils.toJSON(this.statusMap());
     }
 
-
     public boolean isDemo () {
         return User.UserFactory.isDemo(this.username);
     }
 
-
-
     @Override
     public String getName () {
         return this.getUsername();
     }
 
-
     public ZonedDateTime getAuthenticationTime () {
         return authenticationTime;
     }
 
-
     public void setAuthenticationTime (ZonedDateTime authTime) {
         this.authenticationTime = authTime;
     }
diff --git a/full/src/main/java/de/ids_mannheim/korap/server/EmbeddedLdapServer.java b/full/src/main/java/de/ids_mannheim/korap/server/EmbeddedLdapServer.java
index 88dfe2e..4b1c17e 100644
--- a/full/src/main/java/de/ids_mannheim/korap/server/EmbeddedLdapServer.java
+++ b/full/src/main/java/de/ids_mannheim/korap/server/EmbeddedLdapServer.java
@@ -15,36 +15,56 @@
 public class EmbeddedLdapServer {
     static InMemoryDirectoryServer server;
 
-    public static void startIfNotRunning(LDAPConfig ldapConfig) throws LDAPException, GeneralSecurityException, UnknownHostException {
+    public static void startIfNotRunning (LDAPConfig ldapConfig)
+            throws LDAPException, GeneralSecurityException,
+            UnknownHostException {
         if (server != null) {
             return;
         }
 
-        InMemoryDirectoryServerConfig config = new InMemoryDirectoryServerConfig(ldapConfig.searchBase);
+        InMemoryDirectoryServerConfig config = new InMemoryDirectoryServerConfig(
+                ldapConfig.searchBase);
         final MessageDigest sha1Digest = CryptoHelper.getMessageDigest("SHA1");
-        final MessageDigest sha256Digest = CryptoHelper.getMessageDigest("SHA-256");
-        config.setPasswordEncoders(new ClearInMemoryPasswordEncoder("{CLEAR}", null), new ClearInMemoryPasswordEncoder("{HEX}", HexPasswordEncoderOutputFormatter.getLowercaseInstance()), new ClearInMemoryPasswordEncoder("{BASE64}", Base64PasswordEncoderOutputFormatter.getInstance()), new UnsaltedMessageDigestInMemoryPasswordEncoder("{SHA}", Base64PasswordEncoderOutputFormatter.getInstance(), sha1Digest), new UnsaltedMessageDigestInMemoryPasswordEncoder("{SHA256}", Base64PasswordEncoderOutputFormatter.getInstance(), sha256Digest));
-        config.addAdditionalBindCredentials(ldapConfig.sLoginDN, ldapConfig.sPwd);
+        final MessageDigest sha256Digest = CryptoHelper
+                .getMessageDigest("SHA-256");
+        config.setPasswordEncoders(
+                new ClearInMemoryPasswordEncoder("{CLEAR}", null),
+                new ClearInMemoryPasswordEncoder("{HEX}",
+                        HexPasswordEncoderOutputFormatter
+                                .getLowercaseInstance()),
+                new ClearInMemoryPasswordEncoder("{BASE64}",
+                        Base64PasswordEncoderOutputFormatter.getInstance()),
+                new UnsaltedMessageDigestInMemoryPasswordEncoder("{SHA}",
+                        Base64PasswordEncoderOutputFormatter.getInstance(),
+                        sha1Digest),
+                new UnsaltedMessageDigestInMemoryPasswordEncoder("{SHA256}",
+                        Base64PasswordEncoderOutputFormatter.getInstance(),
+                        sha256Digest));
+        config.addAdditionalBindCredentials(ldapConfig.sLoginDN,
+                ldapConfig.sPwd);
         config.setSchema(null);
 
         final SSLUtil clientSslUtil = new SSLUtil(new TrustAllTrustManager());
 
-        config.setListenerConfigs(InMemoryListenerConfig.createLDAPConfig("LDAP", // Listener name
-                InetAddress.getByName("localhost"), // Listen address. (null = listen on all interfaces)
-                ldapConfig.port, // Listen port (0 = automatically choose an available port)
-                clientSslUtil.createSSLSocketFactory()));
+        config.setListenerConfigs(
+                InMemoryListenerConfig.createLDAPConfig("LDAP", // Listener name
+                        InetAddress.getByName("localhost"), // Listen address. (null = listen on all interfaces)
+                        ldapConfig.port, // Listen port (0 = automatically choose an available port)
+                        clientSslUtil.createSSLSocketFactory()));
         server = new InMemoryDirectoryServer(config);
 
         server.importFromLDIF(true, ldapConfig.ldif);
         server.startListening();
     }
 
-    public static void startIfNotRunning(String ldapConfigFilename) throws LDAPException, GeneralSecurityException, UnknownHostException {
+    public static void startIfNotRunning (String ldapConfigFilename)
+            throws LDAPException, GeneralSecurityException,
+            UnknownHostException {
         LDAPConfig ldapConfig = new LDAPConfig(ldapConfigFilename);
         startIfNotRunning(ldapConfig);
     }
 
-    public static void stop() {
+    public static void stop () {
         if (server != null) {
             server.shutDown(true);
             server = null;
diff --git a/full/src/main/java/de/ids_mannheim/korap/server/KustvaktBaseServer.java b/full/src/main/java/de/ids_mannheim/korap/server/KustvaktBaseServer.java
index ecd1ac9..db6b7c3 100644
--- a/full/src/main/java/de/ids_mannheim/korap/server/KustvaktBaseServer.java
+++ b/full/src/main/java/de/ids_mannheim/korap/server/KustvaktBaseServer.java
@@ -43,7 +43,7 @@
         rootPackages = "de.ids_mannheim.korap.core.web; "
                 + "de.ids_mannheim.korap.web; "
                 + "com.fasterxml.jackson.jaxrs.json;";
-        
+
         File d = new File(KustvaktConfiguration.DATA_FOLDER);
         if (!d.exists()) {
             d.mkdir();
@@ -63,8 +63,8 @@
                 case "--help":
                     StringBuffer b = new StringBuffer();
 
-                    b.append("Parameter description: \n")
-                            .append("--spring-config  <Spring XML configuration>\n")
+                    b.append("Parameter description: \n").append(
+                            "--spring-config  <Spring XML configuration>\n")
                             .append("--port  <Server port number>\n")
                             .append("--help : This help menu\n");
                     System.out.println(b.toString());
@@ -82,14 +82,14 @@
             kargs.setPort(config.getPort());
         }
 
-        String adminToken="";
+        String adminToken = "";
         File f = new File("adminToken");
         if (!f.exists()) {
             RandomCodeGenerator random = new RandomCodeGenerator();
             adminToken = random.createRandomCode(config);
             FileOutputStream fos = new FileOutputStream(new File("adminToken"));
-            OutputStreamWriter writer =
-                    new OutputStreamWriter(fos, StandardCharsets.UTF_8.name());
+            OutputStreamWriter writer = new OutputStreamWriter(fos,
+                    StandardCharsets.UTF_8.name());
             writer.append("token=");
             writer.append(adminToken);
             writer.flush();
@@ -103,11 +103,11 @@
 
         Server server = new Server();
 
-        ServletContextHandler contextHandler =
-                new ServletContextHandler(ServletContextHandler.NO_SESSIONS);
+        ServletContextHandler contextHandler = new ServletContextHandler(
+                ServletContextHandler.NO_SESSIONS);
         contextHandler.setContextPath("/");
-        
-        if (kargs.getSpringConfig()!=null) {
+
+        if (kargs.getSpringConfig() != null) {
             contextHandler.setInitParameter("contextConfigLocation",
                     "file:" + kargs.getSpringConfig());
         }
@@ -115,14 +115,14 @@
             contextHandler.setInitParameter("contextConfigLocation",
                     "classpath:" + this.springConfig);
         }
-        
+
         ServletContextListener listener = new ContextLoaderListener();
         contextHandler.addEventListener(listener);
         contextHandler.setInitParameter("adminToken", adminToken);
 
         ServletHolder servletHolder = new ServletHolder(new ServletContainer());
-        servletHolder.setInitParameter(
-                ServerProperties.PROVIDER_PACKAGES, rootPackages);
+        servletHolder.setInitParameter(ServerProperties.PROVIDER_PACKAGES,
+                rootPackages);
         servletHolder.setInitOrder(1);
         contextHandler.addServlet(servletHolder, config.getBaseURL());
 
@@ -130,9 +130,10 @@
         connector.setPort(kargs.port);
         connector.setIdleTimeout(60000);
         connector.getConnectionFactory(HttpConnectionFactory.class)
-        .getHttpConfiguration().setRequestHeaderSize(64000);
+                .getHttpConfiguration().setRequestHeaderSize(64000);
 
-        ShutdownHandler shutdownHandler = new ShutdownHandler(adminToken,true,true);
+        ShutdownHandler shutdownHandler = new ShutdownHandler(adminToken, true,
+                true);
 
         HandlerList handlers = new HandlerList();
         handlers.addHandler(shutdownHandler);
@@ -152,7 +153,7 @@
             System.exit(-1);
         }
     }
-    
+
     @Setter
     public static class KustvaktArgs {
 
diff --git a/full/src/main/java/de/ids_mannheim/korap/server/KustvaktLiteServer.java b/full/src/main/java/de/ids_mannheim/korap/server/KustvaktLiteServer.java
index e229cfe..d6b1c80 100644
--- a/full/src/main/java/de/ids_mannheim/korap/server/KustvaktLiteServer.java
+++ b/full/src/main/java/de/ids_mannheim/korap/server/KustvaktLiteServer.java
@@ -13,7 +13,8 @@
         KustvaktLiteServer server = new KustvaktLiteServer();
         kargs = server.readAttributes(args);
 
-        if (kargs == null) System.exit(0);
+        if (kargs == null)
+            System.exit(0);
 
         File f = new File("kustvakt-lite.conf");
         Properties properties = new Properties();
@@ -32,8 +33,8 @@
         config = new KustvaktConfiguration();
         config.loadBasicProperties(properties);
 
-        springConfig =  "default-lite-config.xml";
-        
+        springConfig = "default-lite-config.xml";
+
         rootPackages = "de.ids_mannheim.korap.core.web; "
                 + "de.ids_mannheim.korap.web.filter; "
                 + "de.ids_mannheim.korap.web.utils; "
diff --git a/full/src/main/java/de/ids_mannheim/korap/server/KustvaktServer.java b/full/src/main/java/de/ids_mannheim/korap/server/KustvaktServer.java
index 098d68c..392190e 100644
--- a/full/src/main/java/de/ids_mannheim/korap/server/KustvaktServer.java
+++ b/full/src/main/java/de/ids_mannheim/korap/server/KustvaktServer.java
@@ -18,26 +18,27 @@
     public static void main (String[] args) throws Exception {
         KustvaktServer server = new KustvaktServer();
         kargs = server.readAttributes(args);
-        
+
         File f = new File("kustvakt.conf");
         Properties properties = new Properties();
-        
+
         InputStream in = null;
-        if (!f.exists()){
-            in = KustvaktServer.class.getClassLoader().getResourceAsStream("kustvakt.conf");
+        if (!f.exists()) {
+            in = KustvaktServer.class.getClassLoader()
+                    .getResourceAsStream("kustvakt.conf");
         }
-        else{
+        else {
             in = new FileInputStream(f);
         }
-        
+
         properties.load(in);
         in.close();
-        
+
         config = new FullConfiguration();
         config.loadBasicProperties(properties);
 
-		if (kargs == null)
-			System.exit(0);
+        if (kargs == null)
+            System.exit(0);
 
         server.start();
     }
diff --git a/full/src/main/java/de/ids_mannheim/korap/service/DefaultSettingService.java b/full/src/main/java/de/ids_mannheim/korap/service/DefaultSettingService.java
index 96ebeb8..b0ba7d0 100644
--- a/full/src/main/java/de/ids_mannheim/korap/service/DefaultSettingService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/service/DefaultSettingService.java
@@ -60,8 +60,8 @@
         UserSettingProcessor processor = new UserSettingProcessor();
         processor.readQuietly(map, false);
 
-        DefaultSetting defaultSetting =
-                settingDao.retrieveDefaultSetting(username);
+        DefaultSetting defaultSetting = settingDao
+                .retrieveDefaultSetting(username);
         if (defaultSetting == null) {
             createDefaultSetting(username, processor);
             return HttpStatus.SC_CREATED;
@@ -80,8 +80,8 @@
 
     public void updateDefaultSetting (DefaultSetting setting,
             UserSettingProcessor newProcessor) throws KustvaktException {
-        UserSettingProcessor processor =
-                new UserSettingProcessor(setting.getSettings());
+        UserSettingProcessor processor = new UserSettingProcessor(
+                setting.getSettings());
         processor.update(newProcessor);
 
         String jsonSettings = processor.serialize();
@@ -98,8 +98,8 @@
 
     public String retrieveDefaultSettings (String username)
             throws KustvaktException {
-        DefaultSetting defaultSetting =
-                settingDao.retrieveDefaultSetting(username);
+        DefaultSetting defaultSetting = settingDao
+                .retrieveDefaultSetting(username);
         if (defaultSetting == null) {
             return null;
         }
@@ -109,8 +109,8 @@
     public void deleteKey (String username, String contextUsername, String key)
             throws KustvaktException {
         username = verifiyUsername(username, contextUsername);
-        DefaultSetting defaultSetting =
-                settingDao.retrieveDefaultSetting(username);
+        DefaultSetting defaultSetting = settingDao
+                .retrieveDefaultSetting(username);
 
         String jsonSettings = defaultSetting.getSettings();
         UserSettingProcessor processor = new UserSettingProcessor(jsonSettings);
diff --git a/full/src/main/java/de/ids_mannheim/korap/service/MailAuthenticator.java b/full/src/main/java/de/ids_mannheim/korap/service/MailAuthenticator.java
index 84397d5..21f2202 100644
--- a/full/src/main/java/de/ids_mannheim/korap/service/MailAuthenticator.java
+++ b/full/src/main/java/de/ids_mannheim/korap/service/MailAuthenticator.java
@@ -3,7 +3,8 @@
 import jakarta.mail.Authenticator;
 import jakarta.mail.PasswordAuthentication;
 
-/** Defines Authenticator for creating javax.mail.Session.
+/**
+ * Defines Authenticator for creating javax.mail.Session.
  * 
  * @see src/main/resources/default-config.xml
  * 
diff --git a/full/src/main/java/de/ids_mannheim/korap/service/MailService.java b/full/src/main/java/de/ids_mannheim/korap/service/MailService.java
index 0a6b2d4..7619a25 100644
--- a/full/src/main/java/de/ids_mannheim/korap/service/MailService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/service/MailService.java
@@ -34,7 +34,7 @@
 
     public static Logger jlog = LogManager.getLogger(MailService.class);
     public static boolean DEBUG = false;
-    
+
     @Autowired
     private AuthenticationManager authenticationManager;
     @Autowired
@@ -84,7 +84,8 @@
                 StandardCharsets.UTF_8.name(), context, stringWriter);
 
         String message = stringWriter.toString();
-        if (DEBUG) jlog.debug(message);
+        if (DEBUG)
+            jlog.debug(message);
         return message;
     }
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/service/QueryService.java b/full/src/main/java/de/ids_mannheim/korap/service/QueryService.java
index 19b57e9..cc5f51b 100644
--- a/full/src/main/java/de/ids_mannheim/korap/service/QueryService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/service/QueryService.java
@@ -98,8 +98,8 @@
         }
     }
 
-    public List<QueryDto> listOwnerQuery (String username,
-            QueryType queryType) throws KustvaktException {
+    public List<QueryDto> listOwnerQuery (String username, QueryType queryType)
+            throws KustvaktException {
         List<QueryDO> list = queryDao.retrieveOwnerQuery(username, queryType);
         return createQueryDtos(list, queryType);
     }
@@ -120,8 +120,8 @@
     public List<QueryDto> listQueryByType (String createdBy, ResourceType type,
             QueryType queryType) throws KustvaktException {
 
-        List<QueryDO> virtualCorpora =
-                queryDao.retrieveQueryByType(type, createdBy, queryType);
+        List<QueryDO> virtualCorpora = queryDao.retrieveQueryByType(type,
+                createdBy, queryType);
         Collections.sort(virtualCorpora);
         return createQueryDtos(virtualCorpora, queryType);
 
@@ -159,8 +159,8 @@
                 || adminDao.isAdmin(username)) {
 
             if (query.getType().equals(ResourceType.PUBLISHED)) {
-                QueryAccess access =
-                        accessDao.retrieveHiddenAccess(query.getId());
+                QueryAccess access = accessDao
+                        .retrieveHiddenAccess(query.getId());
                 accessDao.deleteAccess(access, "system");
                 userGroupService.deleteAutoHiddenGroup(
                         access.getUserGroup().getId(), "system");
@@ -252,8 +252,8 @@
             QueryDO query = queryDao.retrieveQueryById(queryId);
             // create and assign a new hidden group
             int groupId = userGroupService.createAutoHiddenGroup();
-            UserGroup autoHidden =
-                    userGroupService.retrieveUserGroupById(groupId);
+            UserGroup autoHidden = userGroupService
+                    .retrieveUserGroupById(groupId);
             accessDao.createAccessToQuery(query, autoHidden, "system",
                     QueryAccessStatus.HIDDEN);
         }
@@ -269,40 +269,42 @@
         QueryType queryType = query.getQueryType();
         if (!checkNumberOfQueryLimit(username, queryType)) {
             String type = queryType.displayName().toLowerCase();
-            throw new KustvaktException(StatusCodes.NOT_ALLOWED, 
-                    "Cannot create "+type+". The maximum number "
-                            + "of "+type+" has been reached.");
+            throw new KustvaktException(StatusCodes.NOT_ALLOWED,
+                    "Cannot create " + type + ". The maximum number " + "of "
+                            + type + " has been reached.");
         }
-        
+
         String koralQuery = computeKoralQuery(query);
         storeQuery(username, queryName, query.getType(), query.getQueryType(),
                 koralQuery, query.getDefinition(), query.getDescription(),
                 query.getStatus(), query.isCached(), queryCreator,
                 query.getQuery(), query.getQueryLanguage());
     }
-    
+
     private boolean checkNumberOfQueryLimit (String username,
             QueryType queryType) throws KustvaktException {
         Long num = queryDao.countNumberOfQuery(username, queryType);
-        if (num < config.getMaxNumberOfUserQueries()) return true;
-        else return false;
+        if (num < config.getMaxNumberOfUserQueries())
+            return true;
+        else
+            return false;
     }
-    
-    private String computeKoralQuery (QueryJson query) throws KustvaktException {
+
+    private String computeKoralQuery (QueryJson query)
+            throws KustvaktException {
         if (query.getQueryType().equals(QueryType.VIRTUAL_CORPUS)) {
             ParameterChecker.checkStringValue(query.getCorpusQuery(),
                     "corpusQuery");
             return serializeCorpusQuery(query.getCorpusQuery());
         }
-        
+
         if (query.getQueryType().equals(QueryType.QUERY)) {
             ParameterChecker.checkStringValue(query.getQuery(), "query");
             ParameterChecker.checkStringValue(query.getQueryLanguage(),
                     "queryLanguage");
-            return
-                    serializeQuery(query.getQuery(), query.getQueryLanguage());
+            return serializeQuery(query.getQuery(), query.getQueryLanguage());
         }
-        
+
         return null;
     }
 
@@ -316,9 +318,10 @@
 
         if (!queryNamePattern.matcher(queryName).matches()) {
             throw new KustvaktException(StatusCodes.INVALID_ARGUMENT, queryType
-                    .displayName() + " must consists of alphanumerical characters "
-                            + "(limited to ASCII), underscores, dashes and periods. "
-                            + "The name has to start with an alphanumerical character.",
+                    .displayName()
+                    + " must consists of alphanumerical characters "
+                    + "(limited to ASCII), underscores, dashes and periods. "
+                    + "The name has to start with an alphanumerical character.",
                     queryName);
         }
 
@@ -335,8 +338,8 @@
 
         CorpusAccess requiredAccess = CorpusAccess.PUB;
         if (queryType.equals(QueryType.VIRTUAL_CORPUS)) {
-            requiredAccess =
-                    determineRequiredAccess(isCached, queryName, koralQuery);
+            requiredAccess = determineRequiredAccess(isCached, queryName,
+                    koralQuery);
         }
 
         if (DEBUG) {
@@ -401,8 +404,7 @@
             String koralQuery) throws KustvaktException {
 
         if (isCached) {
-            KoralCollectionQueryBuilder koral =
-                    new KoralCollectionQueryBuilder();
+            KoralCollectionQueryBuilder koral = new KoralCollectionQueryBuilder();
             koral.with("referTo " + name);
             koralQuery = koral.toJSON();
             if (DEBUG) {
@@ -454,8 +456,8 @@
                     "Unauthorized operation for user: " + username, username);
         }
 
-        UserGroup userGroup =
-                userGroupService.retrieveUserGroupByName(groupName);
+        UserGroup userGroup = userGroupService
+                .retrieveUserGroupByName(groupName);
 
         if (!isQueryAccessAdmin(userGroup, username)
                 && !adminDao.isAdmin(username)) {
@@ -488,8 +490,8 @@
 
     private boolean isQueryAccessAdmin (UserGroup userGroup, String username)
             throws KustvaktException {
-        List<UserGroupMember> accessAdmins =
-                userGroupService.retrieveQueryAccessAdmins(userGroup);
+        List<UserGroupMember> accessAdmins = userGroupService
+                .retrieveQueryAccessAdmins(userGroup);
         for (UserGroupMember m : accessAdmins) {
             if (username.equals(m.getUserId())) {
                 return true;
@@ -521,8 +523,8 @@
             accessList = accessDao.retrieveAllAccess();
         }
         else {
-            List<UserGroup> groups =
-                    userGroupService.retrieveUserGroup(username);
+            List<UserGroup> groups = userGroupService
+                    .retrieveUserGroup(username);
             for (UserGroup g : groups) {
                 if (isQueryAccessAdmin(g, username)) {
                     accessList.addAll(
@@ -538,8 +540,8 @@
 
         List<QueryAccess> accessList;
         if (adminDao.isAdmin(username)) {
-            accessList =
-                    accessDao.retrieveAllAccessByQuery(queryCreator, queryName);
+            accessList = accessDao.retrieveAllAccessByQuery(queryCreator,
+                    queryName);
         }
         else {
             accessList = accessDao.retrieveActiveAccessByQuery(queryCreator,
@@ -578,16 +580,16 @@
 
     public List<QueryAccessDto> listQueryAccessByGroup (String username,
             String groupName) throws KustvaktException {
-        UserGroup userGroup =
-                userGroupService.retrieveUserGroupByName(groupName);
+        UserGroup userGroup = userGroupService
+                .retrieveUserGroupByName(groupName);
 
         List<QueryAccess> accessList;
         if (adminDao.isAdmin(username)) {
             accessList = accessDao.retrieveAllAccessByGroup(userGroup.getId());
         }
         else if (isQueryAccessAdmin(userGroup, username)) {
-            accessList =
-                    accessDao.retrieveActiveAccessByGroup(userGroup.getId());
+            accessList = accessDao
+                    .retrieveActiveAccessByGroup(userGroup.getId());
         }
         else {
             throw new KustvaktException(StatusCodes.AUTHORIZATION_FAILED,
@@ -614,8 +616,8 @@
 
     public JsonNode retrieveKoralQuery (String username, String queryName,
             String createdBy, QueryType queryType) throws KustvaktException {
-        QueryDO query =
-                searchQueryByName(username, queryName, createdBy, queryType);
+        QueryDO query = searchQueryByName(username, queryName, createdBy,
+                queryType);
         String koralQuery = query.getKoralQuery();
         JsonNode kq = JsonUtils.readTree(koralQuery);
         return kq;
@@ -624,17 +626,18 @@
     public JsonNode retrieveFieldValues (String username, String queryName,
             String createdBy, QueryType queryType, String fieldName)
             throws KustvaktException {
-        
+
         ParameterChecker.checkStringValue(fieldName, "fieldName");
-        
-//        if (!adminDao.isAdmin(username)) {
-//            throw new KustvaktException(StatusCodes.AUTHORIZATION_FAILED,
-//                    "Unauthorized operation for user: " + username, username);
-//        }
-        
+
+        //        if (!adminDao.isAdmin(username)) {
+        //            throw new KustvaktException(StatusCodes.AUTHORIZATION_FAILED,
+        //                    "Unauthorized operation for user: " + username, username);
+        //        }
+
         if (fieldName.equals("tokens") || fieldName.equals("base")) {
             throw new KustvaktException(StatusCodes.NOT_ALLOWED,
-                    "Retrieving values of field "+fieldName+" is not allowed.");
+                    "Retrieving values of field " + fieldName
+                            + " is not allowed.");
         }
         else {
             QueryDO query = searchQueryByName(username, queryName, createdBy,
@@ -659,8 +662,8 @@
 
     public QueryDto retrieveQueryByName (String username, String queryName,
             String createdBy, QueryType queryType) throws KustvaktException {
-        QueryDO query =
-                searchQueryByName(username, queryName, createdBy, queryType);
+        QueryDO query = searchQueryByName(username, queryName, createdBy,
+                queryType);
         // String json = query.getKoralQuery();
         String statistics = null;
         // long start,end;
@@ -721,8 +724,8 @@
     private boolean hasAccess (String username, int queryId)
             throws KustvaktException {
         UserGroup userGroup;
-        List<QueryAccess> accessList =
-                accessDao.retrieveActiveAccessByQuery(queryId);
+        List<QueryAccess> accessList = accessDao
+                .retrieveActiveAccessByQuery(queryId);
         for (QueryAccess access : accessList) {
             userGroup = access.getUserGroup();
             if (userGroupService.isMember(username, userGroup)) {
diff --git a/full/src/main/java/de/ids_mannheim/korap/service/ResourceService.java b/full/src/main/java/de/ids_mannheim/korap/service/ResourceService.java
index f22ae68..6bfb1af 100644
--- a/full/src/main/java/de/ids_mannheim/korap/service/ResourceService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/service/ResourceService.java
@@ -13,7 +13,9 @@
 import de.ids_mannheim.korap.dto.converter.ResourceConverter;
 import de.ids_mannheim.korap.web.controller.ResourceController;
 
-/** ResourceService defines the logic behind {@link ResourceController}.
+/**
+ * ResourceService defines the logic behind
+ * {@link ResourceController}.
  * 
  * @author margaretha
  *
@@ -31,8 +33,8 @@
 
     public List<ResourceDto> getResourceDtos () {
         List<Resource> resources = resourceDao.getAllResources();
-        List<ResourceDto> resourceDtos =
-                resourceConverter.convertToResourcesDto(resources);
+        List<ResourceDto> resourceDtos = resourceConverter
+                .convertToResourcesDto(resources);
         if (DEBUG) {
             jlog.debug("/info " + resourceDtos.toString());
         }
diff --git a/full/src/main/java/de/ids_mannheim/korap/service/UserGroupService.java b/full/src/main/java/de/ids_mannheim/korap/service/UserGroupService.java
index 92f69c3..22fe070 100644
--- a/full/src/main/java/de/ids_mannheim/korap/service/UserGroupService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/service/UserGroupService.java
@@ -48,10 +48,10 @@
 
     public static Logger jlog = LogManager.getLogger(UserGroupService.class);
     public static boolean DEBUG = false;
-    
+
     public static Pattern groupNamePattern = Pattern
             .compile("[a-zA-Z0-9]+[a-zA-Z_0-9-.]+");
-    
+
     @Autowired
     private UserGroupDao userGroupDao;
     @Autowired
@@ -68,7 +68,7 @@
     private MailService mailService;
     @Autowired
     private RandomCodeGenerator random;
-    
+
     private static Set<Role> memberRoles;
 
     /**
@@ -85,24 +85,24 @@
     public List<UserGroup> retrieveUserGroup (String username)
             throws KustvaktException {
 
-        List<UserGroup> userGroups =
-                userGroupDao.retrieveGroupByUserId(username);
+        List<UserGroup> userGroups = userGroupDao
+                .retrieveGroupByUserId(username);
         Collections.sort(userGroups);
         return userGroups;
     }
-    
+
     public List<UserGroupDto> retrieveUserGroupDto (String username)
             throws KustvaktException {
         List<UserGroup> userGroups = retrieveUserGroup(username);
-        
+
         ArrayList<UserGroupDto> dtos = new ArrayList<>(userGroups.size());
         UserGroupMember userAsMember;
         List<UserGroupMember> members;
         UserGroupDto groupDto;
         for (UserGroup group : userGroups) {
             members = retrieveMembers(group.getId(), username);
-            userAsMember =
-                    groupMemberDao.retrieveMemberById(username, group.getId());
+            userAsMember = groupMemberDao.retrieveMemberById(username,
+                    group.getId());
             groupDto = converter.createUserGroupDto(group, members,
                     userAsMember.getStatus(), userAsMember.getRoles());
             dtos.add(groupDto);
@@ -132,7 +132,7 @@
             throws KustvaktException {
         return userGroupDao.retrieveGroupById(groupId);
     }
-    
+
     public UserGroup retrieveUserGroupByName (String groupName)
             throws KustvaktException {
         return userGroupDao.retrieveGroupByName(groupName, false);
@@ -146,16 +146,16 @@
     public List<UserGroupDto> retrieveUserGroupByStatus (String username,
             UserGroupStatus status) throws KustvaktException {
 
-        List<UserGroup> userGroups =
-                userGroupDao.retrieveGroupByStatus(username, status);
+        List<UserGroup> userGroups = userGroupDao
+                .retrieveGroupByStatus(username, status);
         Collections.sort(userGroups);
         ArrayList<UserGroupDto> dtos = new ArrayList<>(userGroups.size());
 
         List<UserGroupMember> members;
         UserGroupDto groupDto;
         for (UserGroup group : userGroups) {
-            members =
-                    groupMemberDao.retrieveMemberByGroupId(group.getId(), true);
+            members = groupMemberDao.retrieveMemberByGroupId(group.getId(),
+                    true);
             groupDto = converter.createUserGroupDto(group, members, null, null);
             dtos.add(groupDto);
         }
@@ -202,8 +202,8 @@
      * 
      * 
      */
-    public boolean createUpdateUserGroup (String groupName, String description, String createdBy)
-            throws KustvaktException {
+    public boolean createUpdateUserGroup (String groupName, String description,
+            String createdBy) throws KustvaktException {
         ParameterChecker.checkNameValue(groupName, "groupName");
         ParameterChecker.checkStringValue(createdBy, "createdBy");
 
@@ -214,24 +214,24 @@
                             + "The name has to start with an alphanumerical character.",
                     groupName);
         }
-        
+
         UserGroup userGroup = null;
         boolean groupExists = false;
-        try{
-            userGroup = userGroupDao.retrieveGroupByName(groupName,false);
+        try {
+            userGroup = userGroupDao.retrieveGroupByName(groupName, false);
             groupExists = true;
         }
         catch (KustvaktException e) {
-            if (e.getStatusCode() != StatusCodes.NO_RESOURCE_FOUND){
+            if (e.getStatusCode() != StatusCodes.NO_RESOURCE_FOUND) {
                 throw e;
             }
         }
-        
-        if (!groupExists){
+
+        if (!groupExists) {
             try {
                 userGroupDao.createGroup(groupName, description, createdBy,
                         UserGroupStatus.ACTIVE);
-                userGroup = userGroupDao.retrieveGroupByName(groupName,false);
+                userGroup = userGroupDao.retrieveGroupByName(groupName, false);
             }
             // handle DB exceptions, e.g. unique constraint
             catch (Exception e) {
@@ -257,7 +257,8 @@
 
     public void deleteGroup (String groupName, String username)
             throws KustvaktException {
-        UserGroup userGroup = userGroupDao.retrieveGroupByName(groupName,false);
+        UserGroup userGroup = userGroupDao.retrieveGroupByName(groupName,
+                false);
         if (userGroup.getStatus() == UserGroupStatus.DELETED) {
             // EM: should this be "not found" instead?
             throw new KustvaktException(StatusCodes.GROUP_DELETED,
@@ -278,7 +279,7 @@
 
     public int createAutoHiddenGroup () throws KustvaktException {
         String code = random.createRandomCode();
-        String groupName = "auto-"+code;
+        String groupName = "auto-" + code;
         int groupId = userGroupDao.createGroup(groupName, "auto-hidden-group",
                 "system", UserGroupStatus.HIDDEN);
 
@@ -309,7 +310,8 @@
      * @param userGroup
      *            a user group
      * @param createdBy
-     *            the user (query-access admin/system) adding the user the user-group
+     *            the user (query-access admin/system) adding the user
+     *            the user-group
      * @param status
      *            the status of the membership
      * @throws KustvaktException
@@ -333,8 +335,8 @@
         int groupId = userGroup.getId();
         ParameterChecker.checkIntegerValue(groupId, "userGroupId");
 
-        GroupMemberStatus existingStatus =
-                memberExists(username, groupId, status);
+        GroupMemberStatus existingStatus = memberExists(username, groupId,
+                status);
         if (existingStatus != null) {
             throw new KustvaktException(StatusCodes.GROUP_MEMBER_EXISTS,
                     "Username " + username + " with status " + existingStatus
@@ -355,8 +357,8 @@
             GroupMemberStatus status) throws KustvaktException {
         UserGroupMember existingMember;
         try {
-            existingMember =
-                    groupMemberDao.retrieveMemberById(username, groupId);
+            existingMember = groupMemberDao.retrieveMemberById(username,
+                    groupId);
         }
         catch (KustvaktException e) {
             return null;
@@ -403,8 +405,8 @@
     private boolean isUserGroupAdmin (String username, UserGroup userGroup)
             throws KustvaktException {
 
-        List<UserGroupMember> userGroupAdmins =
-                groupMemberDao.retrieveMemberByRole(userGroup.getId(),
+        List<UserGroupMember> userGroupAdmins = groupMemberDao
+                .retrieveMemberByRole(userGroup.getId(),
                         PredefinedRole.USER_GROUP_ADMIN.getId());
 
         for (UserGroupMember admin : userGroupAdmins) {
@@ -432,15 +434,16 @@
         ParameterChecker.checkStringValue(username, "userId");
         ParameterChecker.checkStringValue(groupName, "groupId");
 
-        UserGroup userGroup = userGroupDao.retrieveGroupByName(groupName, false);
+        UserGroup userGroup = userGroupDao.retrieveGroupByName(groupName,
+                false);
         if (userGroup.getStatus() == UserGroupStatus.DELETED) {
             throw new KustvaktException(StatusCodes.GROUP_DELETED,
                     "Group " + userGroup.getName() + " has been deleted.",
                     userGroup.getName());
         }
 
-        UserGroupMember member =
-                groupMemberDao.retrieveMemberById(username, userGroup.getId());
+        UserGroupMember member = groupMemberDao.retrieveMemberById(username,
+                userGroup.getId());
         GroupMemberStatus status = member.getStatus();
         if (status.equals(GroupMemberStatus.DELETED)) {
             throw new KustvaktException(StatusCodes.GROUP_MEMBER_DELETED,
@@ -480,8 +483,8 @@
 
     public boolean isMember (String username, UserGroup userGroup)
             throws KustvaktException {
-        List<UserGroupMember> members =
-                groupMemberDao.retrieveMemberByGroupId(userGroup.getId());
+        List<UserGroupMember> members = groupMemberDao
+                .retrieveMemberByGroupId(userGroup.getId());
         for (UserGroupMember member : members) {
             if (member.getUserId().equals(username)
                     && member.getStatus().equals(GroupMemberStatus.ACTIVE)) {
@@ -494,7 +497,8 @@
     public void deleteGroupMember (String memberId, String groupName,
             String deletedBy) throws KustvaktException {
 
-        UserGroup userGroup = userGroupDao.retrieveGroupByName(groupName, false);
+        UserGroup userGroup = userGroupDao.retrieveGroupByName(groupName,
+                false);
         if (userGroup.getStatus() == UserGroupStatus.DELETED) {
             throw new KustvaktException(StatusCodes.GROUP_DELETED,
                     "Group " + userGroup.getName() + " has been deleted.",
@@ -538,8 +542,8 @@
 
         UserGroup group = userGroupDao.retrieveGroupById(groupId);
 
-        UserGroupMember member =
-                groupMemberDao.retrieveMemberById(username, groupId);
+        UserGroupMember member = groupMemberDao.retrieveMemberById(username,
+                groupId);
         GroupMemberStatus status = member.getStatus();
         if (isSoftDelete && status.equals(GroupMemberStatus.DELETED)) {
             throw new KustvaktException(StatusCodes.GROUP_MEMBER_DELETED,
@@ -576,9 +580,8 @@
         else if (isUserGroupAdmin(username, userGroup)
                 || adminDao.isAdmin(username)) {
 
-            UserGroupMember member =
-                    groupMemberDao.retrieveMemberById(memberUsername,
-                            userGroup.getId());
+            UserGroupMember member = groupMemberDao
+                    .retrieveMemberById(memberUsername, userGroup.getId());
 
             if (!member.getStatus().equals(GroupMemberStatus.ACTIVE)) {
                 throw new KustvaktException(StatusCodes.GROUP_MEMBER_INACTIVE,
@@ -617,9 +620,8 @@
         else if (isUserGroupAdmin(username, userGroup)
                 || adminDao.isAdmin(username)) {
 
-            UserGroupMember member =
-                    groupMemberDao.retrieveMemberById(memberUsername,
-                            userGroup.getId());
+            UserGroupMember member = groupMemberDao
+                    .retrieveMemberById(memberUsername, userGroup.getId());
 
             if (!member.getStatus().equals(GroupMemberStatus.ACTIVE)) {
                 throw new KustvaktException(StatusCodes.GROUP_MEMBER_INACTIVE,
@@ -654,9 +656,8 @@
         if (isUserGroupAdmin(username, userGroup)
                 || adminDao.isAdmin(username)) {
 
-            UserGroupMember member =
-                    groupMemberDao.retrieveMemberById(memberUsername,
-                            userGroup.getId());
+            UserGroupMember member = groupMemberDao
+                    .retrieveMemberById(memberUsername, userGroup.getId());
 
             Set<Role> roles = member.getRoles();
             Iterator<Role> i = roles.iterator();
diff --git a/full/src/main/java/de/ids_mannheim/korap/service/UserService.java b/full/src/main/java/de/ids_mannheim/korap/service/UserService.java
index de94d64..59e5e5b 100644
--- a/full/src/main/java/de/ids_mannheim/korap/service/UserService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/service/UserService.java
@@ -9,7 +9,7 @@
 public class UserService {
 
     final static ObjectMapper mapper = new ObjectMapper();
-    
+
     public JsonNode retrieveUserInfo (String username) {
         return mapper.createObjectNode().put("username", username);
     }
diff --git a/full/src/main/java/de/ids_mannheim/korap/user/DataFactory.java b/full/src/main/java/de/ids_mannheim/korap/user/DataFactory.java
index 21aea9a..07212bd 100644
--- a/full/src/main/java/de/ids_mannheim/korap/user/DataFactory.java
+++ b/full/src/main/java/de/ids_mannheim/korap/user/DataFactory.java
@@ -34,7 +34,6 @@
         return factory;
     }
 
-
     /**
      * if data string null, returns an empty data holding object
      * 
@@ -43,39 +42,32 @@
      */
     public abstract Object convertData (String data);
 
-
     public abstract int size (Object data);
 
-
     public abstract Set<String> keys (Object data);
 
-
     public abstract Collection<Object> values (Object data);
 
-    public abstract Object validate(Object data, Validator validator) throws KustvaktException;
+    public abstract Object validate (Object data, Validator validator)
+            throws KustvaktException;
 
     @Deprecated
     public abstract Map<String, Object> fields (Object data);
 
-
     public abstract Object getValue (Object data, String pointer);
 
-
     public abstract boolean addValue (Object data, String field, Object value);
 
-
     public abstract boolean removeValue (Object data, String field);
 
-
     public abstract String toStringValue (Object data) throws KustvaktException;
 
-    public abstract Object filter(Object data, String ... keys);
+    public abstract Object filter (Object data, String ... keys);
 
     public boolean checkDataType (Object data) {
         throw new RuntimeException("Wrong data type for factory setting!");
     }
 
-
     /**
      * updates data1 with values from data2
      * 
@@ -87,8 +79,6 @@
      */
     public abstract Object merge (Object data1, Object data2);
 
-
-
     private static class DefaultFactory extends DataFactory {
 
         @Override
@@ -103,7 +93,6 @@
             }
         }
 
-
         @Override
         public int size (Object data) {
             if (checkDataType(data))
@@ -111,7 +100,6 @@
             return -1;
         }
 
-
         @Override
         public Set<String> keys (Object data) {
             Set<String> keys = new HashSet<>();
@@ -123,33 +111,33 @@
             return keys;
         }
 
-
         @Override
         public Collection<Object> values (Object data) {
             return new HashSet<>();
         }
 
         @Override
-        public Object validate(Object data, Validator validator) throws KustvaktException {
+        public Object validate (Object data, Validator validator)
+                throws KustvaktException {
             if (checkDataType(data) && ((JsonNode) data).isObject()) {
                 try {
                     @SuppressWarnings("unchecked")
-                    Map<String, Object> mdata = JsonUtils.read(toStringValue(data), HashMap.class);
+                    Map<String, Object> mdata = JsonUtils
+                            .read(toStringValue(data), HashMap.class);
                     return validator.validateMap(mdata);
-                } catch (IOException e) {
+                }
+                catch (IOException e) {
                     // do nothing
                 }
             }
             return JsonUtils.createObjectNode();
         }
 
-
         @Override
         public Map<String, Object> fields (Object data) {
             return new HashMap<>();
         }
 
-
         @Override
         public Object getValue (Object data, String key) {
             if (checkDataType(data)) {
@@ -169,7 +157,6 @@
             return null;
         }
 
-
         //fixme: test that this works with different types
         @Override
         public boolean addValue (Object data, String field, Object value) {
@@ -185,13 +172,13 @@
                     if (value instanceof JsonNode)
                         node.set(field, (JsonNode) value);
                     // EM: added
-                    if (value instanceof Collection<?>){
+                    if (value instanceof Collection<?>) {
                         Collection<?> list = (Collection<?>) value;
                         ArrayNode arrayNode = JsonUtils.createArrayNode();
-                        for (Object o : list){
+                        for (Object o : list) {
                             addValue(arrayNode, null, o);
                         }
-                        node.set(field,arrayNode);
+                        node.set(field, arrayNode);
                     }
                     return true;
                 }
@@ -209,7 +196,6 @@
             return false;
         }
 
-
         @Override
         public boolean removeValue (Object data, String field) {
             if (checkDataType(data) && ((JsonNode) data).isObject()) {
@@ -220,7 +206,6 @@
             return false;
         }
 
-
         @Override
         public String toStringValue (Object data) throws KustvaktException {
             if (data instanceof JsonNode)
@@ -229,7 +214,7 @@
         }
 
         @Override
-        public Object filter(Object data, String... keys) {
+        public Object filter (Object data, String ... keys) {
             if (checkDataType(data) && ((JsonNode) data).isObject()) {
                 ObjectNode node = ((JsonNode) data).deepCopy();
                 return node.retain(keys);
@@ -237,7 +222,6 @@
             return JsonUtils.createObjectNode();
         }
 
-
         @Override
         public boolean checkDataType (Object data) {
             if (!(data instanceof JsonNode))
@@ -245,7 +229,6 @@
             return true;
         }
 
-
         @Override
         public Object merge (Object data1, Object data2) {
             if (checkDataType(data1) && checkDataType(data2)) {
diff --git a/full/src/main/java/de/ids_mannheim/korap/user/DemoUser.java b/full/src/main/java/de/ids_mannheim/korap/user/DemoUser.java
index 5a48bcb..06b1310 100644
--- a/full/src/main/java/de/ids_mannheim/korap/user/DemoUser.java
+++ b/full/src/main/java/de/ids_mannheim/korap/user/DemoUser.java
@@ -14,14 +14,12 @@
     private static final long ACCOUNT_CREATED = 1377102171202L;
     public static final String PASSPHRASE = "demo";
 
-
     protected DemoUser () {
         super(DEMOUSER_NAME, 2);
         this.setId(-1);
         this.setAccountCreation(ACCOUNT_CREATED);
     }
 
-
     protected User clone () {
         return new DemoUser();
     }
diff --git a/full/src/main/java/de/ids_mannheim/korap/user/GenericUserData.java b/full/src/main/java/de/ids_mannheim/korap/user/GenericUserData.java
index cf254dd..506e262 100644
--- a/full/src/main/java/de/ids_mannheim/korap/user/GenericUserData.java
+++ b/full/src/main/java/de/ids_mannheim/korap/user/GenericUserData.java
@@ -5,18 +5,15 @@
  */
 public class GenericUserData extends Userdata {
 
-
     public GenericUserData () {
         super(-1);
     }
 
-
     @Override
     public String[] requiredFields () {
         return new String[0];
     }
 
-
     @Override
     public String[] defaultFields () {
         return new String[0];
diff --git a/full/src/main/java/de/ids_mannheim/korap/user/KorAPUser.java b/full/src/main/java/de/ids_mannheim/korap/user/KorAPUser.java
index 8f51378..7a4ebec 100644
--- a/full/src/main/java/de/ids_mannheim/korap/user/KorAPUser.java
+++ b/full/src/main/java/de/ids_mannheim/korap/user/KorAPUser.java
@@ -19,25 +19,21 @@
     private String URIFragment;
     private Long URIExpiration;
 
-
     public KorAPUser (String username) {
         super(username, 0);
         this.URIFragment = "";
         this.URIExpiration = 0L;
     }
 
-
     public KorAPUser (Integer id, String username) {
         this(username);
         this.setId(id);
     }
 
-
     public KorAPUser () {
         super();
     }
 
-
     @Override
     protected User clone () {
         KorAPUser user = new KorAPUser(this.getUsername());
@@ -46,7 +42,6 @@
         return user;
     }
 
-
     @Override
     public int hashCode () {
         int result = super.hashCode();
@@ -59,7 +54,6 @@
         return result;
     }
 
-
     @Override
     public boolean equals (Object o) {
         if (this == o)
diff --git a/full/src/main/java/de/ids_mannheim/korap/user/ShibbolethUser.java b/full/src/main/java/de/ids_mannheim/korap/user/ShibbolethUser.java
index 80d01f5..42c2e57 100644
--- a/full/src/main/java/de/ids_mannheim/korap/user/ShibbolethUser.java
+++ b/full/src/main/java/de/ids_mannheim/korap/user/ShibbolethUser.java
@@ -19,14 +19,12 @@
     // EM: common name
     private String commonName;
 
-
     protected ShibbolethUser () {
         super(1);
     }
 
-
     private ShibbolethUser (String eduPersonID, String mail, String cn,
-                      String affiliation) {
+                            String affiliation) {
         this(eduPersonID);
         this.setUsername(eduPersonID);
         this.setMail(mail);
@@ -34,13 +32,11 @@
         this.setCommonName(cn);
     }
 
-
     public ShibbolethUser (String username) {
         super(username, 1);
 
     }
 
-
     @Override
     public String toString () {
         final StringBuffer sb = new StringBuffer("ShibbolethUser{");
@@ -51,39 +47,32 @@
         return sb.toString();
     }
 
-
     @Override
     protected User clone () {
-        return new ShibbolethUser(this.getUsername(), this.getMail(), this.getCommonName(),
-                this.getAffiliation());
+        return new ShibbolethUser(this.getUsername(), this.getMail(),
+                this.getCommonName(), this.getAffiliation());
     }
 
-
     public String getMail () {
         return mail;
     }
 
-
     public void setMail (String mail) {
         this.mail = mail;
     }
 
-
     public String getAffiliation () {
         return affiliation;
     }
 
-
     public void setAffiliation (String affiliation) {
         this.affiliation = affiliation;
     }
 
-
     public String getCommonName () {
         return commonName;
     }
 
-
     public void setCommonName (String commonName) {
         this.commonName = commonName;
     }
diff --git a/full/src/main/java/de/ids_mannheim/korap/user/User.java b/full/src/main/java/de/ids_mannheim/korap/user/User.java
index 66b6873..5f46910 100644
--- a/full/src/main/java/de/ids_mannheim/korap/user/User.java
+++ b/full/src/main/java/de/ids_mannheim/korap/user/User.java
@@ -26,7 +26,7 @@
     //EM: add
     private String email;
     //EM: finish
-    
+
     private Integer id;
     // in local its username, in shib it's edupersonPrincipalName
     private String username;
@@ -47,58 +47,53 @@
 
     private UserSettingProcessor userSettingProcessor;
 
-//    private boolean isSystemAdmin;
+    //    private boolean isSystemAdmin;
 
     // Values for corpusAccess:
-    public enum CorpusAccess	 {
-    	FREE, 	// Access to licence free corpora only, without login   
+    public enum CorpusAccess {
+        FREE, 	// Access to licence free corpora only, without login   
         PUB,	// Access to public (= öffentliche Korpora) only, externes Login.
         ALL 	// Access to all corpora, internes Login.
-    	};
-    	
+    };
+
     @Getter
     @Setter
     private CorpusAccess corpusAccess = CorpusAccess.FREE;
-        
+
     // values for location (set using the X-forwarded-for Header):
-    public enum Location  {
+    public enum Location {
         INTERN, 	// KorAP accessed by internal Client (inside intranet).
         EXTERN		// KorAP accessed by external Client (outside intranet).
     };
-        
+
     @Getter
     @Setter
     private Location location = Location.EXTERN;
 
-    
     protected User () {
         this.fields = new ParamFields();
         this.accountCreation = TimeUtils.getNow().getMillis();
         this.isAccountLocked = false;
         this.username = "";
         this.id = -1;
-        this.location 		= Location.EXTERN;
-        this.corpusAccess 	= CorpusAccess.FREE;
+        this.location = Location.EXTERN;
+        this.corpusAccess = CorpusAccess.FREE;
     }
 
-
     protected User (int type) {
         this();
         this.type = type;
     }
 
-
     protected User (String username, int type) {
         this(type);
         this.username = username;
     }
 
-
     public void addField (ParamFields.Param param) {
         this.fields.add(param);
     }
 
-
     public <T extends ParamFields.Param> T getField (Class<T> cl) {
         return this.fields.get(cl);
     }
@@ -111,7 +106,6 @@
         //            this.details.setUserID(this.id);
     }
 
-
     public Map<String, Object> toMap () {
         Map map = new HashMap();
         map.put(Attributes.USERNAME, this.username);
@@ -123,7 +117,6 @@
         return map;
     }
 
-
     public Map toCache () {
         Map map = new HashMap();
         map.put(Attributes.ID, this.id);
@@ -135,7 +128,6 @@
         return map;
     }
 
-
     @Override
     public boolean equals (Object o) {
         if (this == o)
@@ -148,14 +140,12 @@
         return true;
     }
 
-//    public boolean isAdmin () {
-//        return this.getUsername().equals(ADMINISTRATOR_ID);
-//    }
-
+    //    public boolean isAdmin () {
+    //        return this.getUsername().equals(ADMINISTRATOR_ID);
+    //    }
 
     protected abstract User clone ();
 
-
     @Override
     public String toString () {
         final StringBuffer sb = new StringBuffer();
@@ -164,104 +154,98 @@
         return sb.toString();
     }
 
-    public String locationtoString()
-    
+    public String locationtoString ()
+
     {
-    	if( this.location == Location.INTERN)
-    		return "INTERN";
-    	else if( this.location == Location.EXTERN )
-    		return "EXTERN";
-    	else
-    		return "???";
+        if (this.location == Location.INTERN)
+            return "INTERN";
+        else if (this.location == Location.EXTERN)
+            return "EXTERN";
+        else
+            return "???";
     }
-    
-    public String accesstoString()
-    
+
+    public String accesstoString ()
+
     {
-    	if( this.corpusAccess == CorpusAccess.ALL )
-    		return "ALL";
-    	else if( this.corpusAccess == CorpusAccess.PUB )
-    		return "PUB";
-    	else if( this.corpusAccess == CorpusAccess.FREE )
-    		return "FREE";
-    	else
-    		return "???";
+        if (this.corpusAccess == CorpusAccess.ALL)
+            return "ALL";
+        else if (this.corpusAccess == CorpusAccess.PUB)
+            return "PUB";
+        else if (this.corpusAccess == CorpusAccess.FREE)
+            return "FREE";
+        else
+            return "???";
     }
-    
+
     public static class UserFactory {
 
         public static KorAPUser getUser (String username) {
             return new KorAPUser(username);
         }
 
-
         public static KorAPUser getUser (String username, String password) {
             KorAPUser user = new KorAPUser(username);
             user.setPassword(password);
             return user;
         }
 
-//        public static KorAPUser getAdmin () {
-//            return new KorAPUser(ADMINISTRATOR_ID, ADMINISTRATOR_NAME);
-//        }
-
+        //        public static KorAPUser getAdmin () {
+        //            return new KorAPUser(ADMINISTRATOR_ID, ADMINISTRATOR_NAME);
+        //        }
 
         public static DemoUser getDemoUser () {
             return new DemoUser();
         }
 
-
         public static DemoUser getDemoUser (Integer id) {
             DemoUser demo = new DemoUser();
             demo.setId(id);
             return demo;
         }
 
-
         public static boolean isDemo (String username) {
             return new DemoUser().getUsername().equalsIgnoreCase(username);
         }
 
-
-//        public static ShibUser getShibInstance (String eduPersonID,
-//                String mail, String cn) {
-//            ShibUser u = new ShibUser(eduPersonID);
-//            u.setAffiliation("");
-//            u.setMail(mail);
-//            u.setUsername(eduPersonID);
-//            u.setCn(cn);
-//            return u;
-//        }
-
+        //        public static ShibUser getShibInstance (String eduPersonID,
+        //                String mail, String cn) {
+        //            ShibUser u = new ShibUser(eduPersonID);
+        //            u.setAffiliation("");
+        //            u.setMail(mail);
+        //            u.setUsername(eduPersonID);
+        //            u.setCn(cn);
+        //            return u;
+        //        }
 
         public static KorAPUser toKorAPUser (Map<String, Object> map) {
-            KorAPUser user = UserFactory.getUser((String) map
-                    .get(Attributes.USERNAME));
+            KorAPUser user = UserFactory
+                    .getUser((String) map.get(Attributes.USERNAME));
             user.setPassword((String) map.get(Attributes.PASSWORD));
-            int id = map.get(Attributes.ID) == null ? -1 : (int) map
-                    .get(Attributes.ID);
+            int id = map.get(Attributes.ID) == null ? -1
+                    : (int) map.get(Attributes.ID);
             if (id != -1)
                 user.setId(id);
             long cr = map.get(Attributes.ACCOUNT_CREATION) == null ? -1
                     : (long) map.get(Attributes.ACCOUNT_CREATION);
             if (cr != -1)
-                user.setAccountCreation((Long) map
-                        .get(Attributes.ACCOUNT_CREATION));
+                user.setAccountCreation(
+                        (Long) map.get(Attributes.ACCOUNT_CREATION));
             return user;
         }
 
-
         public static User toUser (Map<String, Object> map) {
             KustvaktMap kmap = new KustvaktMap(map);
-            int type = map.get(Attributes.TYPE) == null ? 0 : (Integer) kmap
-                    .get(Attributes.TYPE, Integer.class);
+            int type = map.get(Attributes.TYPE) == null ? 0
+                    : (Integer) kmap.get(Attributes.TYPE, Integer.class);
             User user;
             long created = -1;
             int id = kmap.get(Attributes.ID, Integer.class) == null ? -1
                     : (Integer) kmap.get(Attributes.ID, Integer.class);
 
             if (map.get(Attributes.ACCOUNT_CREATION) != null)
-                created = TimeUtils.getTime(kmap.get(Attributes.ACCOUNT_CREATION))
+                created = TimeUtils
+                        .getTime(kmap.get(Attributes.ACCOUNT_CREATION))
                         .getMillis();
             switch (type) {
                 case 0:
@@ -269,9 +253,10 @@
                     if (id != -1)
                         user.setId((Integer) kmap.get(Attributes.ID,
                                 Integer.class));
-                    user.setAccountLocked(map.get(Attributes.ACCOUNTLOCK) == null ? false
-                            : (Boolean) kmap.get(Attributes.ACCOUNTLOCK,
-                                    Boolean.class));
+                    user.setAccountLocked(
+                            map.get(Attributes.ACCOUNTLOCK) == null ? false
+                                    : (Boolean) kmap.get(Attributes.ACCOUNTLOCK,
+                                            Boolean.class));
                     user.setAccountCreation(created);
                     break;
                 default:
@@ -281,15 +266,15 @@
             return user;
         }
 
-
         public static KorAPUser toUser (String value) throws KustvaktException {
             JsonNode node = JsonUtils.readTree(value);
-            KorAPUser user = UserFactory.getUser(node.path(Attributes.USERNAME)
-                    .asText());
-            user.setAccountLocked(node.path(Attributes.ACCOUNTLOCK).asBoolean());
+            KorAPUser user = UserFactory
+                    .getUser(node.path(Attributes.USERNAME).asText());
+            user.setAccountLocked(
+                    node.path(Attributes.ACCOUNTLOCK).asBoolean());
             user.setAccountLink(node.path(Attributes.ACCOUNTLINK).asText());
-            user.setAccountCreation(node.path(Attributes.ACCOUNT_CREATION)
-                    .asLong());
+            user.setAccountCreation(
+                    node.path(Attributes.ACCOUNT_CREATION).asLong());
             user.setPassword(node.path(Attributes.PASSWORD).asText());
             return user;
         }
diff --git a/full/src/main/java/de/ids_mannheim/korap/user/UserDetails.java b/full/src/main/java/de/ids_mannheim/korap/user/UserDetails.java
index 9901592..9559813 100644
--- a/full/src/main/java/de/ids_mannheim/korap/user/UserDetails.java
+++ b/full/src/main/java/de/ids_mannheim/korap/user/UserDetails.java
@@ -9,12 +9,11 @@
  */
 public class UserDetails extends Userdata {
 
-
-    public UserDetails() {
+    public UserDetails () {
 
     }
 
-    public UserDetails(Integer userid) {
+    public UserDetails (Integer userid) {
         super(userid);
     }
 
@@ -25,7 +24,6 @@
                 Attributes.LASTNAME, Attributes.FIRSTNAME };
     }
 
-
     @Override
     public String[] defaultFields () {
         return new String[] { Attributes.EMAIL, Attributes.ADDRESS,
diff --git a/full/src/main/java/de/ids_mannheim/korap/user/UserQuery.java b/full/src/main/java/de/ids_mannheim/korap/user/UserQuery.java
index ad48a2d..10037b2 100644
--- a/full/src/main/java/de/ids_mannheim/korap/user/UserQuery.java
+++ b/full/src/main/java/de/ids_mannheim/korap/user/UserQuery.java
@@ -22,7 +22,6 @@
     private String description;
     private Integer creator;
 
-
     public UserQuery (Integer id, int creator) {
         setId(id);
         setCreator(creator);
@@ -32,14 +31,12 @@
         setQueryLanguage("");
     }
 
-
     public UserQuery (String ql, String query, String description) {
         setDescription(description);
         setQuery(query);
         setQueryLanguage(ql);
     }
 
-
     public UserQuery () {
         setDescription("");
         setQuery("");
@@ -47,14 +44,12 @@
         setName("");
     }
 
-
     public void setQuery (String query) {
         this.query = query;
-        setName("Query: "
-                + query.substring(0, query.length() > 20 ? 20 : query.length()));
+        setName("Query: " + query.substring(0,
+                query.length() > 20 ? 20 : query.length()));
     }
 
-
     // todo: use example queries or store in database
     public static List<UserQuery> demoUserQueries () {
 
@@ -62,7 +57,8 @@
         UserQuery q1 = new UserQuery();
         q1.setQueryLanguage("COSMAS2");
         q1.setQuery("$wegen #IN(L) <s>");
-        q1.setDescription("Findet 'wegen' an Satzanfängen. Berücksichtigt auch Groß- und Kleinschreibung");
+        q1.setDescription(
+                "Findet 'wegen' an Satzanfängen. Berücksichtigt auch Groß- und Kleinschreibung");
 
         //todo: change query
         UserQuery q2 = new UserQuery();
@@ -90,7 +86,6 @@
         return queries;
     }
 
-
     //id is irrevelant, since data was coming
     // from frontend and thus this object does not contain a id that could be compared!
     // same with the userAccount. Not set yet!
@@ -108,7 +103,6 @@
         return true;
     }
 
-
     @Override
     public int hashCode () {
         int result = getId() != null ? getId().hashCode() : 0;
@@ -118,7 +112,6 @@
         return result;
     }
 
-
     @Override
     public String toString () {
         final StringBuffer sb = new StringBuffer("UserQuery{");
@@ -131,7 +124,6 @@
         return sb.toString();
     }
 
-
     public Map toMap () {
         Map map = new HashMap();
         map.put("name", this.name);
diff --git a/full/src/main/java/de/ids_mannheim/korap/user/UserSettingProcessor.java b/full/src/main/java/de/ids_mannheim/korap/user/UserSettingProcessor.java
index 57b5e4b..3fcd976 100644
--- a/full/src/main/java/de/ids_mannheim/korap/user/UserSettingProcessor.java
+++ b/full/src/main/java/de/ids_mannheim/korap/user/UserSettingProcessor.java
@@ -8,17 +8,17 @@
  */
 public class UserSettingProcessor extends Userdata {
 
-    public UserSettingProcessor() {
+    public UserSettingProcessor () {
 
     }
 
     @Deprecated
-    public UserSettingProcessor(Integer userid) {
+    public UserSettingProcessor (Integer userid) {
         super(userid);
     }
 
     // EM: added
-    public UserSettingProcessor(String data) {
+    public UserSettingProcessor (String data) {
         super(data);
     }
 
@@ -27,7 +27,6 @@
         return new String[] {};
     }
 
-
     @Override
     public String[] defaultFields () {
         return new String[] { Attributes.DEFAULT_FOUNDRY_RELATION,
diff --git a/full/src/main/java/de/ids_mannheim/korap/user/Userdata.java b/full/src/main/java/de/ids_mannheim/korap/user/Userdata.java
index e735776..f607112 100644
--- a/full/src/main/java/de/ids_mannheim/korap/user/Userdata.java
+++ b/full/src/main/java/de/ids_mannheim/korap/user/Userdata.java
@@ -17,7 +17,7 @@
 public abstract class Userdata {
 
     public DataFactory dataFactory = DataFactory.getFactory();
-    
+
     @Deprecated
     @Getter
     @Setter
@@ -28,14 +28,14 @@
     @Getter
     @Setter
     private Integer userId;
-    
+
     public Userdata () {
         this(-1);
     }
 
     // EM: replace with username
     @Deprecated
-    public Userdata(Integer userid) {
+    public Userdata (Integer userid) {
         this.userId = userid;
         this.id = -1;
         this.data = dataFactory.convertData(null);
@@ -49,16 +49,14 @@
         return dataFactory.size(this.data);
     }
 
-
     public Object get (String key) {
         return dataFactory.getValue(this.data, key);
     }
 
-    public Object filter(String ... keys) {
+    public Object filter (String ... keys) {
         return dataFactory.filter(this.data, keys);
     }
 
-
     /**
      * 
      * @return
@@ -67,7 +65,6 @@
         return findMissingFields().length == 0;
     }
 
-
     public String[] findMissingFields () {
         Set<String> missing = new HashSet<>();
         Set<String> keys = dataFactory.keys(this.data);
@@ -78,7 +75,6 @@
         return missing.toArray(new String[0]);
     }
 
-
     public void checkRequired () throws KustvaktException {
         String[] fields = findMissingFields();
         if (findMissingFields().length != 0) {
@@ -88,36 +84,30 @@
         }
     }
 
-
     //fixme: if data array, return empty?!
     public Set<String> keys () {
         return dataFactory.keys(this.data);
     }
 
-
     public Collection<Object> values () {
         return dataFactory.values(this.data);
     }
 
-
     public void setData (String data) {
         this.data = dataFactory.convertData(data);
     }
 
-
     public void update (Userdata other) {
         if (other != null && this.getClass().equals(other.getClass()))
             this.data = dataFactory.merge(this.data, other.data);
     }
 
-
     public String serialize () throws KustvaktException {
         // to have consistency with required fields --> updates/deletion may cause required fields to be missing.
         this.checkRequired();
         return dataFactory.toStringValue(this.data);
     }
 
-
     public void setField (String key, Object value) {
         dataFactory.addValue(this.data, key, value);
     }
@@ -129,16 +119,14 @@
         dataFactory.validate(this.data, validator);
     }
 
-
     public void read (Map<String, Object> map, boolean defaults_only)
             throws KustvaktException {
         this.readQuietly(map, defaults_only);
         this.checkRequired();
     }
 
-
     public void readQuietly (Map<String, Object> map, boolean defaults_only) {
-        if (map != null){
+        if (map != null) {
             if (defaults_only) {
                 for (String k : defaultFields()) {
                     Object o = map.get(k);
@@ -158,9 +146,8 @@
     public boolean removeField (String field) {
         return dataFactory.removeValue(this.data, field);
     }
-    
-    public abstract String[] requiredFields ();
 
+    public abstract String[] requiredFields ();
 
     public abstract String[] defaultFields ();
 
diff --git a/full/src/main/java/de/ids_mannheim/korap/utils/BooleanUtils.java b/full/src/main/java/de/ids_mannheim/korap/utils/BooleanUtils.java
index 8dbeb4f..a682dd3 100644
--- a/full/src/main/java/de/ids_mannheim/korap/utils/BooleanUtils.java
+++ b/full/src/main/java/de/ids_mannheim/korap/utils/BooleanUtils.java
@@ -8,7 +8,6 @@
 
     public static String dbname;
 
-
     public static Object getBoolean (Object val) {
         if (val == null)
             val = false;
diff --git a/full/src/main/java/de/ids_mannheim/korap/utils/CollectionTypes.java b/full/src/main/java/de/ids_mannheim/korap/utils/CollectionTypes.java
index 6cb0dcd..b4572ac 100644
--- a/full/src/main/java/de/ids_mannheim/korap/utils/CollectionTypes.java
+++ b/full/src/main/java/de/ids_mannheim/korap/utils/CollectionTypes.java
@@ -15,12 +15,10 @@
 
     private ObjectMapper mapper;
 
-
     public CollectionTypes () {
         this.mapper = new ObjectMapper();
     }
 
-
     public Map createGroup (String relation, String field, List terms) {
         if (relation == null)
             return null;
@@ -34,7 +32,6 @@
         return kgroup;
     }
 
-
     public Map createTerm (String field, String subtype, String value,
             String type) {
         Map term = new LinkedHashMap<>();
@@ -49,17 +46,14 @@
         return term;
     }
 
-
     public Map createTerm (String field, String value, String type) {
         return createTerm(field, null, value, type);
     }
 
-
     public Map createTerm (String field, String value) {
         return createTerm(field, value, null);
     }
 
-
     public Map createResourceFilter (String resource, Map value) {
         Map meta = new LinkedHashMap();
         meta.put("@type", "korap:meta-filter");
@@ -68,13 +62,11 @@
         return meta;
     }
 
-
     public Map createResourceFilter (String resource, String value)
             throws IOException {
         return createResourceFilter(resource, mapify(value));
     }
 
-
     public Map createResourceExtend (String resource, Map value) {
         Map meta = new LinkedHashMap();
         meta.put("@type", "korap:meta-extend");
@@ -83,7 +75,6 @@
         return meta;
     }
 
-
     public Map createMetaFilter (Map value) {
         Map meta = new LinkedHashMap();
         meta.put("@type", "korap:meta-filter");
@@ -91,7 +82,6 @@
         return meta;
     }
 
-
     public Map createMetaExtend (Map value) {
         Map meta = new LinkedHashMap();
         meta.put("@type", "korap:meta-extend");
@@ -99,7 +89,6 @@
         return meta;
     }
 
-
     public Map mapify (String s) throws IOException {
         return mapper.readValue(s, Map.class);
     }
diff --git a/full/src/main/java/de/ids_mannheim/korap/utils/ConcurrentMultiMap.java b/full/src/main/java/de/ids_mannheim/korap/utils/ConcurrentMultiMap.java
index ea02e44..12fc139 100644
--- a/full/src/main/java/de/ids_mannheim/korap/utils/ConcurrentMultiMap.java
+++ b/full/src/main/java/de/ids_mannheim/korap/utils/ConcurrentMultiMap.java
@@ -11,7 +11,6 @@
 import java.util.Collection;
 import java.util.Set;
 
-
 /**
  * A general purpose Multimap implementation for delayed processing and concurrent insertion/deletes.
  * This code is based on an implementation by Guido Medina!
@@ -32,17 +31,14 @@
     private final LockMap<K> locks;
     private final ConcurrentMap<K, List<V>> cache;
 
-
     public ConcurrentMultiMap () {
         this(16, 64);
     }
 
-
     public ConcurrentMultiMap (final int concurrencyLevel) {
         this(concurrencyLevel, 64);
     }
 
-
     public ConcurrentMultiMap (final int concurrencyLevel,
                                final int initialCapacity) {
         this.initialCapacity = initialCapacity;
@@ -51,7 +47,6 @@
         locks = new LockMap<K>(concurrencyLevel, initialCapacity);
     }
 
-
     public void put (final K key, final V value) {
         synchronized (locks.getLock(key)) {
             List<V> set = cache.get(key);
@@ -63,7 +58,6 @@
         }
     }
 
-
     public void putAll (final K key, final Collection<V> values) {
         synchronized (locks.getLock(key)) {
             List<V> set = cache.get(key);
@@ -75,14 +69,12 @@
         }
     }
 
-
     public List<V> remove (final K key) {
         synchronized (locks.getLock(key)) {
             return cache.remove(key);
         }
     }
 
-
     public void remove (final K key, final V value) {
         List<V> values = cache.get(key);
         synchronized (locks.getLock(key)) {
@@ -90,47 +82,38 @@
         }
     }
 
-
     public Set<K> getKeySet () {
         return cache.keySet();
     }
 
-
     public int size () {
         return cache.size();
     }
 
-
     public boolean containsKey (K key) {
         return cache.containsKey(key);
     }
 
-
     public List<V> get (K key) {
         return cache.get(key);
     }
 
-
     public class LockMap<K extends Comparable> {
         private final ConcurrentMap<K, Object> locks;
 
-
         public LockMap () {
             this(16, 64);
         }
 
-
         public LockMap (final int concurrencyLevel) {
             this(concurrencyLevel, 64);
         }
 
-
         public LockMap (final int concurrencyLevel, final int initialCapacity) {
             locks = new MapMaker().concurrencyLevel(concurrencyLevel)
                     .initialCapacity(initialCapacity).weakValues().makeMap();
         }
 
-
         public Object getLock (final K key) {
             final Object object = new Object();
             Object lock = locks.putIfAbsent(key, object);
@@ -139,10 +122,8 @@
 
     }
 
-
     public String toString () {
         return cache.toString();
     }
 
-
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/utils/IPNetMask.java b/full/src/main/java/de/ids_mannheim/korap/utils/IPNetMask.java
index c2511a7..133c330 100644
--- a/full/src/main/java/de/ids_mannheim/korap/utils/IPNetMask.java
+++ b/full/src/main/java/de/ids_mannheim/korap/utils/IPNetMask.java
@@ -23,7 +23,6 @@
 
     private static final int default_mask = 16;
 
-
     private IPNetMask (Inet4Address i4addr, byte mask) {
         this.i4addr = i4addr;
         this.maskCtr = mask;
@@ -32,7 +31,6 @@
         this.maskInt = ~((1 << (32 - maskCtr)) - 1);
     }
 
-
     /**
      * IPNetMask factory method.
      * 
@@ -63,7 +61,6 @@
                 maskCtr);
     }
 
-
     /**
      * Test given IPv4 address against this IPNetMask object.
      * 
@@ -76,7 +73,6 @@
         return ((addrInt & maskInt) == (testAddrInt & maskInt));
     }
 
-
     /**
      * Convenience method that converts String host to IPv4 address.
      * 
@@ -91,7 +87,6 @@
         return matches((Inet4Address) InetAddress.getByName(addr));
     }
 
-
     /**
      * Converts IPv4 address to integer representation.
      */
@@ -101,13 +96,11 @@
                 | (ba[3] & 0xFF);
     }
 
-
     @Override
     public String toString () {
         return i4addr.getHostAddress() + "/" + maskCtr;
     }
 
-
     @Override
     public boolean equals (Object obj) {
         if (obj == null)
@@ -118,7 +111,6 @@
         return (this.addrInt == that.addrInt && this.maskInt == that.maskInt);
     }
 
-
     @Override
     public int hashCode () {
         return this.maskInt + this.addrInt;
diff --git a/full/src/main/java/de/ids_mannheim/korap/utils/JerseyUtils.java b/full/src/main/java/de/ids_mannheim/korap/utils/JerseyUtils.java
index c60dfa0..08f73d1 100644
--- a/full/src/main/java/de/ids_mannheim/korap/utils/JerseyUtils.java
+++ b/full/src/main/java/de/ids_mannheim/korap/utils/JerseyUtils.java
@@ -15,11 +15,14 @@
      * This method will ensure that the request entity is buffered
      * such that it may be consumed by the application.
      *
-     * @return the form parameters, if there is a request entity and the
-     * content type is "application/x-www-form-urlencoded", otherwise an
-     * instance containing no parameters will be returned.
+     * @return the form parameters, if there is a request entity and
+     *         the
+     *         content type is "application/x-www-form-urlencoded",
+     *         otherwise an
+     *         instance containing no parameters will be returned.
      */
-    public static Form getFormParameters (ContainerRequestContext requestContext) {
+    public static Form getFormParameters (
+            ContainerRequestContext requestContext) {
         if (requestContext instanceof ContainerRequest) {
             return getFormParameters((ContainerRequest) requestContext);
         }
@@ -27,11 +30,13 @@
     }
 
     private static Form getFormParameters (ContainerRequest request) {
-        if (MediaTypes.typeEqual(MediaType.APPLICATION_FORM_URLENCODED_TYPE, request.getMediaType())) {
+        if (MediaTypes.typeEqual(MediaType.APPLICATION_FORM_URLENCODED_TYPE,
+                request.getMediaType())) {
             request.bufferEntity();
             Form form = request.readEntity(Form.class);
             return (form == null ? new Form() : form);
-        } else {
+        }
+        else {
             return new Form();
         }
     }
diff --git a/full/src/main/java/de/ids_mannheim/korap/utils/JsonUtils.java b/full/src/main/java/de/ids_mannheim/korap/utils/JsonUtils.java
index 792a6bb..ab67779 100644
--- a/full/src/main/java/de/ids_mannheim/korap/utils/JsonUtils.java
+++ b/full/src/main/java/de/ids_mannheim/korap/utils/JsonUtils.java
@@ -26,7 +26,6 @@
 
     private JsonUtils () {}
 
-
     public static String toJSON (Object values) throws KustvaktException {
         try {
             return mapper.writeValueAsString(values);
@@ -37,7 +36,6 @@
         }
     }
 
-
     public static JsonNode readTree (String json) throws KustvaktException {
         try {
             return mapper.readTree(json);
@@ -47,17 +45,15 @@
                     "Failed deserializing json object: " + json, json, e);
         }
     }
-    
+
     public static ObjectNode createObjectNode () {
         return mapper.createObjectNode();
     }
 
-
     public static ArrayNode createArrayNode () {
         return mapper.createArrayNode();
     }
 
-
     public static JsonNode valueToTree (Object value) {
         return mapper.valueToTree(value);
     }
@@ -75,20 +71,18 @@
         return mapper.readValue(is, cl);
     }
 
-
     public static <T> T readFile (String path, Class<T> clazz)
             throws IOException {
         return mapper.readValue(new File(path), clazz);
     }
 
-
     public static void writeFile (String path, Object content)
             throws IOException {
         mapper.writeValue(new File(path), content);
     }
 
-
-    public static <T> T convertToClass (String json, Class<T> cl) throws KustvaktException {
+    public static <T> T convertToClass (String json, Class<T> cl)
+            throws KustvaktException {
         T t = null;
         try {
             t = mapper.readValue(json, cl);
@@ -100,7 +94,6 @@
         return t;
     }
 
-
     public static List<Map<String, Object>> convertToList (String json)
             throws JsonProcessingException, KustvaktException {
         List d = new ArrayList();
@@ -108,8 +101,8 @@
         if (node.isArray()) {
             Iterator<JsonNode> nodes = node.iterator();
             while (nodes.hasNext()) {
-                Map<String, Object> map =
-                        mapper.treeToValue(nodes.next(), Map.class);
+                Map<String, Object> map = mapper.treeToValue(nodes.next(),
+                        Map.class);
                 d.add(map);
             }
         }
diff --git a/full/src/main/java/de/ids_mannheim/korap/utils/KoralCollectionQueryBuilder.java b/full/src/main/java/de/ids_mannheim/korap/utils/KoralCollectionQueryBuilder.java
index a6260cb..7dd99ad 100644
--- a/full/src/main/java/de/ids_mannheim/korap/utils/KoralCollectionQueryBuilder.java
+++ b/full/src/main/java/de/ids_mannheim/korap/utils/KoralCollectionQueryBuilder.java
@@ -35,7 +35,6 @@
         this(false);
     }
 
-
     public KoralCollectionQueryBuilder (boolean verbose) {
         this.verbose = verbose;
         this.builder = new StringBuilder();
@@ -43,7 +42,6 @@
         this.mergeOperator = null;
     }
 
-
     /**
      * raw method for field - value pair adding. Supports all
      * operators (leq, geq, contains, etc.)
@@ -64,7 +62,6 @@
         return this;
     }
 
-
     /**
      * element can be a more complex sub query like
      * (textClass=freizeit & Attributes.CORPUS_SIGLE=WPD)
@@ -82,31 +79,30 @@
         return this;
     }
 
-
-
     public KoralCollectionQueryBuilder and () {
-        if (this.builder.length() != 0) this.builder.append(" & ");
+        if (this.builder.length() != 0)
+            this.builder.append(" & ");
         if (this.base != null && this.mergeOperator == null)
             this.mergeOperator = "AND";
         return this;
     }
 
-
     public KoralCollectionQueryBuilder or () {
-        if (this.builder.length() != 0) this.builder.append(" | ");
+        if (this.builder.length() != 0)
+            this.builder.append(" | ");
         if (this.base != null && this.mergeOperator == null)
             this.mergeOperator = "OR";
         return this;
     }
 
-
     public JsonNode rebaseCollection () throws KustvaktException {
-        if (this.builder.length() == 0 && this.base == null) return null;
+        if (this.builder.length() == 0 && this.base == null)
+            return null;
 
         JsonNode request = null;
         if (this.builder.length() != 0) {
-            CollectionQueryProcessor tree =
-                    new CollectionQueryProcessor(this.verbose);
+            CollectionQueryProcessor tree = new CollectionQueryProcessor(
+                    this.verbose);
             tree.process(this.builder.toString());
             if (tree.getErrors().size() > 0) {
                 // legacy support
@@ -116,15 +112,16 @@
                         int code = (int) e.get(0);
                         notif.addError(code, (String[]) e.get(1));
                         String notificationStr = notif.toJsonString();
-                        throw new KustvaktException(StatusCodes.SERIALIZATION_FAILED,
+                        throw new KustvaktException(
+                                StatusCodes.SERIALIZATION_FAILED,
                                 notificationStr, true);
                     }
-                    else{
+                    else {
                         break;
                     }
                 }
                 // -- end of legacy support
-                
+
                 Map<String, Object> map = new HashMap<>();
                 map.put("errors", tree.getErrors());
                 String errors = JsonUtils.toJSON(map);
@@ -145,7 +142,6 @@
         return request;
     }
 
-
     public JsonNode mergeWith (JsonNode node) {
         if (this.base != null) {
             if (node != null) {
@@ -158,10 +154,10 @@
                 else if (result.isMissingNode() && tobase.isMissingNode())
                     return base;
                 else {
-                    result = JsonBuilder.buildDocGroup(
-                            this.mergeOperator != null
-                                    ? this.mergeOperator.toLowerCase() : "and",
-                            result, tobase);
+                    result = JsonBuilder
+                            .buildDocGroup(this.mergeOperator != null
+                                    ? this.mergeOperator.toLowerCase()
+                                    : "and", result, tobase);
                 }
                 ((ObjectNode) base).put("collection", result);
                 return base;
@@ -171,38 +167,34 @@
         throw new RuntimeException("no query found to merge with!");
     }
 
-
     /**
      * sets base query. All consequent queries are added to the first
      * koral:docGroup within the collection base query
      * If no group in base query, consequent queries are skipped.
      * 
      * @param query
-     * @throws KustvaktException 
+     * @throws KustvaktException
      */
-    public KoralCollectionQueryBuilder setBaseQuery (String query) throws KustvaktException {
+    public KoralCollectionQueryBuilder setBaseQuery (String query)
+            throws KustvaktException {
         this.base = JsonUtils.readTree(query);
         return this;
     }
 
-
     public KoralCollectionQueryBuilder setBaseQuery (JsonNode query) {
         this.base = query;
         return this;
     }
 
-
     public String toJSON () throws KustvaktException {
         return JsonUtils.toJSON(rebaseCollection());
     }
 
-
     @Override
     public String toString () {
         return this.builder.toString();
     }
 
-
     private static class JsonBuilder {
 
         public static ObjectNode buildDoc (String key, String value) {
@@ -215,7 +207,6 @@
             return node;
         }
 
-
         public static ObjectNode buildDocGroup (String op,
                 JsonNode ... groups) {
             ObjectNode node = JsonUtils.createObjectNode();
diff --git a/full/src/main/java/de/ids_mannheim/korap/utils/NamingUtils.java b/full/src/main/java/de/ids_mannheim/korap/utils/NamingUtils.java
index beafb32..dae6908 100644
--- a/full/src/main/java/de/ids_mannheim/korap/utils/NamingUtils.java
+++ b/full/src/main/java/de/ids_mannheim/korap/utils/NamingUtils.java
@@ -10,10 +10,6 @@
  */
 public class NamingUtils {
 
-
-
     private NamingUtils () {}
 
-
-
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/utils/ParameterChecker.java b/full/src/main/java/de/ids_mannheim/korap/utils/ParameterChecker.java
index 2673c80..9b98faa 100644
--- a/full/src/main/java/de/ids_mannheim/korap/utils/ParameterChecker.java
+++ b/full/src/main/java/de/ids_mannheim/korap/utils/ParameterChecker.java
@@ -22,7 +22,7 @@
                     name + " is null", name);
         }
         else if (collection.isEmpty()) {
-            throw new KustvaktException(StatusCodes.INVALID_ARGUMENT, 
+            throw new KustvaktException(StatusCodes.INVALID_ARGUMENT,
                     name + " is empty", name);
         }
     }
@@ -30,11 +30,11 @@
     public static void checkStringValue (String string, String name)
             throws KustvaktException {
         if (string == null) {
-            throw new KustvaktException(StatusCodes.INVALID_ARGUMENT, 
+            throw new KustvaktException(StatusCodes.INVALID_ARGUMENT,
                     name + " is null", name);
         }
         else if (string.isEmpty()) {
-            throw new KustvaktException(StatusCodes.INVALID_ARGUMENT, 
+            throw new KustvaktException(StatusCodes.INVALID_ARGUMENT,
                     name + " is empty", name);
         }
     }
@@ -42,11 +42,11 @@
     public static void checkIntegerValue (int integer, String name)
             throws KustvaktException {
         if (integer == 0) {
-            throw new KustvaktException(StatusCodes.MISSING_PARAMETER, 
+            throw new KustvaktException(StatusCodes.MISSING_PARAMETER,
                     name + " is missing", name);
         }
     }
-    
+
     public static void checkNameValue (String value, String name)
             throws KustvaktException {
         if (value == null) {
@@ -55,7 +55,7 @@
         }
         else if (value.length() < 3) {
             throw new KustvaktException(StatusCodes.INVALID_ARGUMENT,
-                    name+" must contain at least 3 characters", name);
+                    name + " must contain at least 3 characters", name);
         }
     }
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/utils/PrefixTreeMap.java b/full/src/main/java/de/ids_mannheim/korap/utils/PrefixTreeMap.java
index 20e94d5..7cfcb17 100644
--- a/full/src/main/java/de/ids_mannheim/korap/utils/PrefixTreeMap.java
+++ b/full/src/main/java/de/ids_mannheim/korap/utils/PrefixTreeMap.java
@@ -9,7 +9,6 @@
  */
 public class PrefixTreeMap<V> extends TreeMap<String, V> {
 
-
     public SortedMap<String, V> getPrefixSubMap (String prefix) {
         if (prefix != null && prefix.length() > 0) {
             SortedMap d = this.subMap(prefix, getEnd(prefix));
@@ -20,14 +19,12 @@
         return null;
     }
 
-
     private String getEnd (String prefix) {
         char nextLetter = (char) (prefix.charAt(prefix.length() - 1) + 1);
         return prefix.substring(0, prefix.length() - 1) + nextLetter;
 
     }
 
-
     public V getFirstValue (String prefix) {
         if (prefix.length() > 0) {
             String first = this.subMap(prefix, getEnd(prefix)).firstKey();
@@ -36,7 +33,6 @@
         return null;
     }
 
-
     public V getLastValue (String prefix) {
         if (prefix.length() > 0) {
             String last = this.subMap(prefix, getEnd(prefix)).lastKey();
diff --git a/full/src/main/java/de/ids_mannheim/korap/utils/PropertyReader.java b/full/src/main/java/de/ids_mannheim/korap/utils/PropertyReader.java
index 0b16cc0..b377cd1 100644
--- a/full/src/main/java/de/ids_mannheim/korap/utils/PropertyReader.java
+++ b/full/src/main/java/de/ids_mannheim/korap/utils/PropertyReader.java
@@ -31,7 +31,6 @@
         return res;
     }
 
-
     public abstract void load ();
 
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/utils/ServiceInfo.java b/full/src/main/java/de/ids_mannheim/korap/utils/ServiceInfo.java
index fa83ebc..7d6f8a3 100644
--- a/full/src/main/java/de/ids_mannheim/korap/utils/ServiceInfo.java
+++ b/full/src/main/java/de/ids_mannheim/korap/utils/ServiceInfo.java
@@ -31,21 +31,19 @@
     @Getter
     private String cache_store;
 
-
     @Getter
     private String krillVersion;
     @Getter
     private String koralVersion;
-    
+
     private ServiceInfo () {
         load();
     }
 
-
     private void load () {
         Properties props = new Properties();
         try {
-            
+
             InputStream stream = getStream();
             props.load(stream);
             stream.close();
@@ -53,13 +51,14 @@
             this.name = (String) props.get("kustvakt.name");
             this.config = (String) props.get("kustvakt.properties");
             this.logger = (String) props.get("kustvakt.logging");
-            this.cacheable = Boolean.valueOf((String) props.get("kustvakt.cache"));
+            this.cacheable = Boolean
+                    .valueOf((String) props.get("kustvakt.cache"));
             this.cache_store = (String) props.get("kustvakt.cache_store");
-            
-            this.krillVersion=(String) props.get("krill.version");
-            
+
+            this.krillVersion = (String) props.get("krill.version");
+
             QuerySerializer s = new QuerySerializer();
-            this.koralVersion = s.getVersion() ;
+            this.koralVersion = s.getVersion();
         }
         catch (IOException e) {
             this.version = UNKNOWN;
@@ -68,23 +67,21 @@
             this.config = UNKNOWN;
             this.cacheable = false;
             this.cache_store = UNKNOWN;
-            
+
             this.koralVersion = UNKNOWN;
             this.krillVersion = UNKNOWN;
         }
     }
 
-
     private static InputStream getStream () throws IOException {
         String path = "service.properties";
         InputStream stream = ConfigLoader.loadConfigStream(path);
         if (stream == null)
-            throw new IOException("stream for resource " + path
-                    + " could not be found...");
+            throw new IOException(
+                    "stream for resource " + path + " could not be found...");
         return stream;
     }
 
-
     public static ServiceInfo getInfo () {
         return info;
     }
diff --git a/full/src/main/java/de/ids_mannheim/korap/utils/SqlBuilder.java b/full/src/main/java/de/ids_mannheim/korap/utils/SqlBuilder.java
index fa1314b..5b31f51 100644
--- a/full/src/main/java/de/ids_mannheim/korap/utils/SqlBuilder.java
+++ b/full/src/main/java/de/ids_mannheim/korap/utils/SqlBuilder.java
@@ -11,13 +11,11 @@
     private String[] fields;
     private String where;
 
-
     public SqlBuilder (String table) {
         this.buffer = new StringBuffer();
         this.table = table;
     }
 
-
     public SqlBuilder select (String ... fields) {
         this.buffer.append("SELECT ");
         if (fields.length > 0) {
@@ -33,27 +31,23 @@
         return this;
     }
 
-
     public SqlBuilder update (String ... fields) {
         this.buffer.append("UPDATE ").append(table);
         this.fields = fields;
         return this;
     }
 
-
     public SqlBuilder insert (String ... fields) {
         this.buffer.append("INSERT INTO ").append(table);
         this.fields = fields;
         return this;
     }
 
-
     public SqlBuilder delete () {
         this.buffer.append("DELETE FROM ").append(table);
         return this;
     }
 
-
     public SqlBuilder params (String ... values) {
         if (values.length != fields.length)
             return this;
@@ -84,13 +78,11 @@
         return this;
     }
 
-
     public SqlBuilder where (String where) {
         this.where = where;
         return this;
     }
 
-
     @Override
     public String toString () {
         StringBuffer b = new StringBuffer(this.buffer);
diff --git a/full/src/main/java/de/ids_mannheim/korap/utils/StringUtils.java b/full/src/main/java/de/ids_mannheim/korap/utils/StringUtils.java
index 99c9578..dd6259a 100644
--- a/full/src/main/java/de/ids_mannheim/korap/utils/StringUtils.java
+++ b/full/src/main/java/de/ids_mannheim/korap/utils/StringUtils.java
@@ -9,13 +9,11 @@
 import java.util.*;
 
 public class StringUtils {
-    private final static Logger jlog = LogManager
-            .getLogger(StringUtils.class);
+    private final static Logger jlog = LogManager.getLogger(StringUtils.class);
 
     private static final String SEP = ";";
     private static final String SLASH = "/";
 
-
     public static Collection<UUID> stringToUUIDList (String s) {
         String[] array = s.split(SEP);
         List<UUID> list = new LinkedList<>();
@@ -25,7 +23,6 @@
         return list;
     }
 
-
     public static List<String> toList (String values) {
         List<String> list = new ArrayList<>();
         StringTokenizer tokenizer = new StringTokenizer(values, SEP);
@@ -34,7 +31,6 @@
         return list;
     }
 
-
     public static Set<String> toSet (String values, String sep) {
         Set<String> set = new HashSet<>();
         if (values != null && !values.isEmpty()) {
@@ -45,17 +41,14 @@
         return set;
     }
 
-
     public static Set<String> toSet (String values) {
         return toSet(values, SEP);
     }
 
-
     public static String toString (Collection<String> values) {
         return StringUtils.toString(values, SEP);
     }
 
-
     public static String toString (Collection<String> values, String sep) {
         StringBuffer b = new StringBuffer();
         for (String s : values)
@@ -66,7 +59,6 @@
         return b.toString();
     }
 
-
     public static String orderedToString (Collection<String> hash) {
         Set<String> orderedSet = new TreeSet<>();
         orderedSet.addAll(hash);
@@ -84,7 +76,6 @@
         }
     }
 
-
     public static String UUIDsetToString (Collection<UUID> hash) {
         Set<UUID> orderedSet = new TreeSet<>();
         orderedSet.addAll(hash);
@@ -102,7 +93,6 @@
         }
     }
 
-
     public static String buildSQLRegex (String path) {
         StringBuilder b = new StringBuilder();
         String[] match = path.split("/");
@@ -112,7 +102,6 @@
         return b.toString();
     }
 
-
     // todo: move to parameter utils
     public static boolean isInteger (String value) {
         try {
@@ -125,29 +114,24 @@
         }
     }
 
-
     public static String normalize (String value) {
         return value.trim().toLowerCase();
     }
 
-
     public static String normalizeHTML (String value) {
         return StringEscapeUtils.escapeHtml(value);
     }
 
-
     public static String decodeHTML (String value) {
         return StringEscapeUtils.unescapeHtml(value);
     }
 
-
     public static String getDocSigle (String textSigle) {
         if (textSigle != null)
             return textSigle.split("\\.")[0];
         return null;
     }
 
-
     public static String getCorpusSigle (String textSigle) {
         //WPD_SSS.07367
         if (textSigle != null)
@@ -155,7 +139,6 @@
         return null;
     }
 
-
     public static Collection<String> joinStringSet (Collection<String> source,
             String other) {
         Set<String> set = new HashSet<>(source);
@@ -163,7 +146,6 @@
         return set;
     }
 
-
     public static Collection<UUID> joinUUIDSet (Collection<UUID> source,
             UUID other) {
         Set<UUID> set = new HashSet<>(source);
@@ -171,7 +153,6 @@
         return set;
     }
 
-
     public static String joinResources (String first, String second) {
         String res;
         if (first != null && !first.isEmpty())
@@ -181,7 +162,6 @@
         return res.replaceAll("\\s", "");
     }
 
-
     public static String[] splitAnnotations (String joined) {
         String[] spl = joined.split(SLASH);
         if (spl.length == 2)
@@ -190,7 +170,6 @@
             return null;
     }
 
-
     public static String stripTokenType (String token) {
         int idx = token.lastIndexOf(" ");
         if (idx == -1)
@@ -198,7 +177,6 @@
         return token.substring(idx).replaceAll("\\s", "");
     }
 
-
     public static String getTokenType (String token) {
         if (token.contains(" "))
             return token.substring(0, token.lastIndexOf(" "))
@@ -207,7 +185,7 @@
             return null;
     }
 
-    public static String toSHAHash(String input) {
+    public static String toSHAHash (String input) {
         try {
             MessageDigest md = MessageDigest.getInstance("SHA-256");
             md.update(input.getBytes());
@@ -215,12 +193,13 @@
 
             StringBuffer sb = new StringBuffer();
             for (int i = 0; i < mdbytes.length; i++)
-                sb.append(Integer.toString((mdbytes[i] & 0xff) + 0x100, 16).substring(1));
+                sb.append(Integer.toString((mdbytes[i] & 0xff) + 0x100, 16)
+                        .substring(1));
             return sb.toString();
-        } catch (NoSuchAlgorithmException e) {
+        }
+        catch (NoSuchAlgorithmException e) {
             return null;
         }
     }
 
-
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/utils/TimeUtils.java b/full/src/main/java/de/ids_mannheim/korap/utils/TimeUtils.java
index d6f2daf..0a5f5e3 100644
--- a/full/src/main/java/de/ids_mannheim/korap/utils/TimeUtils.java
+++ b/full/src/main/java/de/ids_mannheim/korap/utils/TimeUtils.java
@@ -31,11 +31,11 @@
     private static DecimalFormat df = new DecimalFormat("#.#############");
     private static DateTimeFormatter dtf = DateTimeFormat
             .forPattern("dd/MM/yyyy");
-    private static final DateTimeZone dtz = DateTimeZone.forID(Attributes.DEFAULT_TIME_ZONE);
+    private static final DateTimeZone dtz = DateTimeZone
+            .forID(Attributes.DEFAULT_TIME_ZONE);
     private static final boolean DEBUG = false;
     private static Logger jlog = LogManager.getLogger(TimeUtils.class);
 
-
     public static int convertTimeToSeconds (String expirationVal) {
         expirationVal = expirationVal.trim();
         int finIndex = expirationVal.length() - 1;
@@ -55,8 +55,9 @@
             case 'S':
                 return returnSec;
             default:
-                if (DEBUG){
-                    jlog.debug("no time unit specified. Trying to read from default (minutes)");
+                if (DEBUG) {
+                    jlog.debug(
+                            "no time unit specified. Trying to read from default (minutes)");
                 }
                 return Integer.valueOf(expirationVal) * 60;
         }
@@ -67,53 +68,50 @@
         return DateTime.now(dtz);
     }
 
-    public static DateTime getTime(String time) {
+    public static DateTime getTime (String time) {
         return DateTime.parse(time).withZone(dtz);
     }
 
-    public static DateTime getTime(long time) {
+    public static DateTime getTime (long time) {
         return new DateTime(time).withZone(dtz);
     }
 
     //returns difference in milliseconds
     public static long calcDiff (DateTime now, DateTime future) {
-        long diff = (future.withZone(dtz).getMillis() - now.withZone(dtz)
-                .getMillis());
+        long diff = (future.withZone(dtz).getMillis()
+                - now.withZone(dtz).getMillis());
         return diff;
     }
 
-
-    public static boolean isExpired(long time) {
+    public static boolean isExpired (long time) {
         return getNow().isAfter(time);
 
     }
 
-
     // returns difference in seconds in floating number
     public static float floating (DateTime past, DateTime now) {
-        long diff = (now.withZone(dtz).getMillis() - past.withZone(dtz)
-                .getMillis());
+        long diff = (now.withZone(dtz).getMillis()
+                - past.withZone(dtz).getMillis());
         double fin = diff / 1000.0;
         BigDecimal bd = new BigDecimal(fin).setScale(8, RoundingMode.HALF_EVEN);
         return bd.floatValue();
     }
 
-
     public static DateTime fromCosmas (String date) {
         int idx = date.length();
         try {
-            Integer sec = Integer.valueOf(date.substring((idx = idx - 2),
-                    date.length()).trim());
-            Integer min = Integer.valueOf(date.substring((idx = idx - 2),
-                    idx + 2).trim());
-            Integer hours = Integer.valueOf(date.substring((idx = idx - 2),
-                    idx + 2).trim());
-            Integer day = Integer.valueOf(date.substring((idx = idx - 2),
-                    idx + 2).trim());
-            Integer month = Integer.valueOf(date.substring((idx = idx - 2),
-                    idx + 2).trim());
-            Integer year = Integer.valueOf(date.substring((idx = idx - 4),
-                    idx + 4).trim());
+            Integer sec = Integer.valueOf(
+                    date.substring((idx = idx - 2), date.length()).trim());
+            Integer min = Integer
+                    .valueOf(date.substring((idx = idx - 2), idx + 2).trim());
+            Integer hours = Integer
+                    .valueOf(date.substring((idx = idx - 2), idx + 2).trim());
+            Integer day = Integer
+                    .valueOf(date.substring((idx = idx - 2), idx + 2).trim());
+            Integer month = Integer
+                    .valueOf(date.substring((idx = idx - 2), idx + 2).trim());
+            Integer year = Integer
+                    .valueOf(date.substring((idx = idx - 4), idx + 4).trim());
             return new DateTime(year, month, day, hours, min, sec);
         }
         catch (NumberFormatException e) {
@@ -121,12 +119,10 @@
         }
     }
 
-
     public static String formatDiff (DateTime now, DateTime after) {
         return df.format(calcDiff(now, after));
     }
 
-
     /**
      * converts time to the ISO8601 standard.
      * 
@@ -138,13 +134,11 @@
         return fmt.withZone(dtz).print(time);
     }
 
-
     public static String format (long time) {
         DateTimeFormatter fmt = ISODateTimeFormat.dateTime();
         return fmt.withZone(dtz).print(time);
     }
 
-
     /**
      * calculate expiration time
      * 
@@ -157,12 +151,10 @@
         return new DateTime(creation).withZone(dtz).plusSeconds(plus);
     }
 
-
     public static DateTime getExpiration (long now, int exp) {
         return new DateTime(now).withZone(dtz).plusSeconds(exp);
     }
 
-
     /**
      * @param plus
      * @return
@@ -171,17 +163,14 @@
         return getNow().withZone(dtz).plusSeconds(plus);
     }
 
-
     public static DateTime plusHours (int hours) {
         return getNow().withZone(dtz).plusHours(hours);
     }
 
-
     public static DateTime plusMinutes (int minutes) {
         return getNow().withZone(dtz).plusMinutes(minutes);
     }
 
-
     /**
      * create time stamp from long value
      * 
@@ -193,13 +182,11 @@
         return new DateTime(t).withZone(dtz).toLocalDate();
     }
 
-
     public static DateTime getDate (int day, int month, int year) {
         DateTime date = new DateTime().withZone(dtz);
         return date.withDate(year, month, day);
     }
 
-
     public static String toString (long val, Locale locale) {
         if (locale == Locale.GERMAN)
             return new DateTime(val).toString("dd. MMMM yyyy, HH:mm",
@@ -210,7 +197,6 @@
 
     }
 
-
     public static String dateToString (long val, int i) {
         switch (i) {
             case 1:
diff --git a/full/src/main/java/de/ids_mannheim/korap/validator/ApacheValidator.java b/full/src/main/java/de/ids_mannheim/korap/validator/ApacheValidator.java
index c88a0da..cbf7ffc 100644
--- a/full/src/main/java/de/ids_mannheim/korap/validator/ApacheValidator.java
+++ b/full/src/main/java/de/ids_mannheim/korap/validator/ApacheValidator.java
@@ -20,7 +20,7 @@
 
 /**
  * Created by hanl on 09.06.16.
- *  
+ * 
  */
 public class ApacheValidator implements Validator {
 
@@ -32,12 +32,10 @@
 
     private Map<String, RegexValidator> validators;
 
-
     public ApacheValidator () throws IOException {
         this.validators = load();
     }
 
-
     private static Map<String, RegexValidator> load () throws IOException {
         Map<String, RegexValidator> validatorMap = new HashMap<>();
         Properties p = ConfigLoader.loadProperties("validation.properties");
@@ -53,8 +51,6 @@
         return validatorMap;
     }
 
-
-
     @Override
     public Map<String, Object> validateMap (Map<String, Object> map)
             throws KustvaktException {
@@ -91,7 +87,6 @@
         return safeMap;
     }
 
-
     @Override
     public String validateEntry (String input, String type)
             throws KustvaktException {
@@ -101,7 +96,6 @@
         return input;
     }
 
-
     @Override
     public boolean isValid (String input, String type) {
         boolean valid = false;
@@ -124,11 +118,11 @@
             else
                 return this.isValid(input, "string");
         }
-        if (DEBUG){
-            jlog.debug("validating entry "+input+" of type "+type+": "+ (
-                    valid ? "Is valid!" : "Is not valid!"));
+        if (DEBUG) {
+            jlog.debug("validating entry " + input + " of type " + type + ": "
+                    + (valid ? "Is valid!" : "Is not valid!"));
         }
-            
+
         return valid;
     }
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/validator/Validator.java b/full/src/main/java/de/ids_mannheim/korap/validator/Validator.java
index b20cb3b..3bd42a5 100644
--- a/full/src/main/java/de/ids_mannheim/korap/validator/Validator.java
+++ b/full/src/main/java/de/ids_mannheim/korap/validator/Validator.java
@@ -14,13 +14,10 @@
 @Component
 public interface Validator {
 
-
-    Map<String, Object> validateMap (Map<String, Object> map) throws KustvaktException;
-
-
-    String validateEntry (String input, String type)
+    Map<String, Object> validateMap (Map<String, Object> map)
             throws KustvaktException;
 
+    String validateEntry (String input, String type) throws KustvaktException;
 
     boolean isValid (String input, String type);
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/ClientsHandler.java b/full/src/main/java/de/ids_mannheim/korap/web/ClientsHandler.java
index 4964913..16cfcd1 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/ClientsHandler.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/ClientsHandler.java
@@ -21,26 +21,24 @@
 
     private WebTarget service;
 
-
     public ClientsHandler (URI address) {
         Client client = ClientBuilder.newClient();
         this.service = client.target(address);
     }
 
-
     public String getResponse (String path, String key, Object value)
             throws KustvaktException {
         try {
-            return service.path(path).queryParam(key, value).request().get(String.class);
+            return service.path(path).queryParam(key, value).request()
+                    .get(String.class);
         }
         catch (WebApplicationException e) {
             throw new KustvaktException(StatusCodes.INVALID_REQUEST);
         }
     }
 
-
-    public String getResponse (MultivaluedMap<String, String> map, String ... paths)
-            throws KustvaktException {
+    public String getResponse (MultivaluedMap<String, String> map,
+            String ... paths) throws KustvaktException {
         try {
             WebTarget resource = service;
             for (String p : paths)
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/CoreResponseHandler.java b/full/src/main/java/de/ids_mannheim/korap/web/CoreResponseHandler.java
index 3d9cd42..920d38b 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/CoreResponseHandler.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/CoreResponseHandler.java
@@ -22,7 +22,7 @@
             }
             // KustvaktException just wraps another exception 
             else {
-                s=Response.status(Response.Status.BAD_REQUEST)
+                s = Response.status(Response.Status.BAD_REQUEST)
                         .entity(e.getNotification()).build();
             }
         }
@@ -38,7 +38,6 @@
                 .entity(buildNotification(code, "", "")).build());
     }
 
-
     public WebApplicationException throwit (int code, String message,
             String entity) {
         return new WebApplicationException(Response.status(getStatus(code))
@@ -80,7 +79,7 @@
                 break;
             case StatusCodes.CACHING_VC:
                 status = Response.Status.SERVICE_UNAVAILABLE;
-                break;    
+                break;
         }
         return status;
     }
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/KustvaktResponseHandler.java b/full/src/main/java/de/ids_mannheim/korap/web/KustvaktResponseHandler.java
index 79ce3bc..1118b26 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/KustvaktResponseHandler.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/KustvaktResponseHandler.java
@@ -54,7 +54,7 @@
         EnumSet<AuthenticationScheme> schemes = EnumSet
                 .allOf(AuthenticationScheme.class);
         schemes.remove(AuthenticationScheme.API);
-        
+
         for (AuthenticationScheme s : schemes) {
             builder = builder.header(HttpHeaders.WWW_AUTHENTICATE,
                     s.displayName() + " realm=\"Kustvakt\"");
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/OAuth2ResponseHandler.java b/full/src/main/java/de/ids_mannheim/korap/web/OAuth2ResponseHandler.java
index 112b05d..826a625 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/OAuth2ResponseHandler.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/OAuth2ResponseHandler.java
@@ -17,7 +17,8 @@
 import jakarta.ws.rs.core.Response.Status;
 
 /**
- * OAuth2ResponseHandler builds {@link Response}s and handles exceptions by building
+ * OAuth2ResponseHandler builds {@link Response}s and handles
+ * exceptions by building
  * OAuth error responses accordingly.
  * 
  * <br/><br/>
@@ -42,8 +43,7 @@
 
         Response r = null;
         if (responseStatus > 0) {
-            r = createResponse(e,
-                    Status.fromStatusCode(responseStatus), state);
+            r = createResponse(e, Status.fromStatusCode(responseStatus), state);
         }
         else if (errorCode == null) {
             return super.throwit(e);
@@ -69,13 +69,11 @@
             r = createResponse(e, Status.FORBIDDEN, state);
         }
         else if (errorCode.equals(OAuth2Error.SERVER_ERROR.getCode())) {
-            r = createResponse(e, Status.INTERNAL_SERVER_ERROR,
-                    state);
+            r = createResponse(e, Status.INTERNAL_SERVER_ERROR, state);
         }
         else if (errorCode
                 .equals(OAuth2Error.TEMPORARILY_UNAVAILABLE.getCode())) {
-            r = createResponse(e, Status.SERVICE_UNAVAILABLE,
-                    state);
+            r = createResponse(e, Status.SERVICE_UNAVAILABLE, state);
         }
         else {
             return super.throwit(e);
@@ -98,7 +96,7 @@
         }
         return createResponse(statusCode, eo.toJSONObject().toJSONString());
     }
-    
+
     public Response createResponse (AccessTokenResponse tokenResponse) {
         String jsonString = tokenResponse.toJSONObject().toJSONString();
         return createResponse(Status.OK, jsonString);
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/SearchKrill.java b/full/src/main/java/de/ids_mannheim/korap/web/SearchKrill.java
index 6d6f52b..38e9c9a 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/SearchKrill.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/SearchKrill.java
@@ -62,12 +62,10 @@
         };
     };
 
-
     public KrillIndex getIndex () {
         return index;
     };
 
-
     public void closeIndexReader () throws KustvaktException {
         try {
             index.closeReader();
@@ -77,7 +75,6 @@
         }
     }
 
-
     /**
      * Search in the Lucene index.
      * 
@@ -101,7 +98,6 @@
         return kr.toJsonString();
     };
 
-
     /**
      * Search in the Lucene index and return matches as token lists.
      * 
@@ -121,7 +117,6 @@
         return kr.toJsonString();
     };
 
-
     /**
      * Get info on a match - by means of a richly annotated html
      * snippet.
@@ -152,7 +147,6 @@
         return km.toJsonString();
     };
 
-
     private void checkAvailability (Pattern licensePattern, String availability,
             String id) throws KustvaktException {
         if (DEBUG) {
@@ -175,7 +169,6 @@
 
     }
 
-
     /*
      * Retrieve the meta fields for a certain document
      */
@@ -208,19 +201,17 @@
         return meta.toJsonString();
     };
 
-
-    public String getMatch (
-        String id, boolean info, List<String> foundries,
-        List<String> layers, boolean includeSpans,
-        boolean includeSnippet, boolean includeTokens,
-        boolean includeHighlights, boolean sentenceExpansion,
-        Pattern licensePattern) throws KustvaktException {
+    public String getMatch (String id, boolean info, List<String> foundries,
+            List<String> layers, boolean includeSpans, boolean includeSnippet,
+            boolean includeTokens, boolean includeHighlights,
+            boolean sentenceExpansion, Pattern licensePattern)
+            throws KustvaktException {
         Match km;
         if (index != null) {
             try {
                 km = index.getMatchInfo(id, "tokens", info, foundries, layers,
-                                        includeSpans, includeSnippet, includeTokens,
-                                        includeHighlights, sentenceExpansion);
+                        includeSpans, includeSnippet, includeTokens,
+                        includeHighlights, sentenceExpansion);
                 String availability = km.getAvailability();
                 checkAvailability(licensePattern, availability, id);
             }
@@ -236,7 +227,6 @@
         return km.toJsonString();
     };
 
-
     /**
      * Get info on a match - by means of a richly annotated html
      * snippet.
@@ -284,7 +274,6 @@
         return km.toJsonString();
     };
 
-
     /**
      * Get statistics on (virtual) collections.
      * 
@@ -345,7 +334,6 @@
         return sb.toString();
     };
 
-
     /**
      * Return the match identifier as a string.
      * This is a convenient method to deal with legacy instantiation
@@ -361,7 +349,6 @@
         return sb.toString();
     };
 
-
     /**
      * Return the text sigle as a string.
      */
@@ -373,7 +360,6 @@
         return sb.toString();
     };
 
-
     /**
      * Return the fingerprint of the latest index revision.
      */
@@ -384,7 +370,6 @@
         return "null";
     }
 
-
     public JsonNode getFieldValuesForVC (String koralQuery, String fieldName) {
         return new Krill().retrieveFieldValues(koralQuery, index, fieldName);
     }
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/controller/AuthenticationController.java b/full/src/main/java/de/ids_mannheim/korap/web/controller/AuthenticationController.java
index a777131..0b40e33 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/controller/AuthenticationController.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/controller/AuthenticationController.java
@@ -54,19 +54,19 @@
  * @author margaretha
  * @last-update 01/07/2019
  * 
- * - added user authentication time in token context
- * - added api version filter
- * - changed the response media-type 
+ *              - added user authentication time in token context
+ *              - added api version filter
+ *              - changed the response media-type
  */
 @Controller
 @Path("/{version}/auth")
-@ResourceFilters({APIVersionFilter.class, PiwikFilter.class })
+@ResourceFilters({ APIVersionFilter.class, PiwikFilter.class })
 @Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
 public class AuthenticationController {
 
     @Autowired
     private KustvaktResponseHandler kustvaktResponseHandler;
-    
+
     @Autowired
     private HttpAuthorizationHandler authorizationHandler;
 
@@ -74,8 +74,8 @@
 
     //todo: bootstrap function to transmit certain default configuration settings and examples (example user queries,
     // default usersettings, etc.)
-    private static Logger jlog =
-            LogManager.getLogger(AuthenticationController.class);
+    private static Logger jlog = LogManager
+            .getLogger(AuthenticationController.class);
 
     @Autowired
     private AuthenticationManager controller;
@@ -108,7 +108,6 @@
         }
     }
 
-
     // fixme: moved to user
     @GET
     @Path("status")
@@ -126,45 +125,44 @@
             throw kustvaktResponseHandler.throwit(e);
         }
     }
-    
-    // EM: testing using spring security authentication manager
-//    @Deprecated
-//    @GET
-//    @Path("ldap/token")
-//    public Response requestToken (@Context HttpHeaders headers,
-//            @Context Locale locale,
-//            @HeaderParam(ContainerRequest.USER_AGENT) String agent,
-//            @HeaderParam(ContainerRequest.HOST) String host,
-//            @HeaderParam("referer-url") String referer,
-//            @QueryParam("scope") String scopes,
-//            //   @Context WebServiceContext wsContext, // FB
-//            @Context SecurityContext securityContext) {
-//        
-//        Map<String, Object> attr = new HashMap<>();
-//        if (scopes != null && !scopes.isEmpty())
-//            attr.put(Attributes.SCOPES, scopes);
-//        attr.put(Attributes.HOST, host);
-//        attr.put(Attributes.USER_AGENT, agent);
-//        
-//        User user = new KorAPUser();
-//        user.setUsername(securityContext.getUserPrincipal().getName());
-//        controller.setAccessAndLocation(user, headers);
-//        if (DEBUG_LOG == true) System.out.printf(
-//                "Debug: /token/: location=%s, access='%s'.\n",
-//                user.locationtoString(), user.accesstoString());
-//        attr.put(Attributes.LOCATION, user.getLocation());
-//        attr.put(Attributes.CORPUS_ACCESS, user.getCorpusAccess());
-//        
-//        try {
-//            TokenContext context = controller.createTokenContext(user, attr,
-//                    TokenType.API);
-//            return Response.ok(context.toJson()).build();
-//        }
-//        catch (KustvaktException e) {
-//            throw kustvaktResponseHandler.throwit(e);
-//        }
-//    }
 
+    // EM: testing using spring security authentication manager
+    //    @Deprecated
+    //    @GET
+    //    @Path("ldap/token")
+    //    public Response requestToken (@Context HttpHeaders headers,
+    //            @Context Locale locale,
+    //            @HeaderParam(ContainerRequest.USER_AGENT) String agent,
+    //            @HeaderParam(ContainerRequest.HOST) String host,
+    //            @HeaderParam("referer-url") String referer,
+    //            @QueryParam("scope") String scopes,
+    //            //   @Context WebServiceContext wsContext, // FB
+    //            @Context SecurityContext securityContext) {
+    //        
+    //        Map<String, Object> attr = new HashMap<>();
+    //        if (scopes != null && !scopes.isEmpty())
+    //            attr.put(Attributes.SCOPES, scopes);
+    //        attr.put(Attributes.HOST, host);
+    //        attr.put(Attributes.USER_AGENT, agent);
+    //        
+    //        User user = new KorAPUser();
+    //        user.setUsername(securityContext.getUserPrincipal().getName());
+    //        controller.setAccessAndLocation(user, headers);
+    //        if (DEBUG_LOG == true) System.out.printf(
+    //                "Debug: /token/: location=%s, access='%s'.\n",
+    //                user.locationtoString(), user.accesstoString());
+    //        attr.put(Attributes.LOCATION, user.getLocation());
+    //        attr.put(Attributes.CORPUS_ACCESS, user.getCorpusAccess());
+    //        
+    //        try {
+    //            TokenContext context = controller.createTokenContext(user, attr,
+    //                    TokenType.API);
+    //            return Response.ok(context.toJson()).build();
+    //        }
+    //        catch (KustvaktException e) {
+    //            throw kustvaktResponseHandler.throwit(e);
+    //        }
+    //    }
 
     @Deprecated
     @GET
@@ -178,144 +176,144 @@
             @QueryParam("scope") String scopes,
             //   @Context WebServiceContext wsContext, // FB
             @Context SecurityContext secCtx) {
-        
+
         if (DEBUG_LOG == true) {
             String warning = "Access to API token (JWT) web service";
-            
-            List<String> auth =
-                  headers.getRequestHeader(ContainerRequest.AUTHORIZATION);
-          if (auth != null && !auth.isEmpty()) {
-              try {
-                  AuthorizationData authorizationData = authorizationHandler
-                          .parseAuthorizationHeaderValue(auth.get(0));
-                  if (authorizationData.getAuthenticationScheme()
-                          .equals(AuthenticationScheme.BASIC)) {
-                      authorizationData = authorizationHandler
-                              .parseBasicToken(authorizationData);
-                      jlog.warn(warning + " with username:"+authorizationData.getUsername());
-                  }
-              }
-              catch (KustvaktException e) {}
-          }
-          else {
-              jlog.warn(warning);
-          }
+
+            List<String> auth = headers
+                    .getRequestHeader(ContainerRequest.AUTHORIZATION);
+            if (auth != null && !auth.isEmpty()) {
+                try {
+                    AuthorizationData authorizationData = authorizationHandler
+                            .parseAuthorizationHeaderValue(auth.get(0));
+                    if (authorizationData.getAuthenticationScheme()
+                            .equals(AuthenticationScheme.BASIC)) {
+                        authorizationData = authorizationHandler
+                                .parseBasicToken(authorizationData);
+                        jlog.warn(warning + " with username:"
+                                + authorizationData.getUsername());
+                    }
+                }
+                catch (KustvaktException e) {}
+            }
+            else {
+                jlog.warn(warning);
+            }
         }
         throw kustvaktResponseHandler.throwit(new KustvaktException(
                 StatusCodes.DEPRECATED,
                 "API token is no longer supported. Please use OAuth2 procedure instead."));
     }
 
-//        List<String> auth =
-//                headers.getRequestHeader(ContainerRequest.AUTHORIZATION);
-//        if (auth == null || auth.isEmpty()) {
-//            throw kustvaktResponseHandler
-//                    .throwit(new KustvaktException(StatusCodes.MISSING_PARAMETER,
-//                            "Authorization header is missing.",
-//                            "Authorization header"));
-//        }
-//        
-//        AuthorizationData authorizationData;
-//        try {
-//            authorizationData = authorizationHandler.
-//                    parseAuthorizationHeaderValue(auth.get(0));
-//            if (authorizationData.getAuthenticationScheme().equals(AuthenticationScheme.BASIC)){
-//                authorizationData = authorizationHandler.parseBasicToken(authorizationData);
-//            }
-//            else {
-//                // EM: throw exception that auth scheme is not supported?
-//            }
-//           
-//        }
-//        catch (KustvaktException e) {
-//            throw kustvaktResponseHandler.throwit(e);
-//        }
-//
-//        if (DEBUG_LOG == true) {
-//            System.out.printf("Debug: AuthService.requestAPIToken...:\n");
-//            System.out.printf("Debug: auth.size=%d\n", auth.size());
-//            System.out.printf("auth.get(0)='%s'\n", auth.get(0));
-//            /* hide password etc. - FB
-//             if( auth.size() > 0 )
-//            	{
-//            	Iterator it = auth.iterator();
-//            	while( it.hasNext() )
-//            		System.out.printf(" header '%s'\n",  it.next());
-//            	}
-//            if( values.length > 0 )
-//            	{
-//            	for(int i=0; i< values.length; i++)
-//            		{
-//            		System.out.printf(" values[%d]='%s'\n",  i, values[i]);
-//            		}
-//            	}
-//             */
-//            MultivaluedMap<String, String> headerMap =
-//                    headers.getRequestHeaders();
-//            if (headerMap != null && headerMap.size() > 0) {
-//                Iterator<String> it = headerMap.keySet().iterator();
-//                while (it.hasNext()) {
-//                    String key = (String) it.next();
-//                    List<String> vals = headerMap.get(key);
-////                    System.out.printf("Debug: requestAPIToken: '%s' = '%s'\n",
-////                            key, vals);
-//                }
-//
-//            }
-////            System.out.printf("Debug: requestAPIToken: isSecure = %s.\n",
-////                    secCtx.isSecure() ? "yes" : "no");
-//        } // DEBUG_LOG        
-//
-//        if (authorizationData.getUsername() == null || 
-//                authorizationData.getUsername().isEmpty() || 
-//                authorizationData.getPassword()== null || 
-//                authorizationData.getPassword().isEmpty())
-//            // is actual an invalid request
-//            throw kustvaktResponseHandler.throwit(StatusCodes.REQUEST_INVALID);
-//
-//        Map<String, Object> attr = new HashMap<>();
-//        if (scopes != null && !scopes.isEmpty())
-//            attr.put(Attributes.SCOPE, scopes);
-//        attr.put(Attributes.HOST, host);
-//        attr.put(Attributes.USER_AGENT, agent);
-//
-//        TokenContext context;
-//        try {
-//            // User user = controller.authenticate(0, values[0], values[1], attr); Implementation by Hanl
-//            User user = controller.authenticate(AuthenticationMethod.LDAP,
-//                    authorizationData.getUsername(), authorizationData.getPassword(), attr); // Implementation with IdM/LDAP
-//            // Userdata data = this.controller.getUserData(user, UserDetails.class); // Implem. by Hanl
-//            // todo: is this necessary?
-//            //            attr.putAll(data.fields());
-//            
-//            // EM: add authentication time
-//            Date authenticationTime = TimeUtils.getNow().toDate();
-//            attr.put(Attributes.AUTHENTICATION_TIME, authenticationTime);
-//            // -- EM
-//            
-//            controller.setAccessAndLocation(user, headers);
-//            if (DEBUG_LOG == true) System.out.printf(
-//                    "Debug: /apiToken/: location=%s, access='%s'.\n",
-//                    user.locationtoString(), user.accesstoString());
-//            attr.put(Attributes.LOCATION, user.getLocation());
-//            attr.put(Attributes.CORPUS_ACCESS, user.getCorpusAccess());
-//            context = controller.createTokenContext(user, attr,
-//                  TokenType.API);
-////            context = controller.createTokenContext(user, attr,
-////                    Attributes.API_AUTHENTICATION);
-//        }
-//        catch (KustvaktException e) {
-//            throw kustvaktResponseHandler.throwit(e);
-//        }
-//
-//        try {
-//            return Response.ok(context.toJson()).build();
-//        }
-//        catch (KustvaktException e) {
-//            throw kustvaktResponseHandler.throwit(e);
-//        }
-//    }
-
+    //        List<String> auth =
+    //                headers.getRequestHeader(ContainerRequest.AUTHORIZATION);
+    //        if (auth == null || auth.isEmpty()) {
+    //            throw kustvaktResponseHandler
+    //                    .throwit(new KustvaktException(StatusCodes.MISSING_PARAMETER,
+    //                            "Authorization header is missing.",
+    //                            "Authorization header"));
+    //        }
+    //        
+    //        AuthorizationData authorizationData;
+    //        try {
+    //            authorizationData = authorizationHandler.
+    //                    parseAuthorizationHeaderValue(auth.get(0));
+    //            if (authorizationData.getAuthenticationScheme().equals(AuthenticationScheme.BASIC)){
+    //                authorizationData = authorizationHandler.parseBasicToken(authorizationData);
+    //            }
+    //            else {
+    //                // EM: throw exception that auth scheme is not supported?
+    //            }
+    //           
+    //        }
+    //        catch (KustvaktException e) {
+    //            throw kustvaktResponseHandler.throwit(e);
+    //        }
+    //
+    //        if (DEBUG_LOG == true) {
+    //            System.out.printf("Debug: AuthService.requestAPIToken...:\n");
+    //            System.out.printf("Debug: auth.size=%d\n", auth.size());
+    //            System.out.printf("auth.get(0)='%s'\n", auth.get(0));
+    //            /* hide password etc. - FB
+    //             if( auth.size() > 0 )
+    //            	{
+    //            	Iterator it = auth.iterator();
+    //            	while( it.hasNext() )
+    //            		System.out.printf(" header '%s'\n",  it.next());
+    //            	}
+    //            if( values.length > 0 )
+    //            	{
+    //            	for(int i=0; i< values.length; i++)
+    //            		{
+    //            		System.out.printf(" values[%d]='%s'\n",  i, values[i]);
+    //            		}
+    //            	}
+    //             */
+    //            MultivaluedMap<String, String> headerMap =
+    //                    headers.getRequestHeaders();
+    //            if (headerMap != null && headerMap.size() > 0) {
+    //                Iterator<String> it = headerMap.keySet().iterator();
+    //                while (it.hasNext()) {
+    //                    String key = (String) it.next();
+    //                    List<String> vals = headerMap.get(key);
+    ////                    System.out.printf("Debug: requestAPIToken: '%s' = '%s'\n",
+    ////                            key, vals);
+    //                }
+    //
+    //            }
+    ////            System.out.printf("Debug: requestAPIToken: isSecure = %s.\n",
+    ////                    secCtx.isSecure() ? "yes" : "no");
+    //        } // DEBUG_LOG        
+    //
+    //        if (authorizationData.getUsername() == null || 
+    //                authorizationData.getUsername().isEmpty() || 
+    //                authorizationData.getPassword()== null || 
+    //                authorizationData.getPassword().isEmpty())
+    //            // is actual an invalid request
+    //            throw kustvaktResponseHandler.throwit(StatusCodes.REQUEST_INVALID);
+    //
+    //        Map<String, Object> attr = new HashMap<>();
+    //        if (scopes != null && !scopes.isEmpty())
+    //            attr.put(Attributes.SCOPE, scopes);
+    //        attr.put(Attributes.HOST, host);
+    //        attr.put(Attributes.USER_AGENT, agent);
+    //
+    //        TokenContext context;
+    //        try {
+    //            // User user = controller.authenticate(0, values[0], values[1], attr); Implementation by Hanl
+    //            User user = controller.authenticate(AuthenticationMethod.LDAP,
+    //                    authorizationData.getUsername(), authorizationData.getPassword(), attr); // Implementation with IdM/LDAP
+    //            // Userdata data = this.controller.getUserData(user, UserDetails.class); // Implem. by Hanl
+    //            // todo: is this necessary?
+    //            //            attr.putAll(data.fields());
+    //            
+    //            // EM: add authentication time
+    //            Date authenticationTime = TimeUtils.getNow().toDate();
+    //            attr.put(Attributes.AUTHENTICATION_TIME, authenticationTime);
+    //            // -- EM
+    //            
+    //            controller.setAccessAndLocation(user, headers);
+    //            if (DEBUG_LOG == true) System.out.printf(
+    //                    "Debug: /apiToken/: location=%s, access='%s'.\n",
+    //                    user.locationtoString(), user.accesstoString());
+    //            attr.put(Attributes.LOCATION, user.getLocation());
+    //            attr.put(Attributes.CORPUS_ACCESS, user.getCorpusAccess());
+    //            context = controller.createTokenContext(user, attr,
+    //                  TokenType.API);
+    ////            context = controller.createTokenContext(user, attr,
+    ////                    Attributes.API_AUTHENTICATION);
+    //        }
+    //        catch (KustvaktException e) {
+    //            throw kustvaktResponseHandler.throwit(e);
+    //        }
+    //
+    //        try {
+    //            return Response.ok(context.toJson()).build();
+    //        }
+    //        catch (KustvaktException e) {
+    //            throw kustvaktResponseHandler.throwit(e);
+    //        }
+    //    }
 
     // todo:
     @Deprecated
@@ -336,7 +334,6 @@
         return null;
     }
 
-
     @GET
     @Path("sessionToken")
     //@ResourceFilters({HeaderFilter.class})
@@ -344,15 +341,16 @@
             @Context Locale locale,
             @HeaderParam(ContainerRequest.USER_AGENT) String agent,
             @HeaderParam(ContainerRequest.HOST) String host) {
-        List<String> auth =
-                headers.getRequestHeader(ContainerRequest.AUTHORIZATION);
+        List<String> auth = headers
+                .getRequestHeader(ContainerRequest.AUTHORIZATION);
 
         AuthorizationData authorizationData;
         try {
-            authorizationData = authorizationHandler.
-                    parseAuthorizationHeaderValue(auth.get(0));
-            authorizationData = authorizationHandler.parseBasicToken(authorizationData);
-           
+            authorizationData = authorizationHandler
+                    .parseAuthorizationHeaderValue(auth.get(0));
+            authorizationData = authorizationHandler
+                    .parseBasicToken(authorizationData);
+
         }
         catch (KustvaktException e) {
             throw kustvaktResponseHandler.throwit(e);
@@ -361,10 +359,10 @@
         // Implementation Hanl mit '|'. 16.02.17/FB
         //if (values[0].equalsIgnoreCase("null")
         //        | values[1].equalsIgnoreCase("null"))
-        if (authorizationData.getUsername() == null || 
-                authorizationData.getUsername().isEmpty() || 
-                authorizationData.getPassword()== null || 
-                authorizationData.getPassword().isEmpty())
+        if (authorizationData.getUsername() == null
+                || authorizationData.getUsername().isEmpty()
+                || authorizationData.getPassword() == null
+                || authorizationData.getPassword().isEmpty())
             // is actual an invalid request
             throw kustvaktResponseHandler.throwit(StatusCodes.INVALID_REQUEST);
 
@@ -376,11 +374,12 @@
         try {
             //EM: authentication scheme default
             User user = controller.authenticate(AuthenticationMethod.DATABASE,
-                    authorizationData.getUsername(), authorizationData.getPassword(), attr);
+                    authorizationData.getUsername(),
+                    authorizationData.getPassword(), attr);
             context = controller.createTokenContext(user, attr,
                     TokenType.SESSION);
-//            context = controller.createTokenContext(user, attr,
-//                    Attributes.SESSION_AUTHENTICATION);
+            //            context = controller.createTokenContext(user, attr,
+            //                    Attributes.SESSION_AUTHENTICATION);
             contextJson = context.toJson();
             jlog.debug(contextJson);
         }
@@ -390,7 +389,6 @@
         return Response.ok().entity(contextJson).build();
     }
 
-
     // fixme: security issues: setup shibboleth compatible authentication system
     // todo: will be purged with token authentication --> shib is client side
     @POST
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/controller/OAuth2Controller.java b/full/src/main/java/de/ids_mannheim/korap/web/controller/OAuth2Controller.java
index e8d7b10..8ab3e2a 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/controller/OAuth2Controller.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/controller/OAuth2Controller.java
@@ -77,7 +77,7 @@
     private OAuth2TokenService tokenService;
     @Autowired
     private OAuth2AuthorizationService authorizationService;
-    
+
     @Autowired
     private OAuth2ScopeService scopeService;
 
@@ -108,8 +108,7 @@
     @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
     public Response requestAuthorizationCode (
             @Context HttpServletRequest request,
-            @Context SecurityContext context, 
-            @FormParam("scope") String scope,
+            @Context SecurityContext context, @FormParam("scope") String scope,
             @FormParam("state") String state,
             @FormParam("client_id") String clientId,
             @FormParam("redirect_uri") String redirectUri,
@@ -125,27 +124,26 @@
             builder.queryParam(key, form.get(key).toArray());
         }
         requestURI = builder.build();
-       
+
         try {
             scopeService.verifyScope(tokenContext, OAuth2Scope.AUTHORIZE);
-            URI uri = authorizationService.requestAuthorizationCode(
-                    requestURI, clientId, redirectUri,
-                    scope, state, username, authTime);
+            URI uri = authorizationService.requestAuthorizationCode(requestURI,
+                    clientId, redirectUri, scope, state, username, authTime);
             return responseHandler.sendRedirect(uri);
         }
         catch (KustvaktException e) {
             e = authorizationService.checkRedirectUri(e, clientId, redirectUri);
             if (e.getRedirectUri() != null) {
-                AuthorizationErrorResponse errorResponse =
-                        authorizationService.createAuthorizationError(e, state);
+                AuthorizationErrorResponse errorResponse = authorizationService
+                        .createAuthorizationError(e, state);
                 return responseHandler.sendRedirect(errorResponse.toURI());
             }
             else {
                 throw responseHandler.throwit(e, state);
-            } 
+            }
         }
     }
-    
+
     @GET
     @Path("authorize")
     public Response requestAuthorizationCode (
@@ -163,7 +161,8 @@
 
         URI requestURI;
         try {
-            requestURI = new URI(request.getRequestURI()+"?"+request.getQueryString());
+            requestURI = new URI(
+                    request.getRequestURI() + "?" + request.getQueryString());
         }
         catch (URISyntaxException e) {
             KustvaktException ke = new KustvaktException(
@@ -171,24 +170,23 @@
                     OAuth2Error.INVALID_REQUEST_URI);
             throw responseHandler.throwit(ke, state);
         }
-        
+
         try {
             scopeService.verifyScope(tokenContext, OAuth2Scope.AUTHORIZE);
-            URI uri = authorizationService.requestAuthorizationCode(
-                    requestURI, clientId, redirectUri,
-                    scope, state, username, authTime);
+            URI uri = authorizationService.requestAuthorizationCode(requestURI,
+                    clientId, redirectUri, scope, state, username, authTime);
             return responseHandler.sendRedirect(uri);
         }
         catch (KustvaktException e) {
             e = authorizationService.checkRedirectUri(e, clientId, redirectUri);
             if (e.getRedirectUri() != null) {
-                AuthorizationErrorResponse errorResponse =
-                        authorizationService.createAuthorizationError(e, state);
+                AuthorizationErrorResponse errorResponse = authorizationService
+                        .createAuthorizationError(e, state);
                 return responseHandler.sendRedirect(errorResponse.toURI());
             }
             else {
                 throw responseHandler.throwit(e, state);
-            } 
+            }
         }
     }
 
@@ -256,7 +254,7 @@
      */
     @POST
     @Path("token")
-    @ResourceFilters({APIVersionFilter.class})
+    @ResourceFilters({ APIVersionFilter.class })
     @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
     public Response requestAccessToken (@Context HttpServletRequest request,
             @NotEmpty @FormParam("grant_type") String grantType,
@@ -266,62 +264,64 @@
 
         try {
             URI requestURI;
-            UriBuilder builder = UriBuilder.fromPath(
-                    request.getRequestURL().toString());
+            UriBuilder builder = UriBuilder
+                    .fromPath(request.getRequestURL().toString());
             for (String key : form.keySet()) {
                 builder.queryParam(key, form.get(key).toArray());
             }
             requestURI = builder.build();
-            
+
             try {
-                AuthorizationGrant authGrant = AuthorizationGrant.parse(form);  
-                
+                AuthorizationGrant authGrant = AuthorizationGrant.parse(form);
+
                 ClientAuthentication clientAuth = null;
                 String authorizationHeader = request.getHeader("Authorization");
-                if (authorizationHeader!=null && !authorizationHeader.isEmpty() ) {
+                if (authorizationHeader != null
+                        && !authorizationHeader.isEmpty()) {
                     clientAuth = ClientSecretBasic.parse(authorizationHeader);
                 }
                 else if (authGrant instanceof ClientCredentialsGrant) {
                     // this doesn't allow public clients
                     clientAuth = ClientSecretPost.parse(form);
                 }
-                
+
                 TokenRequest tokenRequest = null;
-                if (clientAuth!=null) {
+                if (clientAuth != null) {
                     ClientAuthenticationMethod method = clientAuth.getMethod();
-                    if (method.equals(ClientAuthenticationMethod.CLIENT_SECRET_BASIC)) {
+                    if (method.equals(
+                            ClientAuthenticationMethod.CLIENT_SECRET_BASIC)) {
                         ClientSecretBasic basic = (ClientSecretBasic) clientAuth;
                         clientSecret = basic.getClientSecret().getValue();
                         clientId = basic.getClientID().getValue();
                     }
-                    else if (method.equals(ClientAuthenticationMethod.CLIENT_SECRET_POST)) {
+                    else if (method.equals(
+                            ClientAuthenticationMethod.CLIENT_SECRET_POST)) {
                         ClientSecretPost post = (ClientSecretPost) clientAuth;
                         clientSecret = post.getClientSecret().getValue();
                         clientId = post.getClientID().getValue();
                     }
-                    
-                    tokenRequest = new TokenRequest(requestURI,
-                            clientAuth,
+
+                    tokenRequest = new TokenRequest(requestURI, clientAuth,
                             AuthorizationGrant.parse(form),
                             Scope.parse(form.getFirst("scope")));
                 }
                 else {
                     // requires ClientAuthentication for client_credentials grant
                     tokenRequest = new TokenRequest(requestURI,
-                        new ClientID(clientId),
-                        AuthorizationGrant.parse(form),
-                        Scope.parse(form.getFirst("scope")));
+                            new ClientID(clientId),
+                            AuthorizationGrant.parse(form),
+                            Scope.parse(form.getFirst("scope")));
                 }
-            
-                AccessTokenResponse r = tokenService.requestAccessToken(tokenRequest,
-                        clientId, clientSecret);
+
+                AccessTokenResponse r = tokenService.requestAccessToken(
+                        tokenRequest, clientId, clientSecret);
                 return responseHandler.createResponse(r);
             }
             catch (ParseException | IllegalArgumentException e) {
                 throw new KustvaktException(StatusCodes.INVALID_REQUEST,
-                        e.getMessage(), OAuth2Error.INVALID_REQUEST); 
+                        e.getMessage(), OAuth2Error.INVALID_REQUEST);
             }
-            
+
         }
         catch (KustvaktException e) {
             throw responseHandler.throwit(e);
@@ -348,7 +348,7 @@
      */
     @POST
     @Path("revoke")
-    @ResourceFilters({APIVersionFilter.class})
+    @ResourceFilters({ APIVersionFilter.class })
     @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
     public Response revokeAccessToken (@Context HttpServletRequest request,
             @FormParam("client_id") String clientId,
@@ -359,8 +359,8 @@
         try {
             ParameterChecker.checkStringValue("client_id", clientId);
             ParameterChecker.checkStringValue("token", token);
-            tokenService.revokeToken(clientId,clientSecret,token,tokenType);
-            
+            tokenService.revokeToken(clientId, clientSecret, token, tokenType);
+
             return Response.ok("SUCCESS").build();
         }
         catch (KustvaktException e) {
@@ -382,10 +382,11 @@
             ParameterChecker.checkStringValue("super_client_secret",
                     superClientSecret);
             ParameterChecker.checkStringValue("token", token);
-            
-            TokenContext tokenContext = (TokenContext) context.getUserPrincipal();
+
+            TokenContext tokenContext = (TokenContext) context
+                    .getUserPrincipal();
             String username = tokenContext.getUsername();
-            
+
             tokenService.revokeTokensViaSuperClient(username, superClientId,
                     superClientSecret, token);
             return Response.ok("SUCCESS").build();
@@ -426,7 +427,7 @@
             ParameterChecker.checkStringValue("super_client_id", superClientId);
             ParameterChecker.checkStringValue("super_client_secret",
                     superClientSecret);
-           
+
             tokenService.revokeAllClientTokensViaSuperClient(username,
                     superClientId, superClientSecret, clientId);
             return Response.ok("SUCCESS").build();
@@ -439,8 +440,7 @@
     @POST
     @Path("token/list")
     @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
-    public List<OAuth2TokenDto> listUserToken (
-            @Context SecurityContext context,
+    public List<OAuth2TokenDto> listUserToken (@Context SecurityContext context,
             @FormParam("super_client_id") String superClientId,
             @FormParam("super_client_secret") String superClientSecret,
             @FormParam("client_id") String clientId, // optional
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/controller/OAuthClientController.java b/full/src/main/java/de/ids_mannheim/korap/web/controller/OAuthClientController.java
index bace018..b530e19 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/controller/OAuthClientController.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/controller/OAuthClientController.java
@@ -94,8 +94,8 @@
     public OAuth2ClientDto registerClient (
             @Context SecurityContext securityContext,
             OAuth2ClientJson clientJson) {
-        TokenContext context =
-                (TokenContext) securityContext.getUserPrincipal();
+        TokenContext context = (TokenContext) securityContext
+                .getUserPrincipal();
         try {
             scopeService.verifyScope(context, OAuth2Scope.REGISTER_CLIENT);
             return clientService.registerClient(clientJson,
@@ -107,7 +107,7 @@
     }
 
     /**
-     * Deregisters a client requires client owner authentication. 
+     * Deregisters a client requires client owner authentication.
      * 
      * 
      * @param securityContext
@@ -117,11 +117,10 @@
      */
     @DELETE
     @Path("deregister/{client_id}")
-    public Response deregisterClient (
-            @Context SecurityContext securityContext,
+    public Response deregisterClient (@Context SecurityContext securityContext,
             @PathParam("client_id") String clientId) {
-        TokenContext context =
-                (TokenContext) securityContext.getUserPrincipal();
+        TokenContext context = (TokenContext) securityContext
+                .getUserPrincipal();
         try {
             scopeService.verifyScope(context, OAuth2Scope.DEREGISTER_CLIENT);
             clientService.deregisterClient(clientId, context.getUsername());
@@ -148,8 +147,8 @@
     public OAuth2ClientDto resetClientSecret (
             @Context SecurityContext securityContext,
             @FormParam("client_id") String clientId) {
-        TokenContext context =
-                (TokenContext) securityContext.getUserPrincipal();
+        TokenContext context = (TokenContext) securityContext
+                .getUserPrincipal();
         try {
             scopeService.verifyScope(context, OAuth2Scope.RESET_CLIENT_SECRET);
             return clientService.resetSecret(clientId, context.getUsername());
@@ -159,11 +158,10 @@
         }
     }
 
-
     @POST
     @Path("{client_id}")
     @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
-    @ResourceFilters({ APIVersionFilter.class})
+    @ResourceFilters({ APIVersionFilter.class })
     public OAuth2ClientInfoDto retrieveClientInfo (
             @PathParam("client_id") String clientId,
             @FormParam("super_client_id") String superClientId,
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/controller/PluginController.java b/full/src/main/java/de/ids_mannheim/korap/web/controller/PluginController.java
index c10c4fa..0afda45 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/controller/PluginController.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/controller/PluginController.java
@@ -62,12 +62,11 @@
             throw responseHandler.throwit(e);
         }
     }
-    
+
     @POST
     @Path("/install")
     @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
-    public InstalledPluginDto installPlugin (
-            @Context SecurityContext context,
+    public InstalledPluginDto installPlugin (@Context SecurityContext context,
             @FormParam("super_client_id") String superClientId,
             @FormParam("super_client_secret") String superClientSecret,
             @FormParam("client_id") String clientId) {
@@ -80,13 +79,14 @@
                     OAuth2Scope.INSTALL_USER_CLIENT);
 
             clientService.verifySuperClient(superClientId, superClientSecret);
-            return clientService.installPlugin(superClientId,clientId, username);
+            return clientService.installPlugin(superClientId, clientId,
+                    username);
         }
         catch (KustvaktException e) {
             throw responseHandler.throwit(e);
         }
     }
-    
+
     @POST
     @Path("/installed")
     @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@@ -109,12 +109,11 @@
             throw responseHandler.throwit(e);
         }
     }
-    
+
     @POST
     @Path("/uninstall")
     @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
-    public Response uninstallPlugin (
-            @Context SecurityContext context,
+    public Response uninstallPlugin (@Context SecurityContext context,
             @FormParam("super_client_id") String superClientId,
             @FormParam("super_client_secret") String superClientSecret,
             @FormParam("client_id") String clientId) {
@@ -127,7 +126,7 @@
                     OAuth2Scope.UNINSTALL_USER_CLIENT);
 
             clientService.verifySuperClient(superClientId, superClientSecret);
-            clientService.uninstallPlugin(superClientId,clientId, username);
+            clientService.uninstallPlugin(superClientId, clientId, username);
             return Response.ok().build();
         }
         catch (KustvaktException e) {
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/controller/QueryReferenceController.java b/full/src/main/java/de/ids_mannheim/korap/web/controller/QueryReferenceController.java
index caa059c..af9c395 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/controller/QueryReferenceController.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/controller/QueryReferenceController.java
@@ -75,21 +75,21 @@
      * @param query
      *            a json object describing the query and its
      *            properties
-     * @return HTTP Status 201 Created when creating a new query, or 204
+     * @return HTTP Status 201 Created when creating a new query, or
+     *         204
      *         No Content when updating an existing query.
      * @throws KustvaktException
      */
     @PUT
     @Path("/~{qCreator}/{qName}")
     @Consumes(MediaType.APPLICATION_JSON + ";charset=utf-8")
-    public Response createQuery (
-        @Context SecurityContext securityContext,
-        @PathParam("qCreator") String qCreator,
-        @PathParam("qName") String qName,
-        QueryJson query) throws KustvaktException {
+    public Response createQuery (@Context SecurityContext securityContext,
+            @PathParam("qCreator") String qCreator,
+            @PathParam("qName") String qName, QueryJson query)
+            throws KustvaktException {
 
-        TokenContext context =
-            (TokenContext) securityContext.getUserPrincipal();
+        TokenContext context = (TokenContext) securityContext
+                .getUserPrincipal();
 
         try {
             scopeService.verifyScope(context, OAuth2Scope.EDIT_VC);
@@ -104,7 +104,7 @@
         catch (KustvaktException e) {
             throw kustvaktResponseHandler.throwit(e);
         }
-        
+
     }
 
     /**
@@ -120,13 +120,13 @@
     @GET
     @Path("~{createdBy}/{qName}")
     @ResourceFilters({ APIVersionFilter.class, AuthenticationFilter.class,
-        DemoUserFilter.class, PiwikFilter.class })
+            DemoUserFilter.class, PiwikFilter.class })
     public QueryDto retrieveQueryByName (
             @Context SecurityContext securityContext,
             @PathParam("createdBy") String createdBy,
             @PathParam("qName") String qName) {
-        TokenContext context =
-                (TokenContext) securityContext.getUserPrincipal();
+        TokenContext context = (TokenContext) securityContext
+                .getUserPrincipal();
         try {
             scopeService.verifyScope(context, OAuth2Scope.VC_INFO);
             return service.retrieveQueryByName(context.getUsername(), qName,
@@ -149,33 +149,32 @@
      *            query name
      * @return HTTP status 200, if successful
      */
-    
+
     @DELETE
     @Path("~{createdBy}/{qName}")
     public Response deleteQueryByName (@Context SecurityContext securityContext,
             @PathParam("createdBy") String createdBy,
             @PathParam("qName") String qName) {
-        TokenContext context =
-                (TokenContext) securityContext.getUserPrincipal();
+        TokenContext context = (TokenContext) securityContext
+                .getUserPrincipal();
         try {
             scopeService.verifyScope(context, OAuth2Scope.DELETE_VC);
             service.deleteQueryByName(context.getUsername(), qName, createdBy,
                     QueryType.QUERY);
         }
         catch (KustvaktException e) {
-        throw kustvaktResponseHandler.throwit(e);
+            throw kustvaktResponseHandler.throwit(e);
         }
         return Response.ok().build();
     };
 
-    
     /**
      * Lists all queries available to the authenticated user.
      *
      * System-admins can list available queries for a specific user by
      * specifiying the username parameter.
      * 
-     * Normal users cannot list queries available for other users. 
+     * Normal users cannot list queries available for other users.
      * Thus, username parameter is optional
      * and must be identical to the authenticated username.
      * 
@@ -189,8 +188,8 @@
     public List<QueryDto> listAvailableQuery (
             @Context SecurityContext securityContext,
             @QueryParam("username") String username) {
-        TokenContext context =
-                (TokenContext) securityContext.getUserPrincipal();
+        TokenContext context = (TokenContext) securityContext
+                .getUserPrincipal();
         try {
             scopeService.verifyScope(context, OAuth2Scope.VC_INFO);
             List<QueryDto> dtos = service.listAvailableQueryForUser(
@@ -201,39 +200,38 @@
             throw kustvaktResponseHandler.throwit(e);
         }
     }
-    
-//    // TODO: List all queries of a sepcific user
-//    /**
-//     * Lists all queries created by a user. This list is only
-//     * available to the owner of the queries. Users, except system-admins, 
-//     * are not allowed to list queries created by other users. 
-//     * 
-//     * Thus, the path parameter "createdBy" must be the same as the
-//     * authenticated username. 
-//     * 
-//     * @param securityContext
-//     * @return a list of queries created by the user
-//     *         in the security context.
-//     */
-//    @GET
-//    @Path("~{createdBy}")
-//    @Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
-//    public List<VirtualCorpusDto> listUserVC (
-//            @PathParam("createdBy") String createdBy,
-//            @Context SecurityContext securityContext) {
-//        TokenContext context =
-//                (TokenContext) securityContext.getUserPrincipal();
-//        try {
-//            scopeService.verifyScope(context, OAuth2Scope.VC_INFO);
-//            return service.listOwnerVC(context.getUsername(), createdBy,
-//                    QueryType.QUERY);
-//        }
-//        catch (KustvaktException e) {
-//            throw kustvaktResponseHandler.throwit(e);
-//        }
-//    }
-    
-    
+
+    //    // TODO: List all queries of a sepcific user
+    //    /**
+    //     * Lists all queries created by a user. This list is only
+    //     * available to the owner of the queries. Users, except system-admins, 
+    //     * are not allowed to list queries created by other users. 
+    //     * 
+    //     * Thus, the path parameter "createdBy" must be the same as the
+    //     * authenticated username. 
+    //     * 
+    //     * @param securityContext
+    //     * @return a list of queries created by the user
+    //     *         in the security context.
+    //     */
+    //    @GET
+    //    @Path("~{createdBy}")
+    //    @Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
+    //    public List<VirtualCorpusDto> listUserVC (
+    //            @PathParam("createdBy") String createdBy,
+    //            @Context SecurityContext securityContext) {
+    //        TokenContext context =
+    //                (TokenContext) securityContext.getUserPrincipal();
+    //        try {
+    //            scopeService.verifyScope(context, OAuth2Scope.VC_INFO);
+    //            return service.listOwnerVC(context.getUsername(), createdBy,
+    //                    QueryType.QUERY);
+    //        }
+    //        catch (KustvaktException e) {
+    //            throw kustvaktResponseHandler.throwit(e);
+    //        }
+    //    }
+
     // TODO: Some admin routes missing.
     // TODO: Some sharing routes missing
 };
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/controller/ResourceController.java b/full/src/main/java/de/ids_mannheim/korap/web/controller/ResourceController.java
index 074b14b..986f621 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/controller/ResourceController.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/controller/ResourceController.java
@@ -23,19 +23,19 @@
  */
 @Controller
 @Path("{version}/resource")
-@ResourceFilters({APIVersionFilter.class, PiwikFilter.class })
+@ResourceFilters({ APIVersionFilter.class, PiwikFilter.class })
 @Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
 public class ResourceController {
 
     @Autowired
     private ResourceService resourceService;
 
-
-    /** Returns descriptions of all free resources stored in 
+    /**
+     * Returns descriptions of all free resources stored in
      * the database.
      * 
-     * @return a json description of all free resources stored in 
-     * the database. 
+     * @return a json description of all free resources stored in
+     *         the database.
      */
     @GET
     public List<ResourceDto> getAllResourceInfo () {
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/controller/UserController.java b/full/src/main/java/de/ids_mannheim/korap/web/controller/UserController.java
index 8e461f4..09de4c2 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/controller/UserController.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/controller/UserController.java
@@ -24,7 +24,7 @@
 @Controller
 @Path("{version}/user")
 @Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
-@ResourceFilters({ AuthenticationFilter.class, APIVersionFilter.class})
+@ResourceFilters({ AuthenticationFilter.class, APIVersionFilter.class })
 public class UserController {
 
     @Autowired
@@ -36,16 +36,15 @@
 
     @GET
     @Path("/info")
-    public JsonNode getUsername (
-        @Context SecurityContext securityContext) {
-            TokenContext context =
-                    (TokenContext) securityContext.getUserPrincipal();
-            try {
-                scopeService.verifyScope(context, OAuth2Scope.USER_INFO);
-                return userService.retrieveUserInfo(context.getUsername());
-            }
-            catch (KustvaktException e) {
-                throw kustvaktResponseHandler.throwit(e);
-            }
+    public JsonNode getUsername (@Context SecurityContext securityContext) {
+        TokenContext context = (TokenContext) securityContext
+                .getUserPrincipal();
+        try {
+            scopeService.verifyScope(context, OAuth2Scope.USER_INFO);
+            return userService.retrieveUserInfo(context.getUsername());
         }
+        catch (KustvaktException e) {
+            throw kustvaktResponseHandler.throwit(e);
+        }
+    }
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/controller/UserGroupAdminController.java b/full/src/main/java/de/ids_mannheim/korap/web/controller/UserGroupAdminController.java
index e5edce5..4ed6266 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/controller/UserGroupAdminController.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/controller/UserGroupAdminController.java
@@ -31,7 +31,7 @@
     private KustvaktResponseHandler kustvaktResponseHandler;
     @Autowired
     private UserGroupService service;
-    
+
     /**
      * Lists user-groups for system-admin purposes. If username is
      * specified, lists user-groups of the given user, otherwise list
@@ -53,14 +53,13 @@
             @FormParam("username") String username,
             @FormParam("status") UserGroupStatus status) {
         try {
-            return service.retrieveUserGroupByStatus(username,
-                    status);
+            return service.retrieveUserGroupByStatus(username, status);
         }
         catch (KustvaktException e) {
             throw kustvaktResponseHandler.throwit(e);
         }
     }
-    
+
     /**
      * Retrieves a specific user-group. Only system admins are
      * allowed.
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/controller/UserGroupController.java b/full/src/main/java/de/ids_mannheim/korap/web/controller/UserGroupController.java
index 19c97d7..b54269a 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/controller/UserGroupController.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/controller/UserGroupController.java
@@ -64,7 +64,8 @@
      * 
      * Not suitable for system-admin, instead use
      * {@link UserGroupController#
-     * getUserGroupBySystemAdmin(SecurityContext, String, UserGroupStatus)}
+     * getUserGroupBySystemAdmin(SecurityContext, String,
+     * UserGroupStatus)}
      * 
      * @param securityContext
      * @return a list of user-groups
@@ -73,8 +74,8 @@
     @GET
     public List<UserGroupDto> listUserGroups (
             @Context SecurityContext securityContext) {
-        TokenContext context =
-                (TokenContext) securityContext.getUserPrincipal();
+        TokenContext context = (TokenContext) securityContext
+                .getUserPrincipal();
         try {
             scopeService.verifyScope(context, OAuth2Scope.USER_GROUP_INFO);
             return service.retrieveUserGroupDto(context.getUsername());
@@ -90,18 +91,20 @@
      * context.
      * 
      * @param securityContext
-     * @param groupName the name of the group            
+     * @param groupName
+     *            the name of the group
      * @return if a new group created, HTTP response status 201
      *         Created, otherwise 204 No Content.
      */
     @PUT
     @Path("@{groupName}")
     @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
-    public Response createUpdateUserGroup (@Context SecurityContext securityContext,
+    public Response createUpdateUserGroup (
+            @Context SecurityContext securityContext,
             @PathParam("groupName") String groupName,
             @FormParam("description") String description) {
-        TokenContext context =
-                (TokenContext) securityContext.getUserPrincipal();
+        TokenContext context = (TokenContext) securityContext
+                .getUserPrincipal();
         try {
             scopeService.verifyScope(context, OAuth2Scope.CREATE_USER_GROUP);
             boolean groupExists = service.createUpdateUserGroup(groupName,
@@ -131,8 +134,8 @@
     @Path("@{groupName}")
     public Response deleteUserGroup (@Context SecurityContext securityContext,
             @PathParam("groupName") String groupName) {
-        TokenContext context =
-                (TokenContext) securityContext.getUserPrincipal();
+        TokenContext context = (TokenContext) securityContext
+                .getUserPrincipal();
         try {
             scopeService.verifyScope(context, OAuth2Scope.DELETE_USER_GROUP);
             service.deleteGroup(groupName, context.getUsername());
@@ -161,8 +164,8 @@
             @Context SecurityContext securityContext,
             @PathParam("memberUsername") String memberUsername,
             @PathParam("groupName") String groupName) {
-        TokenContext context =
-                (TokenContext) securityContext.getUserPrincipal();
+        TokenContext context = (TokenContext) securityContext
+                .getUserPrincipal();
         try {
             scopeService.verifyScope(context,
                     OAuth2Scope.DELETE_USER_GROUP_MEMBER);
@@ -179,7 +182,7 @@
      * Invites users to join a user-group specified by the
      * groupName. Only user-group admins and system admins are
      * allowed to use this service.
-     *  
+     * 
      * The invited users are added as group members with status
      * GroupMemberStatus.PENDING.
      * 
@@ -205,8 +208,8 @@
             @Context SecurityContext securityContext,
             @PathParam("groupName") String groupName,
             @FormParam("members") String members) {
-        TokenContext context =
-                (TokenContext) securityContext.getUserPrincipal();
+        TokenContext context = (TokenContext) securityContext
+                .getUserPrincipal();
         try {
             scopeService.verifyScope(context,
                     OAuth2Scope.ADD_USER_GROUP_MEMBER);
@@ -239,8 +242,8 @@
             @PathParam("groupName") String groupName,
             @FormParam("memberUsername") String memberUsername,
             @FormParam("roleId") List<Integer> roleIds) {
-        TokenContext context =
-                (TokenContext) securityContext.getUserPrincipal();
+        TokenContext context = (TokenContext) securityContext
+                .getUserPrincipal();
         try {
             scopeService.verifyScope(context,
                     OAuth2Scope.EDIT_USER_GROUP_MEMBER_ROLE);
@@ -273,8 +276,8 @@
             @PathParam("groupName") String groupName,
             @FormParam("memberUsername") String memberUsername,
             @FormParam("roleId") List<Integer> roleIds) {
-        TokenContext context =
-                (TokenContext) securityContext.getUserPrincipal();
+        TokenContext context = (TokenContext) securityContext
+                .getUserPrincipal();
         try {
             scopeService.verifyScope(context,
                     OAuth2Scope.ADD_USER_GROUP_MEMBER_ROLE);
@@ -308,8 +311,8 @@
             @PathParam("groupName") String groupName,
             @FormParam("memberUsername") String memberUsername,
             @FormParam("roleId") List<Integer> roleIds) {
-        TokenContext context =
-                (TokenContext) securityContext.getUserPrincipal();
+        TokenContext context = (TokenContext) securityContext
+                .getUserPrincipal();
         try {
             scopeService.verifyScope(context,
                     OAuth2Scope.DELETE_USER_GROUP_MEMBER_ROLE);
@@ -335,8 +338,8 @@
     @Path("@{groupName}/subscribe")
     public Response subscribeToGroup (@Context SecurityContext securityContext,
             @PathParam("groupName") String groupName) {
-        TokenContext context =
-                (TokenContext) securityContext.getUserPrincipal();
+        TokenContext context = (TokenContext) securityContext
+                .getUserPrincipal();
         try {
             scopeService.verifyScope(context,
                     OAuth2Scope.ADD_USER_GROUP_MEMBER);
@@ -364,8 +367,8 @@
     public Response unsubscribeFromGroup (
             @Context SecurityContext securityContext,
             @PathParam("groupName") String groupName) {
-        TokenContext context =
-                (TokenContext) securityContext.getUserPrincipal();
+        TokenContext context = (TokenContext) securityContext
+                .getUserPrincipal();
         try {
             scopeService.verifyScope(context,
                     OAuth2Scope.DELETE_USER_GROUP_MEMBER);
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/controller/UserSettingController.java b/full/src/main/java/de/ids_mannheim/korap/web/controller/UserSettingController.java
index bf57a1e..af0199f 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/controller/UserSettingController.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/controller/UserSettingController.java
@@ -113,7 +113,8 @@
             if (settings == null) {
                 username = tokenContext.getUsername();
                 throw new KustvaktException(StatusCodes.NO_RESOURCE_FOUND,
-                        "No default setting for username: " + username+" is found",
+                        "No default setting for username: " + username
+                                + " is found",
                         username);
             }
             return Response.ok(settings).build();
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/controller/VirtualCorpusAdminController.java b/full/src/main/java/de/ids_mannheim/korap/web/controller/VirtualCorpusAdminController.java
index c6ffcdf..b4946fb 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/controller/VirtualCorpusAdminController.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/controller/VirtualCorpusAdminController.java
@@ -34,20 +34,19 @@
     private KustvaktResponseHandler kustvaktResponseHandler;
     @Autowired
     private QueryService service;
-    
+
     @Autowired
     private NamedVCLoader vcLoader;
-    
+
     @POST
     @Path("load-cache")
     public Response loadAndCacheSystemVC () {
         Thread t = new Thread(vcLoader);
         t.start();
-        
+
         return Response.status(Status.OK).build();
     }
-    
-    
+
     /**
      * Lists virtual corpora by creator and type. This is a controller
      * for system admin requiring valid system admin authentication.
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/controller/VirtualCorpusController.java b/full/src/main/java/de/ids_mannheim/korap/web/controller/VirtualCorpusController.java
index bd9e13c..b69b09f 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/controller/VirtualCorpusController.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/controller/VirtualCorpusController.java
@@ -81,7 +81,7 @@
      * VC name cannot be updated.
      * 
      * The VC creator must be the same as the authenticated username,
-     * except for system admins. System admins can create or update 
+     * except for system admins. System admins can create or update
      * system VC and any VC for any users.
      * 
      * 
@@ -102,10 +102,10 @@
     @Consumes(MediaType.APPLICATION_JSON + ";charset=utf-8")
     public Response createUpdateVC (@Context SecurityContext securityContext,
             @PathParam("vcCreator") String vcCreator,
-            @PathParam("vcName") String vcName,
-            QueryJson vc) throws KustvaktException {
-        TokenContext context =
-                (TokenContext) securityContext.getUserPrincipal();
+            @PathParam("vcName") String vcName, QueryJson vc)
+            throws KustvaktException {
+        TokenContext context = (TokenContext) securityContext
+                .getUserPrincipal();
 
         try {
             scopeService.verifyScope(context, OAuth2Scope.EDIT_VC);
@@ -120,7 +120,7 @@
         catch (KustvaktException e) {
             throw kustvaktResponseHandler.throwit(e);
         }
-        
+
     }
 
     /**
@@ -139,13 +139,12 @@
     @GET
     @Path("~{createdBy}/{vcName}")
     @ResourceFilters({ APIVersionFilter.class, AuthenticationFilter.class,
-        DemoUserFilter.class, PiwikFilter.class })
-    public QueryDto retrieveVCByName (
-            @Context SecurityContext securityContext,
+            DemoUserFilter.class, PiwikFilter.class })
+    public QueryDto retrieveVCByName (@Context SecurityContext securityContext,
             @PathParam("createdBy") String createdBy,
             @PathParam("vcName") String vcName) {
-        TokenContext context =
-                (TokenContext) securityContext.getUserPrincipal();
+        TokenContext context = (TokenContext) securityContext
+                .getUserPrincipal();
         try {
             scopeService.verifyScope(context, OAuth2Scope.VC_INFO);
             return service.retrieveQueryByName(context.getUsername(), vcName,
@@ -162,8 +161,8 @@
             @Context SecurityContext securityContext,
             @PathParam("createdBy") String createdBy,
             @PathParam("vcName") String vcName) {
-        TokenContext context =
-                (TokenContext) securityContext.getUserPrincipal();
+        TokenContext context = (TokenContext) securityContext
+                .getUserPrincipal();
         try {
             scopeService.verifyScope(context, OAuth2Scope.VC_INFO);
             return service.retrieveKoralQuery(context.getUsername(), vcName,
@@ -173,8 +172,9 @@
             throw kustvaktResponseHandler.throwit(e);
         }
     }
-    
-    /** Retrieves field values of a virtual corpus, e.g. corpus sigle.
+
+    /**
+     * Retrieves field values of a virtual corpus, e.g. corpus sigle.
      * 
      * This service is restricted to system admin only.
      * 
@@ -187,13 +187,12 @@
     @GET
     @Path("/field/~{createdBy}/{vcName}")
     @ResourceFilters({ APIVersionFilter.class, AdminFilter.class })
-    public JsonNode retrieveVCField (
-            @Context SecurityContext securityContext,
+    public JsonNode retrieveVCField (@Context SecurityContext securityContext,
             @PathParam("createdBy") String createdBy,
             @PathParam("vcName") String vcName,
             @QueryParam("fieldName") String fieldName) {
-        TokenContext context =
-                (TokenContext) securityContext.getUserPrincipal();
+        TokenContext context = (TokenContext) securityContext
+                .getUserPrincipal();
         try {
             return service.retrieveFieldValues(context.getUsername(), vcName,
                     createdBy, QueryType.VIRTUAL_CORPUS, fieldName);
@@ -202,7 +201,7 @@
             throw kustvaktResponseHandler.throwit(e);
         }
     }
-    
+
     /**
      * Lists all virtual corpora available to the user.
      *
@@ -222,28 +221,28 @@
     public List<QueryDto> listAvailableVC (
             @Context SecurityContext securityContext,
             @QueryParam("filter-by") String filter) {
-        TokenContext context =
-                (TokenContext) securityContext.getUserPrincipal();
+        TokenContext context = (TokenContext) securityContext
+                .getUserPrincipal();
 
         try {
             scopeService.verifyScope(context, OAuth2Scope.VC_INFO);
-            if (filter !=null && !filter.isEmpty() ) {
+            if (filter != null && !filter.isEmpty()) {
                 filter = filter.toLowerCase();
                 if (filter.equals("system")) {
                     return service.listSystemQuery(QueryType.VIRTUAL_CORPUS);
                 }
                 else if (filter.equals("own")) {
                     return service.listOwnerQuery(context.getUsername(),
-                            QueryType.VIRTUAL_CORPUS);    
+                            QueryType.VIRTUAL_CORPUS);
                 }
                 else {
-                    throw new KustvaktException(StatusCodes.UNSUPPORTED_VALUE, 
+                    throw new KustvaktException(StatusCodes.UNSUPPORTED_VALUE,
                             "The given filter is unknown or not supported.");
                 }
             }
             else {
                 return service.listAvailableQueryForUser(context.getUsername(),
-                    QueryType.VIRTUAL_CORPUS);
+                        QueryType.VIRTUAL_CORPUS);
             }
         }
         catch (KustvaktException e) {
@@ -276,14 +275,13 @@
     public List<QueryDto> listUserOrSystemVC (
             @PathParam("createdBy") String createdBy,
             @Context SecurityContext securityContext) {
-        
+
         KustvaktException e = new KustvaktException(StatusCodes.DEPRECATED,
                 "This service has been deprecated. Please use Virtual Corpus List "
-                + "web-service.");
-            throw kustvaktResponseHandler.throwit(e);
+                        + "web-service.");
+        throw kustvaktResponseHandler.throwit(e);
     }
-    
-   
+
     /**
      * Only the VC owner and system admins can delete VC. VCA admins
      * can delete VC-accesses e.g. of project VC, but not the VC
@@ -301,8 +299,8 @@
     public Response deleteVCByName (@Context SecurityContext securityContext,
             @PathParam("createdBy") String createdBy,
             @PathParam("vcName") String vcName) {
-        TokenContext context =
-                (TokenContext) securityContext.getUserPrincipal();
+        TokenContext context = (TokenContext) securityContext
+                .getUserPrincipal();
         try {
             scopeService.verifyScope(context, OAuth2Scope.DELETE_VC);
             service.deleteQueryByName(context.getUsername(), vcName, createdBy,
@@ -335,13 +333,14 @@
     @Path("~{vcCreator}/{vcName}/share/@{groupName}")
     public Response shareVC (@Context SecurityContext securityContext,
             @PathParam("vcCreator") String vcCreator,
-            @PathParam("vcName") String vcName, 
+            @PathParam("vcName") String vcName,
             @PathParam("groupName") String groupName) {
-        TokenContext context =
-                (TokenContext) securityContext.getUserPrincipal();
+        TokenContext context = (TokenContext) securityContext
+                .getUserPrincipal();
         try {
             scopeService.verifyScope(context, OAuth2Scope.SHARE_VC);
-            service.shareQuery(context.getUsername(), vcCreator, vcName, groupName);
+            service.shareQuery(context.getUsername(), vcCreator, vcName,
+                    groupName);
         }
         catch (KustvaktException e) {
             throw kustvaktResponseHandler.throwit(e);
@@ -365,8 +364,8 @@
     public Response deleteVCAccessById (
             @Context SecurityContext securityContext,
             @PathParam("accessId") int accessId) {
-        TokenContext context =
-                (TokenContext) securityContext.getUserPrincipal();
+        TokenContext context = (TokenContext) securityContext
+                .getUserPrincipal();
         try {
             scopeService.verifyScope(context, OAuth2Scope.DELETE_VC_ACCESS);
             service.deleteQueryAccess(accessId, context.getUsername());
@@ -391,12 +390,13 @@
     public List<QueryAccessDto> listVCAccesses (
             @Context SecurityContext securityContext,
             @QueryParam("groupName") String groupName) {
-        TokenContext context =
-                (TokenContext) securityContext.getUserPrincipal();
+        TokenContext context = (TokenContext) securityContext
+                .getUserPrincipal();
         try {
             scopeService.verifyScope(context, OAuth2Scope.VC_ACCESS_INFO);
-            if (groupName!=null && !groupName.isEmpty()){
-                return service.listQueryAccessByGroup(context.getUsername(), groupName);
+            if (groupName != null && !groupName.isEmpty()) {
+                return service.listQueryAccessByGroup(context.getUsername(),
+                        groupName);
             }
             else {
                 return service.listQueryAccessByUsername(context.getUsername());
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/filter/APIVersionFilter.java b/full/src/main/java/de/ids_mannheim/korap/web/filter/APIVersionFilter.java
index ed0c2c3..e42de93 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/filter/APIVersionFilter.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/filter/APIVersionFilter.java
@@ -20,8 +20,7 @@
  */
 @Component
 @Priority(Integer.MIN_VALUE)
-public class APIVersionFilter
-        implements ContainerRequestFilter {
+public class APIVersionFilter implements ContainerRequestFilter {
 
     @Autowired
     private KustvaktConfiguration config;
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/filter/AdminFilter.java b/full/src/main/java/de/ids_mannheim/korap/web/filter/AdminFilter.java
index 18a12d8..e09ebd5 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/filter/AdminFilter.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/filter/AdminFilter.java
@@ -49,7 +49,6 @@
         }
     }
 
-
     private boolean checkAdminToken (String adminToken) {
         if (adminToken != null && !adminToken.isEmpty()) {
             if (adminToken
@@ -60,7 +59,6 @@
         return false;
     }
 
-
     private void checkAdminCredentials (TokenContext tokenContext,
             String username) {
         if (tokenContext != null) {
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/filter/AuthenticationFilter.java b/full/src/main/java/de/ids_mannheim/korap/web/filter/AuthenticationFilter.java
index e24a7a4..1fb9360 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/filter/AuthenticationFilter.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/filter/AuthenticationFilter.java
@@ -21,8 +21,9 @@
 import jakarta.ws.rs.container.ContainerRequestContext;
 import jakarta.ws.rs.container.ContainerRequestFilter;
 
-/** Authentication filter extracts an authentication token from 
- * authorization header and uses an authentication provider 
+/**
+ * Authentication filter extracts an authentication token from
+ * authorization header and uses an authentication provider
  * with respect to the token type to create a token context as
  * a security context.
  * 
@@ -32,11 +33,11 @@
  */
 @Component
 @Priority(Priorities.AUTHENTICATION)
-public class AuthenticationFilter
-        implements ContainerRequestFilter {
+public class AuthenticationFilter implements ContainerRequestFilter {
 
-    private static Logger jlog = LogManager.getLogger(AuthenticationFilter.class);
-    
+    private static Logger jlog = LogManager
+            .getLogger(AuthenticationFilter.class);
+
     @Autowired
     private HttpAuthorizationHandler authorizationHandler;
 
@@ -51,8 +52,8 @@
         String host = request.getHeaderString(ContainerRequest.HOST);
         String ua = request.getHeaderString(ContainerRequest.USER_AGENT);
 
-        String authorization =
-                request.getHeaderString(ContainerRequest.AUTHORIZATION);
+        String authorization = request
+                .getHeaderString(ContainerRequest.AUTHORIZATION);
 
         if (authorization != null && !authorization.isEmpty()) {
             TokenContext context = null;
@@ -102,9 +103,8 @@
         }
     }
 
-
-    private void checkContext (TokenContext context, ContainerRequestContext request)
-            throws KustvaktException {
+    private void checkContext (TokenContext context,
+            ContainerRequestContext request) throws KustvaktException {
         if (context == null) {
             throw new KustvaktException(StatusCodes.AUTHENTICATION_FAILED,
                     "Context is null.");
@@ -114,7 +114,8 @@
                     "Context is not valid: "
                             + "missing username, password or authentication scheme.");
         }
-        else if (context.isSecureRequired() && !request.getSecurityContext().isSecure()) {
+        else if (context.isSecureRequired()
+                && !request.getSecurityContext().isSecure()) {
             throw new KustvaktException(StatusCodes.AUTHENTICATION_FAILED,
                     "Request is not secure.");
         }
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/filter/BlockingFilter.java b/full/src/main/java/de/ids_mannheim/korap/web/filter/BlockingFilter.java
index 09c811c..e33f57f 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/filter/BlockingFilter.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/filter/BlockingFilter.java
@@ -28,7 +28,6 @@
     @Autowired
     private KustvaktResponseHandler kustvaktResponseHandler;
 
-    
     @Override
     public void filter (ContainerRequestContext request) {
         TokenContext context;
@@ -38,14 +37,14 @@
             context = (TokenContext) securityContext.getUserPrincipal();
         }
         else {
-            throw kustvaktResponseHandler.throwit(new KustvaktException(
-                    StatusCodes.UNSUPPORTED_OPERATION));
+            throw kustvaktResponseHandler.throwit(
+                    new KustvaktException(StatusCodes.UNSUPPORTED_OPERATION));
         }
 
         if (context == null || context.isDemo()) {
-            throw kustvaktResponseHandler.throwit(new KustvaktException(
-                    StatusCodes.AUTHORIZATION_FAILED,
-                    "Unauthorized operation for user: guest", "guest"));
+            throw kustvaktResponseHandler.throwit(
+                    new KustvaktException(StatusCodes.AUTHORIZATION_FAILED,
+                            "Unauthorized operation for user: guest", "guest"));
         }
     }
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/filter/DemoFilter.java b/full/src/main/java/de/ids_mannheim/korap/web/filter/DemoFilter.java
index 55ad2ae..2a3cdf0 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/filter/DemoFilter.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/filter/DemoFilter.java
@@ -22,8 +22,8 @@
 
     @Override
     public void filter (ContainerRequestContext request) {
-        String authentication =
-                request.getHeaderString(ContainerRequest.AUTHORIZATION);
+        String authentication = request
+                .getHeaderString(ContainerRequest.AUTHORIZATION);
         if (authentication == null || authentication.isEmpty()) {
             if (request.getSecurityContext() == null) {
                 request.setSecurityContext(createContext());
@@ -31,7 +31,6 @@
         }
     }
 
-
     private SecurityContext createContext () {
         TokenContext context = new TokenContext();
         String token = null;
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/filter/DemoUserFilter.java b/full/src/main/java/de/ids_mannheim/korap/web/filter/DemoUserFilter.java
index 330ece2..300c3da 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/filter/DemoUserFilter.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/filter/DemoUserFilter.java
@@ -32,7 +32,6 @@
     @Autowired
     private KustvaktConfiguration config;
 
-
     @Override
     public void filter (ContainerRequestContext request) {
         String host = request.getHeaderString(ContainerRequest.HOST);
@@ -48,12 +47,11 @@
                 pr = securityContext.getUserPrincipal();
             }
             if (pr == null)
-                request.setSecurityContext(new KustvaktContext(
-                        createShorterToken(host, ua)));
+                request.setSecurityContext(
+                        new KustvaktContext(createShorterToken(host, ua)));
         }
     }
 
-
     private TokenContext createShorterToken (String host, String agent) {
         User demo = User.UserFactory.getDemoUser();
         TokenContext c = new TokenContext();
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/filter/NonDemoBlockingFilter.java b/full/src/main/java/de/ids_mannheim/korap/web/filter/NonDemoBlockingFilter.java
index c69e18e..1e3a05c 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/filter/NonDemoBlockingFilter.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/filter/NonDemoBlockingFilter.java
@@ -1,6 +1,5 @@
 package de.ids_mannheim.korap.web.filter;
 
-
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -15,7 +14,8 @@
 import jakarta.ws.rs.core.SecurityContext;
 
 /**
- * EM: pretty much identical to {@link BlockingFilter}, should be deleted? 
+ * EM: pretty much identical to {@link BlockingFilter}, should be
+ * deleted?
  * 
  * @author hanl
  * @date 11/12/2014
@@ -25,8 +25,7 @@
  */
 @Component
 @Priority(Priorities.AUTHORIZATION)
-public class NonDemoBlockingFilter
-        implements ContainerRequestFilter {
+public class NonDemoBlockingFilter implements ContainerRequestFilter {
 
     @Autowired
     private KustvaktResponseHandler kustvaktResponseHandler;
@@ -39,8 +38,8 @@
             context = (TokenContext) securityContext.getUserPrincipal();
         }
         else {
-            throw kustvaktResponseHandler.throwit(new KustvaktException(
-                    StatusCodes.UNSUPPORTED_OPERATION));
+            throw kustvaktResponseHandler.throwit(
+                    new KustvaktException(StatusCodes.UNSUPPORTED_OPERATION));
         }
 
         if (context == null || context.isDemo()) {
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/filter/PiwikFilter.java b/full/src/main/java/de/ids_mannheim/korap/web/filter/PiwikFilter.java
index 88961f2..42ede2a 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/filter/PiwikFilter.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/filter/PiwikFilter.java
@@ -41,10 +41,9 @@
     @Autowired
     private AuthenticationManager authenticationManager;
 
-
     public PiwikFilter () {
-//        controller = BeansFactory.getKustvaktContext()
-//                .getAuthenticationManager();
+        //        controller = BeansFactory.getKustvaktContext()
+        //                .getAuthenticationManager();
         ClientConfig clientConfig = new ClientConfig();
         if (jlog.isDebugEnabled())
             clientConfig.register(LoggingFeature.class);
@@ -54,15 +53,13 @@
         this.customVars = new HashMap<>();
     }
 
-
     private void send (ContainerRequestContext request) {
         Random random = new SecureRandom();
         Locale l = null;
         if (request.getAcceptableLanguages() != null)
             l = request.getAcceptableLanguages().get(0);
         try {
-            service.path("piwik/piwik.php")
-                    .queryParam("idsite", "2")
+            service.path("piwik/piwik.php").queryParam("idsite", "2")
                     .queryParam("rec", "1")
                     //todo check for empty container
                     .queryParam("_cvar", translateCustomData())
@@ -70,9 +67,9 @@
                     .queryParam("cookie", "false")
                     .queryParam("r", String.valueOf(random.nextDouble()))
                     .queryParam("action_name",
-                            request.getUriInfo().getRequestUri().toASCIIString())
-                    .request()
-                    .accept("text/html")
+                            request.getUriInfo().getRequestUri()
+                                    .toASCIIString())
+                    .request().accept("text/html")
                     .header("Host", request.getHeaderString("Host"))
                     .header("User-Agent", request.getHeaderString("User-Agent"))
                     .acceptLanguage(l).method("GET");
@@ -82,11 +79,11 @@
         }
     }
 
-
     private String translateCustomData () {
         final Map<String, List<String>> customVariables = new HashMap<String, List<String>>();
         int i = 0;
-        for (final Map.Entry<String, String> entry : this.customVars.entrySet()) {
+        for (final Map.Entry<String, String> entry : this.customVars
+                .entrySet()) {
             i++;
             final List<String> list = new ArrayList<String>();
             list.add(entry.getKey());
@@ -104,29 +101,28 @@
         return jsonString;
     }
 
-
     @Override
     public void filter (ContainerRequestContext request) {
         if (ENABLED) {
-//            try {
-//                TokenContext context;
-//                SecurityContext securityContext = request.getSecurityContext();
-//                if (securityContext != null) {
-//                    context = (TokenContext) securityContext.getUserPrincipal();
-//
-//                    if (context.getUsername() != null){
-//                        // since this is cached, not very expensive!
-//                        User user = authenticationManager.getUser(context.getUsername());
-//                        Userdata data = authenticationManager
-//                                .getUserData(user, UserSettingProcessor.class);
-//                        if ((Boolean) data.get(Attributes.COLLECT_AUDITING_DATA))
-//                            customVars.put("username", context.getUsername());
-//                    }
-//                }
-//            }
-//            catch (KustvaktException e) {
-//                //do nothing
-//            }
+            //            try {
+            //                TokenContext context;
+            //                SecurityContext securityContext = request.getSecurityContext();
+            //                if (securityContext != null) {
+            //                    context = (TokenContext) securityContext.getUserPrincipal();
+            //
+            //                    if (context.getUsername() != null){
+            //                        // since this is cached, not very expensive!
+            //                        User user = authenticationManager.getUser(context.getUsername());
+            //                        Userdata data = authenticationManager
+            //                                .getUserData(user, UserSettingProcessor.class);
+            //                        if ((Boolean) data.get(Attributes.COLLECT_AUDITING_DATA))
+            //                            customVars.put("username", context.getUsername());
+            //                    }
+            //                }
+            //            }
+            //            catch (KustvaktException e) {
+            //                //do nothing
+            //            }
             send(request);
         }
     }
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/input/OAuth2ClientJson.java b/full/src/main/java/de/ids_mannheim/korap/web/input/OAuth2ClientJson.java
index e6b4490..9630a0e 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/input/OAuth2ClientJson.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/input/OAuth2ClientJson.java
@@ -7,7 +7,7 @@
 
 /**
  * Defines attributes to register an OAuth2 client. Application name,
- * client type and description are required attributes. 
+ * client type and description are required attributes.
  * 
  * To accommodate desktop applications such as R, url and redirectURI
  * are not compulsory.
@@ -23,7 +23,7 @@
     private String name;
     private OAuth2ClientType type;
     private String description;
-    
+
     // optional
     private String url;
     // redirect URI determines where the OAuth 2.0 service will return
@@ -33,7 +33,7 @@
     // Default 365 days
     @JsonProperty("refresh_token_expiry")
     private int refreshTokenExpiry; // in seconds
-    
+
     // plugins
     private JsonNode source;
 
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/input/QueryJson.java b/full/src/main/java/de/ids_mannheim/korap/web/input/QueryJson.java
index 8badd38..dcc88e3 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/input/QueryJson.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/input/QueryJson.java
@@ -1,6 +1,5 @@
 package de.ids_mannheim.korap.web.input;
 
-
 import de.ids_mannheim.korap.constant.QueryType;
 import de.ids_mannheim.korap.constant.ResourceType;
 import de.ids_mannheim.korap.service.QueryService;
@@ -9,7 +8,8 @@
 import lombok.Getter;
 import lombok.Setter;
 
-/** Java POJO of JSON input of the virtual corpus and query controllers 
+/**
+ * Java POJO of JSON input of the virtual corpus and query controllers
  * for creating and editing virtual corpora and query references.
  * 
  * @author margaretha
@@ -22,7 +22,7 @@
 public class QueryJson {
     // default false
     private boolean isCached;
-    
+
     // required
     private ResourceType type;
     // required for queryType="VIRTUAL_CORPUS"
@@ -30,7 +30,7 @@
     // required for queryType="QUERY"
     private String query;
     private String queryLanguage;
-    
+
     // optional
     private String definition;
     private String description;
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/input/UserGroupJson.java b/full/src/main/java/de/ids_mannheim/korap/web/input/UserGroupJson.java
index 6868262..0cc4922 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/input/UserGroupJson.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/input/UserGroupJson.java
@@ -4,7 +4,8 @@
 import lombok.Getter;
 import lombok.Setter;
 
-/** Java POJO of JSON input used in the user group controller for 
+/**
+ * Java POJO of JSON input used in the user group controller for
  * creating user group and managing group members.
  * 
  * @author margaretha
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/utils/FormRequestWrapper.java b/full/src/main/java/de/ids_mannheim/korap/web/utils/FormRequestWrapper.java
index 12c4f01..959ed80 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/utils/FormRequestWrapper.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/utils/FormRequestWrapper.java
@@ -19,7 +19,6 @@
 
     private MultivaluedMap<String, String> form;
 
-
     /**
      * Constructs a request object wrapping the given request.
      * 
@@ -33,17 +32,15 @@
         this.form = form;
     }
 
-
     @Override
     public String getParameter (String name) {
         String value = super.getParameter(name);
-        if (value == null){
+        if (value == null) {
             value = form.getFirst(name);
         }
         return value;
     }
 
-
     @Override
     public String[] getParameterValues (String name) {
         String[] values = super.getParameterValues(name);
@@ -54,12 +51,10 @@
         return values;
     }
 
-
     public HashMap<String, Object> singleValueMap () {
         return toMap(this.form, false);
     }
 
-
     /**
      * @param strict
      *            returns only values with size equal to one. If false
@@ -81,12 +76,10 @@
         return map;
     }
 
-
     public void put (String key, String value) {
         this.form.putSingle(key, value);
     }
 
-
     public void put (String key, String ... values) {
         this.form.put(key, Arrays.<String> asList(values));
     }
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/utils/HTMLBuilder.java b/full/src/main/java/de/ids_mannheim/korap/web/utils/HTMLBuilder.java
index 543fbae..30e3a5b 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/utils/HTMLBuilder.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/utils/HTMLBuilder.java
@@ -10,7 +10,6 @@
     private StringBuilder body;
     private String bodyAttr;
 
-
     public HTMLBuilder () {
         html = new StringBuilder();
         body = new StringBuilder();
@@ -18,25 +17,21 @@
         html.append("<html>");
     }
 
-
     public void addHeader (String header, int h) {
         html.append("<h" + h + ">");
         html.append(header);
         html.append("</h" + h + ">");
     }
 
-
     public void addToBody (String body) {
         this.body.append(body);
     }
 
-
     public void addToBody (String body, String attributes) {
         this.body.append(body);
         bodyAttr = attributes;
     }
 
-
     public String build () {
         if (bodyAttr.isEmpty())
             html.append("<body>");
@@ -52,7 +47,6 @@
         return html.toString();
     }
 
-
     @Override
     public String toString () {
         return build();
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/utils/JsonExceptionMapper.java b/full/src/main/java/de/ids_mannheim/korap/web/utils/JsonExceptionMapper.java
index a7efdf8..e5c28a2 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/utils/JsonExceptionMapper.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/utils/JsonExceptionMapper.java
@@ -1,6 +1,5 @@
 package de.ids_mannheim.korap.web.utils;
 
-
 import com.fasterxml.jackson.databind.JsonMappingException;
 
 import de.ids_mannheim.korap.exceptions.StatusCodes;
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/utils/KustvaktMap.java b/full/src/main/java/de/ids_mannheim/korap/web/utils/KustvaktMap.java
index 8e9de8a..6c5d5ea 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/utils/KustvaktMap.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/utils/KustvaktMap.java
@@ -13,30 +13,25 @@
     private boolean monoTyped;
     private Map<String, Object> values;
 
-
     public KustvaktMap () {
         this.values = new HashMap<>();
         this.monoTyped = false;
     }
 
-
     public KustvaktMap (Map<String, Object> m) {
         this();
         setMap(m);
     }
 
-
     public void setMap (Map<String, Object> m) {
         if (!isGeneric(m) | !this.monoTyped)
             this.values.putAll(m);
     }
 
-
     public boolean isGeneric () {
         return !this.monoTyped && isGeneric(this.values);
     }
 
-
     private static boolean isGeneric (Map<String, Object> map) {
         int i = 0;
         for (Object o : map.values()) {
@@ -46,12 +41,10 @@
         return !(i == map.size());
     }
 
-
     public void setMonoValue (boolean monovalue) {
         this.monoTyped = monovalue;
     }
 
-
     public String get (String key) {
         Object o = this.values.get(key);
         if (!isGeneric())
@@ -59,19 +52,16 @@
         return String.valueOf(o);
     }
 
-
     public Object getRaw (String key) {
         return this.values.get(key);
     }
 
-
     public <T extends Object> Object get (String key, Class<T> cl) {
         if (isGeneric())
             return (T) this.values.get(key);
         return get(key);
     }
 
-
     public Set<String> keySet () {
         return this.values.keySet();
     }
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/utils/KustvaktResponseBuilder.java b/full/src/main/java/de/ids_mannheim/korap/web/utils/KustvaktResponseBuilder.java
index b43adf8..5997787 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/utils/KustvaktResponseBuilder.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/utils/KustvaktResponseBuilder.java
@@ -10,21 +10,17 @@
 public class KustvaktResponseBuilder {
     Map<String, Object> _values;
 
-
     public KustvaktResponseBuilder () {
         this._values = new HashMap<>();
     }
 
-
     public KustvaktResponseBuilder addEntity (Object o) {
         if (o instanceof Map && !((Map) o).isEmpty())
             this._values.putAll((Map<? extends String, ?>) o);
 
-
         return this;
     }
 
-
     @Override
     public String toString () {
         return "";
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/utils/LocaleFactory.java b/full/src/main/java/de/ids_mannheim/korap/web/utils/LocaleFactory.java
index 268e7c8..f928701 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/utils/LocaleFactory.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/utils/LocaleFactory.java
@@ -15,7 +15,7 @@
     private ContainerRequestContext context;
 
     @Override
-    public Locale provide() {
+    public Locale provide () {
         final List<Locale> locales = context.getAcceptableLanguages();
         if (locales.isEmpty())
             return Locale.US;
@@ -23,5 +23,5 @@
     }
 
     @Override
-    public void dispose(Locale instance) {}
+    public void dispose (Locale instance) {}
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/utils/MapUtils.java b/full/src/main/java/de/ids_mannheim/korap/web/utils/MapUtils.java
index 497519a..ec11de1 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/utils/MapUtils.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/utils/MapUtils.java
@@ -28,7 +28,7 @@
         if (multivaluedMap == null) {
             return new HashMap<String, String>();
         }
-        
+
         Set<String> keySet = multivaluedMap.keySet();
         Map<String, String> map = new HashMap<String, String>(keySet.size());
 
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/utils/NotFoundMapper.java b/full/src/main/java/de/ids_mannheim/korap/web/utils/NotFoundMapper.java
index 20b6632..b20d124 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/utils/NotFoundMapper.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/utils/NotFoundMapper.java
@@ -32,8 +32,8 @@
 public class NotFoundMapper implements ExceptionMapper<NotFoundException> {
 
     private static Logger jlog = LogManager.getLogger(NotFoundMapper.class);
-    public static final Pattern VERSION_PATTERN =
-            Pattern.compile("/(v[0-9][^/]*)(/.*)");
+    public static final Pattern VERSION_PATTERN = Pattern
+            .compile("/(v[0-9][^/]*)(/.*)");
     private static final boolean DEBUG = false;
 
     @Autowired
@@ -44,10 +44,10 @@
 
     @Override
     public Response toResponse (NotFoundException exception) {
-        ContainerRequestContext requestContext =
-                resourceContext.getResource(ContainerRequestContext.class);
+        ContainerRequestContext requestContext = resourceContext
+                .getResource(ContainerRequestContext.class);
 
-    	URI notFoundUri = requestContext.getUriInfo().getRequestUri();
+        URI notFoundUri = requestContext.getUriInfo().getRequestUri();
 
         String path = notFoundUri.getPath();
         String baseUrl = config.getBaseURL();
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/utils/ResourceFilters.java b/full/src/main/java/de/ids_mannheim/korap/web/utils/ResourceFilters.java
index 94e5dc7..fa68084 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/utils/ResourceFilters.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/utils/ResourceFilters.java
@@ -6,14 +6,19 @@
 import java.lang.annotation.Target;
 
 /**
- * Defines the list of {@link jakarta.ws.rs.container.ContainerRequestFilter}
+ * Defines the list of
+ * {@link jakarta.ws.rs.container.ContainerRequestFilter}
  * and {@link jakarta.ws.rs.container.ContainerResponseFilter}
  * classes associated with a resource method.
  * <p>
- * This annotation can be specified on a class or on method(s). Specifying it
- * at a class level means that it applies to all the methods in the class.
- * Specifying it on a method means that it is applicable to that method only.
- * If applied at both the class and methods level , the method value overrides
+ * This annotation can be specified on a class or on method(s).
+ * Specifying it
+ * at a class level means that it applies to all the methods in the
+ * class.
+ * Specifying it on a method means that it is applicable to that
+ * method only.
+ * If applied at both the class and methods level , the method value
+ * overrides
  * the class value.
  */
 @Target({ ElementType.TYPE, ElementType.METHOD })
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/utils/ResourceFiltersFeature.java b/full/src/main/java/de/ids_mannheim/korap/web/utils/ResourceFiltersFeature.java
index db728e7..9e4a0ce 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/utils/ResourceFiltersFeature.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/utils/ResourceFiltersFeature.java
@@ -8,16 +8,19 @@
 /**
  * Registers {@link jakarta.ws.rs.container.ContainerRequestFilter}
  * and {@link jakarta.ws.rs.container.ContainerResponseFilter}
- * classes for a resource method annotated with {@link ResourceFilters}.
+ * classes for a resource method annotated with
+ * {@link ResourceFilters}.
  */
 @Provider
 public class ResourceFiltersFeature implements DynamicFeature {
 
     @Override
     public void configure (ResourceInfo resourceInfo, FeatureContext context) {
-        ResourceFilters filtersAnnotation = resourceInfo.getResourceMethod().getAnnotation(ResourceFilters.class);
+        ResourceFilters filtersAnnotation = resourceInfo.getResourceMethod()
+                .getAnnotation(ResourceFilters.class);
         if (filtersAnnotation == null)
-            filtersAnnotation = resourceInfo.getResourceClass().getAnnotation(ResourceFilters.class);
+            filtersAnnotation = resourceInfo.getResourceClass()
+                    .getAnnotation(ResourceFilters.class);
 
         if (filtersAnnotation != null) {
             for (Class<?> filter : filtersAnnotation.value())
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/utils/SearchResourceFilters.java b/full/src/main/java/de/ids_mannheim/korap/web/utils/SearchResourceFilters.java
index 1505d0e..60b226a 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/utils/SearchResourceFilters.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/utils/SearchResourceFilters.java
@@ -6,17 +6,21 @@
 import java.lang.annotation.Target;
 
 /**
- * Defines the list of {@link jakarta.ws.rs.container.ContainerRequestFilter}
+ * Defines the list of
+ * {@link jakarta.ws.rs.container.ContainerRequestFilter}
  * and {@link jakarta.ws.rs.container.ContainerResponseFilter}
  * classes associated with a resource method.
  * <p>
- * This annotation can be specified on a class or on method(s). Specifying it
- * at a class level means that it applies to all the methods in the class.
- * Specifying it on a method means that it is applicable to that method only.
- * If applied at both the class and methods level , the method value overrides
+ * This annotation can be specified on a class or on method(s).
+ * Specifying it
+ * at a class level means that it applies to all the methods in the
+ * class.
+ * Specifying it on a method means that it is applicable to that
+ * method only.
+ * If applied at both the class and methods level , the method value
+ * overrides
  * the class value.
  */
 @Target({ ElementType.TYPE, ElementType.METHOD })
 @Retention(RetentionPolicy.RUNTIME)
-public @interface SearchResourceFilters {
-}
+public @interface SearchResourceFilters {}
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/utils/SearchResourceFiltersFeature.java b/full/src/main/java/de/ids_mannheim/korap/web/utils/SearchResourceFiltersFeature.java
index 5c2e6e2..0b44ae8 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/utils/SearchResourceFiltersFeature.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/utils/SearchResourceFiltersFeature.java
@@ -16,7 +16,8 @@
 /**
  * Registers {@link jakarta.ws.rs.container.ContainerRequestFilter}
  * and {@link jakarta.ws.rs.container.ContainerResponseFilter}
- * classes for a resource method annotated with {@link ResourceFilters}.
+ * classes for a resource method annotated with
+ * {@link ResourceFilters}.
  */
 @Provider
 @Component
@@ -24,7 +25,7 @@
 
     @Value("${search.resource.filters:AuthenticationFilter,DemoUserFilter}")
     private String[] resourceFilters;
-    
+
     @Override
     public void configure (ResourceInfo resourceInfo, FeatureContext context) {
         SearchResourceFilters filters = resourceInfo.getResourceMethod()
@@ -32,25 +33,26 @@
         if (filters != null) {
             CommonConfig con = (CommonConfig) context.getConfiguration();
             con.getComponentBag().clear();
-        }        
+        }
         else {
             filters = resourceInfo.getResourceClass()
-            .getAnnotation(SearchResourceFilters.class);
+                    .getAnnotation(SearchResourceFilters.class);
         }
-        
+
         if (filters != null) {
             List<?> list = Arrays.asList(resourceFilters);
             if (!list.contains("APIVersionFilter")) {
                 context.register(APIVersionFilter.class);
             }
-            
-             for(String c : resourceFilters) {
-                    try {
-                        context.register(Class.forName("de.ids_mannheim.korap.web.filter." + c));
-                    }
-                    catch (ClassNotFoundException e) {
-                        e.printStackTrace();
-                    }
+
+            for (String c : resourceFilters) {
+                try {
+                    context.register(Class
+                            .forName("de.ids_mannheim.korap.web.filter." + c));
+                }
+                catch (ClassNotFoundException e) {
+                    e.printStackTrace();
+                }
             }
         }
     }
diff --git a/full/src/main/resources/basic-config.xml b/full/src/main/resources/basic-config.xml
index c8cfdaa..d882532 100644
--- a/full/src/main/resources/basic-config.xml
+++ b/full/src/main/resources/basic-config.xml
@@ -1,8 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xmlns:p="http://www.springframework.org/schema/p" xmlns:util="http://www.springframework.org/schema/util"
-	xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
-	xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context"
+	xmlns:p="http://www.springframework.org/schema/p"
+	xmlns:util="http://www.springframework.org/schema/util"
+	xmlns:aop="http://www.springframework.org/schema/aop"
+	xmlns:tx="http://www.springframework.org/schema/tx"
+	xmlns="http://www.springframework.org/schema/beans"
+	xmlns:context="http://www.springframework.org/schema/context"
 	xmlns:cache="http://www.springframework.org/schema/cache"
 	xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
@@ -15,7 +18,8 @@
            http://www.springframework.org/schema/util
            http://www.springframework.org/schema/util/spring-util-4.0.xsd">
 
-	<context:component-scan base-package="de.ids_mannheim.korap" />
+	<context:component-scan
+		base-package="de.ids_mannheim.korap" />
 	<context:annotation-config />
 
 	<bean id="props"
@@ -46,7 +50,8 @@
 		</property>
 	</bean>
 
-	<bean id='cacheManager' class='org.springframework.cache.ehcache.EhCacheCacheManager'
+	<bean id='cacheManager'
+		class='org.springframework.cache.ehcache.EhCacheCacheManager'
 		p:cacheManager-ref='ehcache' />
 
 	<bean id='ehcache'
@@ -55,9 +60,10 @@
 
 	<!--class="org.apache.commons.dbcp2.BasicDataSource" -->
 	<!-- org.springframework.jdbc.datasource.SingleConnectionDataSource -->
-	<bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource"
-		lazy-init="true">
-		<property name="driverClassName" value="${jdbc.driverClassName}" />
+	<bean id="dataSource"
+		class="org.apache.commons.dbcp2.BasicDataSource" lazy-init="true">
+		<property name="driverClassName"
+			value="${jdbc.driverClassName}" />
 		<property name="url" value="${jdbc.url}" />
 		<property name="username" value="${jdbc.username}" />
 		<property name="password" value="${jdbc.password}" />
@@ -74,7 +80,8 @@
 	<bean id="sqliteDataSource"
 		class="org.springframework.jdbc.datasource.SingleConnectionDataSource"
 		lazy-init="true">
-		<property name="driverClassName" value="${jdbc.driverClassName}" />
+		<property name="driverClassName"
+			value="${jdbc.driverClassName}" />
 		<property name="url" value="${jdbc.url}" />
 		<property name="username" value="${jdbc.username}" />
 		<property name="password" value="${jdbc.password}" />
@@ -93,22 +100,26 @@
 	</bean>
 
 	<!-- to configure database for sqlite, mysql, etc. migrations -->
-	<bean id="flywayConfig" class="org.flywaydb.core.api.configuration.ClassicConfiguration">
+	<bean id="flywayConfig"
+		class="org.flywaydb.core.api.configuration.ClassicConfiguration">
 		<property name="baselineOnMigrate" value="true" />
 		<!-- <property name="validateOnMigrate" value="false" /> -->
 		<!-- <property name="cleanOnValidationError" value="true" /> -->
-		<property name="locations" value="#{'${jdbc.schemaPath}'.split(',')}"/>
+		<property name="locations"
+			value="#{'${jdbc.schemaPath}'.split(',')}" />
 		<!-- <property name="dataSource" ref="dataSource" /> -->
 		<property name="dataSource" ref="sqliteDataSource" />
-		<property name="outOfOrder" value="true"/>
+		<property name="outOfOrder" value="true" />
 	</bean>
-	
-	<bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate">
-		<constructor-arg ref="flywayConfig"/>
+
+	<bean id="flyway" class="org.flywaydb.core.Flyway"
+		init-method="migrate">
+		<constructor-arg ref="flywayConfig" />
 	</bean>
 
 
-	<bean id="kustvakt_db" class="de.ids_mannheim.korap.handlers.JDBCClient">
+	<bean id="kustvakt_db"
+		class="de.ids_mannheim.korap.handlers.JDBCClient">
 		<constructor-arg index="0" ref="dataSource" />
 		<!-- deprecated property -->
 		<property name="database" value="${jdbc.database}" />
@@ -129,7 +140,8 @@
 		<property name="jpaVendorAdapter">
 			<bean id="jpaVendorAdapter"
 				class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
-				<property name="databasePlatform" value="${hibernate.dialect}" />
+				<property name="databasePlatform"
+					value="${hibernate.dialect}" />
 			</bean>
 		</property>
 		<property name="jpaProperties">
@@ -151,8 +163,10 @@
 	<tx:annotation-driven proxy-target-class="true"
 		transaction-manager="transactionManager" />
 
-	<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
-		<property name="entityManagerFactory" ref="entityManagerFactory" />
+	<bean id="transactionManager"
+		class="org.springframework.orm.jpa.JpaTransactionManager">
+		<property name="entityManagerFactory"
+			ref="entityManagerFactory" />
 	</bean>
 
 	<bean id="transactionTemplate"
@@ -162,70 +176,86 @@
 
 	<!-- Data access objects -->
 	<bean id="adminDao" class="de.ids_mannheim.korap.dao.AdminDaoImpl" />
-	<bean id="authorizationDao" class="de.ids_mannheim.korap.oauth2.dao.CachedAuthorizationDaoImpl" />
+	<bean id="authorizationDao"
+		class="de.ids_mannheim.korap.oauth2.dao.CachedAuthorizationDaoImpl" />
 
 	<!-- Services -->
-	<bean id="scopeService" class="de.ids_mannheim.korap.oauth2.service.OAuth2ScopeServiceImpl" />
-	
+	<bean id="scopeService"
+		class="de.ids_mannheim.korap.oauth2.service.OAuth2ScopeServiceImpl" />
+
 	<!-- props are injected from default-config.xml -->
-	<bean id="kustvakt_config" class="de.ids_mannheim.korap.config.FullConfiguration">
+	<bean id="kustvakt_config"
+		class="de.ids_mannheim.korap.config.FullConfiguration">
 		<constructor-arg name="properties" ref="props" />
 	</bean>
 
-	<bean id="initializator" class="de.ids_mannheim.de.init.Initializator"
-		init-method="init">
+	<bean id="initializator"
+		class="de.ids_mannheim.de.init.Initializator" init-method="init">
 	</bean>
-	
+
 	<!-- Krill -->
-	<bean id="search_krill" class="de.ids_mannheim.korap.web.SearchKrill">
+	<bean id="search_krill"
+		class="de.ids_mannheim.korap.web.SearchKrill">
 		<constructor-arg value="${krill.indexDir}" />
 	</bean>
 
-    <!-- Validator -->
-	<bean id="validator" class="de.ids_mannheim.korap.validator.ApacheValidator"/>
-	
+	<!-- Validator -->
+	<bean id="validator"
+		class="de.ids_mannheim.korap.validator.ApacheValidator" />
+
 	<!-- URLValidator -->
-	<bean id="redirectURIValidator" class="org.apache.commons.validator.routines.UrlValidator">
+	<bean id="redirectURIValidator"
+		class="org.apache.commons.validator.routines.UrlValidator">
 		<constructor-arg value="http,https" index="0" />
 		<constructor-arg index="1" type="long">
 			<util:constant
 				static-field="org.apache.commons.validator.routines.UrlValidator.NO_FRAGMENTS" />
 		</constructor-arg>
 	</bean>
-	<bean id="urlValidator" class="org.apache.commons.validator.routines.UrlValidator">
+	<bean id="urlValidator"
+		class="org.apache.commons.validator.routines.UrlValidator">
 		<constructor-arg value="http,https" />
 	</bean>
-	
+
 	<!-- Rewrite -->
-	<bean id="foundryRewrite" class="de.ids_mannheim.korap.rewrite.FoundryRewrite"/>
-	<bean id="collectionRewrite" class="de.ids_mannheim.korap.rewrite.CollectionRewrite"/>
-	<bean id="virtualCorpusRewrite" class="de.ids_mannheim.korap.rewrite.VirtualCorpusRewrite"/>
- 	<bean id="queryReferenceRewrite" class="de.ids_mannheim.korap.rewrite.QueryReferenceRewrite"/>
-	
+	<bean id="foundryRewrite"
+		class="de.ids_mannheim.korap.rewrite.FoundryRewrite" />
+	<bean id="collectionRewrite"
+		class="de.ids_mannheim.korap.rewrite.CollectionRewrite" />
+	<bean id="virtualCorpusRewrite"
+		class="de.ids_mannheim.korap.rewrite.VirtualCorpusRewrite" />
+	<bean id="queryReferenceRewrite"
+		class="de.ids_mannheim.korap.rewrite.QueryReferenceRewrite" />
+
 	<util:list id="rewriteTasks"
 		value-type="de.ids_mannheim.korap.rewrite.RewriteTask">
 		<ref bean="foundryRewrite" />
 		<ref bean="collectionRewrite" />
 		<ref bean="virtualCorpusRewrite" />
-    <ref bean="queryReferenceRewrite" />
+		<ref bean="queryReferenceRewrite" />
 	</util:list>
-	
-	<bean id="rewriteHandler" class="de.ids_mannheim.korap.rewrite.RewriteHandler">
-		<constructor-arg ref="rewriteTasks"/>
+
+	<bean id="rewriteHandler"
+		class="de.ids_mannheim.korap.rewrite.RewriteHandler">
+		<constructor-arg ref="rewriteTasks" />
 	</bean>
 
-	<bean id="kustvaktResponseHandler" class="de.ids_mannheim.korap.web.KustvaktResponseHandler">
+	<bean id="kustvaktResponseHandler"
+		class="de.ids_mannheim.korap.web.KustvaktResponseHandler">
 	</bean>
 
 	<!-- OAuth -->
-	<bean id="oauth2ResponseHandler" class="de.ids_mannheim.korap.web.OAuth2ResponseHandler">
+	<bean id="oauth2ResponseHandler"
+		class="de.ids_mannheim.korap.web.OAuth2ResponseHandler">
 	</bean>
 
-	<bean id="kustvakt_userdb" class="de.ids_mannheim.korap.handlers.EntityDao">
+	<bean id="kustvakt_userdb"
+		class="de.ids_mannheim.korap.handlers.EntityDao">
 		<constructor-arg ref="kustvakt_db" />
 	</bean>
 
-	<bean name="kustvakt_encryption" class="de.ids_mannheim.korap.encryption.KustvaktEncryption">
+	<bean name="kustvakt_encryption"
+		class="de.ids_mannheim.korap.encryption.KustvaktEncryption">
 		<constructor-arg ref="kustvakt_config" />
 	</bean>
 
@@ -234,8 +264,10 @@
 		<constructor-arg type="de.ids_mannheim.korap.config.KustvaktConfiguration" 
 		ref="kustvakt_config" /> </bean> -->
 
-	<bean id="ldap_auth" class="de.ids_mannheim.korap.authentication.LdapAuth3">
-		<constructor-arg type="de.ids_mannheim.korap.config.KustvaktConfiguration"
+	<bean id="ldap_auth"
+		class="de.ids_mannheim.korap.authentication.LdapAuth3">
+		<constructor-arg
+			type="de.ids_mannheim.korap.config.KustvaktConfiguration"
 			ref="kustvakt_config" />
 	</bean>
 
@@ -245,32 +277,33 @@
 
 	<bean id="session_auth"
 		class="de.ids_mannheim.korap.authentication.SessionAuthentication">
-		<constructor-arg type="de.ids_mannheim.korap.config.KustvaktConfiguration"
+		<constructor-arg
+			type="de.ids_mannheim.korap.config.KustvaktConfiguration"
 			ref="kustvakt_config" />
-		<constructor-arg type="de.ids_mannheim.korap.interfaces.EncryptionIface"
+		<constructor-arg
+			type="de.ids_mannheim.korap.interfaces.EncryptionIface"
 			ref="kustvakt_encryption" />
 	</bean>
 
 	<bean id="oauth2_auth"
 		class="de.ids_mannheim.korap.authentication.OAuth2Authentication" />
-	
+
 	<util:list id="kustvakt_authproviders"
 		value-type="de.ids_mannheim.korap.interfaces.AuthenticationIface">
 		<ref bean="basic_auth" />
 		<ref bean="ldap_auth" />
-		<!-- 
-		<ref bean="session_auth" />
-		<ref bean="api_auth" />
-		 -->
+		<!-- <ref bean="session_auth" /> <ref bean="api_auth" /> -->
 		<ref bean="oauth2_auth" />
 	</util:list>
 
 
-	<bean id="userdata_details" class="de.ids_mannheim.korap.handlers.UserDetailsDao">
+	<bean id="userdata_details"
+		class="de.ids_mannheim.korap.handlers.UserDetailsDao">
 		<constructor-arg ref="kustvakt_db" />
 	</bean>
 
-	<bean id="userdata_settings" class="de.ids_mannheim.korap.handlers.UserSettingsDao">
+	<bean id="userdata_settings"
+		class="de.ids_mannheim.korap.handlers.UserSettingsDao">
 		<constructor-arg ref="kustvakt_db" />
 	</bean>
 
@@ -283,16 +316,18 @@
 	<!-- specify type for constructor argument -->
 	<bean id="authenticationManager"
 		class="de.ids_mannheim.korap.authentication.KustvaktAuthenticationManager">
-		<constructor-arg type="de.ids_mannheim.korap.interfaces.EntityHandlerIface"
+		<constructor-arg
+			type="de.ids_mannheim.korap.interfaces.EntityHandlerIface"
 			ref="kustvakt_userdb" />
-		<constructor-arg type="de.ids_mannheim.korap.interfaces.EncryptionIface"
+		<constructor-arg
+			type="de.ids_mannheim.korap.interfaces.EncryptionIface"
 			ref="kustvakt_encryption" />
 		<constructor-arg ref="kustvakt_config" />
 		<constructor-arg ref="kustvakt_userdata" />
 		<!-- inject authentication providers to use -->
 		<property name="providers" ref="kustvakt_authproviders" />
 	</bean>
-	
+
 	<!-- todo: if db interfaces not loaded via spring, does transaction even 
 		work then? -->
 	<!-- the transactional advice (i.e. what 'happens'; see the <aop:advisor/> 
@@ -301,7 +336,8 @@
 		<!-- the transactional semantics... -->
 		<tx:attributes>
 			<!-- all methods starting with 'get' are read-only -->
-			<tx:method name="get*" read-only="true" rollback-for="KorAPException" />
+			<tx:method name="get*" read-only="true"
+				rollback-for="KorAPException" />
 			<!-- other methods use the default transaction settings (see below) -->
 			<tx:method name="*" rollback-for="KorAPException" />
 		</tx:attributes>
@@ -323,11 +359,13 @@
 	</bean>
 
 	<!-- mail -->
-	<bean id="authenticator" class="de.ids_mannheim.korap.service.MailAuthenticator">
+	<bean id="authenticator"
+		class="de.ids_mannheim.korap.service.MailAuthenticator">
 		<constructor-arg index="0" value="${mail.username}" />
 		<constructor-arg index="1" value="${mail.password}" />
 	</bean>
-	<bean id="smtpSession" class="jakarta.mail.Session" factory-method="getInstance">
+	<bean id="smtpSession" class="jakarta.mail.Session"
+		factory-method="getInstance">
 		<constructor-arg index="0">
 			<props>
 				<prop key="mail.smtp.submitter">${mail.username}</prop>
@@ -340,12 +378,14 @@
 		</constructor-arg>
 		<constructor-arg index="1" ref="authenticator" />
 	</bean>
-	<bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
+	<bean id="mailSender"
+		class="org.springframework.mail.javamail.JavaMailSenderImpl">
 		<property name="username" value="${mail.username}" />
 		<property name="password" value="${mail.password}" />
 		<property name="session" ref="smtpSession" />
 	</bean>
-	<bean id="velocityEngine" class="org.apache.velocity.app.VelocityEngine">
+	<bean id="velocityEngine"
+		class="org.apache.velocity.app.VelocityEngine">
 		<constructor-arg index="0">
 			<props>
 				<prop key="resource.loader">class</prop>
diff --git a/full/src/main/resources/default-config.xml b/full/src/main/resources/default-config.xml
index 36925cb..073bf26 100644
--- a/full/src/main/resources/default-config.xml
+++ b/full/src/main/resources/default-config.xml
@@ -1,8 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xmlns:p="http://www.springframework.org/schema/p" xmlns:util="http://www.springframework.org/schema/util"
-	xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
-	xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context"
+	xmlns:p="http://www.springframework.org/schema/p"
+	xmlns:util="http://www.springframework.org/schema/util"
+	xmlns:aop="http://www.springframework.org/schema/aop"
+	xmlns:tx="http://www.springframework.org/schema/tx"
+	xmlns="http://www.springframework.org/schema/beans"
+	xmlns:context="http://www.springframework.org/schema/context"
 	xmlns:cache="http://www.springframework.org/schema/cache"
 	xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans.xsd
@@ -15,7 +18,8 @@
            http://www.springframework.org/schema/util
            http://www.springframework.org/schema/util/spring-util.xsd">
 
-	<context:component-scan base-package="de.ids_mannheim.korap" />
+	<context:component-scan
+		base-package="de.ids_mannheim.korap" />
 	<context:annotation-config />
 
 	<bean id="props"
@@ -46,18 +50,15 @@
 		</property>
 	</bean>
 
-	<!-- <bean id='cacheManager' class='org.springframework.cache.ehcache.EhCacheCacheManager'
-		p:cacheManager-ref='ehcache' />
-
-	<bean id='ehcache'
-		class='org.springframework.cache.ehcache.EhCacheManagerFactoryBean'
-		p:configLocation='classpath:ehcache.xml' p:shared='true' />
- -->
+	<!-- <bean id='cacheManager' class='org.springframework.cache.ehcache.EhCacheCacheManager' 
+		p:cacheManager-ref='ehcache' /> <bean id='ehcache' class='org.springframework.cache.ehcache.EhCacheManagerFactoryBean' 
+		p:configLocation='classpath:ehcache.xml' p:shared='true' /> -->
 	<!--class="org.apache.commons.dbcp2.BasicDataSource" -->
 	<!-- org.springframework.jdbc.datasource.SingleConnectionDataSource -->
-	<bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource"
-		lazy-init="true">
-		<property name="driverClassName" value="${jdbc.driverClassName}" />
+	<bean id="dataSource"
+		class="org.apache.commons.dbcp2.BasicDataSource" lazy-init="true">
+		<property name="driverClassName"
+			value="${jdbc.driverClassName}" />
 		<property name="url" value="${jdbc.url}" />
 		<property name="username" value="${jdbc.username}" />
 		<property name="password" value="${jdbc.password}" />
@@ -70,8 +71,9 @@
 		<property name="maxWaitMillis" value="-1" />
 		<!--<property name="poolPreparedStatements" value="true"/> -->
 	</bean>
-	
-	<bean id="c3p0DataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
+
+	<bean id="c3p0DataSource"
+		class="com.mchange.v2.c3p0.ComboPooledDataSource"
 		destroy-method="close" lazy-init="true">
 		<property name="driverClass" value="${jdbc.driverClassName}" />
 		<property name="jdbcUrl" value="${jdbc.url}" />
@@ -88,7 +90,8 @@
 	<bean id="sqliteDataSource"
 		class="org.springframework.jdbc.datasource.SingleConnectionDataSource"
 		lazy-init="true">
-		<property name="driverClassName" value="${jdbc.driverClassName}" />
+		<property name="driverClassName"
+			value="${jdbc.driverClassName}" />
 		<property name="url" value="${jdbc.url}" />
 		<property name="username" value="${jdbc.username}" />
 		<property name="password" value="${jdbc.password}" />
@@ -107,26 +110,29 @@
 	</bean>
 
 	<!-- to configure database for sqlite, mysql, etc. migrations -->
-	<bean id="flywayConfig" class="org.flywaydb.core.api.configuration.ClassicConfiguration">
+	<bean id="flywayConfig"
+		class="org.flywaydb.core.api.configuration.ClassicConfiguration">
 		<property name="baselineOnMigrate" value="true" />
 		<!-- <property name="validateOnMigrate" value="false" /> -->
 		<!-- <property name="cleanOnValidationError" value="true" /> -->
-		<property name="locations" value="#{'${jdbc.schemaPath}'.split(',')}"/>
+		<property name="locations"
+			value="#{'${jdbc.schemaPath}'.split(',')}" />
 		<property name="dataSource" ref="dataSource" />
 		<!-- <property name="dataSource" ref="sqliteDataSource" /> -->
 		<!-- <property name="dataSource" ref="c3p0DataSource" /> -->
 		<property name="outOfOrder" value="true" />
 	</bean>
-	
-	<bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate">
-		<constructor-arg ref="flywayConfig"/>
+
+	<bean id="flyway" class="org.flywaydb.core.Flyway"
+		init-method="migrate">
+		<constructor-arg ref="flywayConfig" />
 	</bean>
 
 	<bean id="entityManagerFactory"
 		class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
 		depends-on="flyway">
 		<property name="dataSource" ref="dataSource" />
-		<!--  <property name="dataSource" ref="sqliteDataSource" /> -->
+		<!-- <property name="dataSource" ref="sqliteDataSource" /> -->
 		<!-- <property name="dataSource" ref="c3p0DataSource" /> -->
 
 		<property name="packagesToScan">
@@ -139,7 +145,8 @@
 		<property name="jpaVendorAdapter">
 			<bean id="jpaVendorAdapter"
 				class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
-				<property name="databasePlatform" value="${hibernate.dialect}" />
+				<property name="databasePlatform"
+					value="${hibernate.dialect}" />
 			</bean>
 		</property>
 		<property name="jpaProperties">
@@ -160,8 +167,10 @@
 	<tx:annotation-driven proxy-target-class="true"
 		transaction-manager="transactionManager" />
 
-	<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
-		<property name="entityManagerFactory" ref="entityManagerFactory" />
+	<bean id="transactionManager"
+		class="org.springframework.orm.jpa.JpaTransactionManager">
+		<property name="entityManagerFactory"
+			ref="entityManagerFactory" />
 	</bean>
 
 	<bean id="transactionTemplate"
@@ -171,94 +180,103 @@
 
 	<!-- Data access objects -->
 	<bean id="adminDao" class="de.ids_mannheim.korap.dao.AdminDaoImpl" />
-	<bean id="authorizationDao" class="de.ids_mannheim.korap.oauth2.dao.CachedAuthorizationDaoImpl" />
+	<bean id="authorizationDao"
+		class="de.ids_mannheim.korap.oauth2.dao.CachedAuthorizationDaoImpl" />
 
 	<!-- Filters -->
-	<!-- <bean id="authenticationFilter" class="de.ids_mannheim.korap.web.filter.AuthenticationFilter" >
-		<property name="authenticationManager" ref="kustvakt_authenticationmanager"/>
-	</bean>
-	<bean id="piwikFilter" class="de.ids_mannheim.korap.web.filter.PiwikFilter" >
-		<property name="authenticationManager" ref="kustvakt_authenticationmanager"/>
-	</bean> -->
-	
+	<!-- <bean id="authenticationFilter" class="de.ids_mannheim.korap.web.filter.AuthenticationFilter" 
+		> <property name="authenticationManager" ref="kustvakt_authenticationmanager"/> 
+		</bean> <bean id="piwikFilter" class="de.ids_mannheim.korap.web.filter.PiwikFilter" 
+		> <property name="authenticationManager" ref="kustvakt_authenticationmanager"/> 
+		</bean> -->
+
 	<!-- Services -->
-	<bean id="scopeService" class="de.ids_mannheim.korap.oauth2.service.OAuth2ScopeServiceImpl" />
-	
+	<bean id="scopeService"
+		class="de.ids_mannheim.korap.oauth2.service.OAuth2ScopeServiceImpl" />
+
 	<!-- props are injected from default-config.xml -->
-	<bean id="kustvakt_config" class="de.ids_mannheim.korap.config.FullConfiguration">
+	<bean id="kustvakt_config"
+		class="de.ids_mannheim.korap.config.FullConfiguration">
 		<constructor-arg name="properties" ref="props" />
 	</bean>
 
-	<bean id="initializator" class="de.ids_mannheim.korap.init.Initializator"
-		init-method="init">
+	<bean id="initializator"
+		class="de.ids_mannheim.korap.init.Initializator" init-method="init">
 	</bean>
-	
+
 	<!-- Krill -->
-	<bean id="search_krill" class="de.ids_mannheim.korap.web.SearchKrill">
+	<bean id="search_krill"
+		class="de.ids_mannheim.korap.web.SearchKrill">
 		<constructor-arg value="${krill.indexDir}" />
 	</bean>
-	
+
 	<!-- Validator -->
-	<bean id="validator" class="de.ids_mannheim.korap.validator.ApacheValidator"/>
+	<bean id="validator"
+		class="de.ids_mannheim.korap.validator.ApacheValidator" />
 
 	<!-- URLValidator -->
-	<bean id="redirectURIValidator" class="org.apache.commons.validator.routines.UrlValidator">
+	<bean id="redirectURIValidator"
+		class="org.apache.commons.validator.routines.UrlValidator">
 		<constructor-arg value="http,https" index="0" />
-		<constructor-arg index="1" type="long" 
-		value="#{T(org.apache.commons.validator.routines.UrlValidator).ALLOW_LOCAL_URLS + 
-		T(org.apache.commons.validator.routines.UrlValidator).NO_FRAGMENTS}"/>
-		
-		<!-- <constructor-arg index="1" type="long">
-			<util:constant
-				static-field="org.apache.commons.validator.routines.UrlValidator.NO_FRAGMENTS" />
-		</constructor-arg> -->
+		<constructor-arg index="1" type="long"
+			value="#{T(org.apache.commons.validator.routines.UrlValidator).ALLOW_LOCAL_URLS + 
+		T(org.apache.commons.validator.routines.UrlValidator).NO_FRAGMENTS}" />
+
+		<!-- <constructor-arg index="1" type="long"> <util:constant static-field="org.apache.commons.validator.routines.UrlValidator.NO_FRAGMENTS" 
+			/> </constructor-arg> -->
 	</bean>
-	<bean id="urlValidator" class="org.apache.commons.validator.routines.UrlValidator">
+	<bean id="urlValidator"
+		class="org.apache.commons.validator.routines.UrlValidator">
 		<constructor-arg value="http,https" />
 	</bean>
-	
+
 	<!-- Rewrite -->
-	<bean id="foundryRewrite" class="de.ids_mannheim.korap.rewrite.FoundryRewrite"/>
-	<bean id="collectionRewrite" class="de.ids_mannheim.korap.rewrite.CollectionRewrite"/>
-	<bean id="virtualCorpusRewrite" class="de.ids_mannheim.korap.rewrite.VirtualCorpusRewrite"/>
- 	<bean id="queryReferenceRewrite" class="de.ids_mannheim.korap.rewrite.QueryReferenceRewrite"/>
-	
+	<bean id="foundryRewrite"
+		class="de.ids_mannheim.korap.rewrite.FoundryRewrite" />
+	<bean id="collectionRewrite"
+		class="de.ids_mannheim.korap.rewrite.CollectionRewrite" />
+	<bean id="virtualCorpusRewrite"
+		class="de.ids_mannheim.korap.rewrite.VirtualCorpusRewrite" />
+	<bean id="queryReferenceRewrite"
+		class="de.ids_mannheim.korap.rewrite.QueryReferenceRewrite" />
+
 	<util:list id="rewriteTasks"
 		value-type="de.ids_mannheim.korap.rewrite.RewriteTask">
 		<ref bean="foundryRewrite" />
 		<ref bean="collectionRewrite" />
 		<ref bean="virtualCorpusRewrite" />
-    <ref bean="queryReferenceRewrite" />
+		<ref bean="queryReferenceRewrite" />
 	</util:list>
-	
-	<bean id="rewriteHandler" class="de.ids_mannheim.korap.rewrite.RewriteHandler">
-		<constructor-arg ref="rewriteTasks"/>
+
+	<bean id="rewriteHandler"
+		class="de.ids_mannheim.korap.rewrite.RewriteHandler">
+		<constructor-arg ref="rewriteTasks" />
 	</bean>
 
-	<bean id="kustvaktResponseHandler" class="de.ids_mannheim.korap.web.KustvaktResponseHandler">
+	<bean id="kustvaktResponseHandler"
+		class="de.ids_mannheim.korap.web.KustvaktResponseHandler">
 	</bean>
 
 	<!-- OAuth -->
-	<bean id="oauth2ResponseHandler" class="de.ids_mannheim.korap.web.OAuth2ResponseHandler">
+	<bean id="oauth2ResponseHandler"
+		class="de.ids_mannheim.korap.web.OAuth2ResponseHandler">
 	</bean>
 
-	<bean name="kustvakt_encryption" class="de.ids_mannheim.korap.encryption.KustvaktEncryption">
+	<bean name="kustvakt_encryption"
+		class="de.ids_mannheim.korap.encryption.KustvaktEncryption">
 		<constructor-arg ref="kustvakt_config" />
 	</bean>
 
 	<!-- authentication providers to use -->
 
-	<!-- <bean id="session_auth"
-		class="de.ids_mannheim.korap.authentication.SessionAuthentication">
-		<constructor-arg type="de.ids_mannheim.korap.config.KustvaktConfiguration"
-			ref="kustvakt_config" />
-		<constructor-arg type="de.ids_mannheim.korap.interfaces.EncryptionIface"
-			ref="kustvakt_encryption" />
-	</bean> -->
+	<!-- <bean id="session_auth" class="de.ids_mannheim.korap.authentication.SessionAuthentication"> 
+		<constructor-arg type="de.ids_mannheim.korap.config.KustvaktConfiguration" 
+		ref="kustvakt_config" /> <constructor-arg type="de.ids_mannheim.korap.interfaces.EncryptionIface" 
+		ref="kustvakt_encryption" /> </bean> -->
 
 	<bean id="oauth2_auth"
 		class="de.ids_mannheim.korap.authentication.OAuth2Authentication" />
-	
+
 	<util:list id="kustvakt_authproviders"
 		value-type="de.ids_mannheim.korap.interfaces.AuthenticationIface">
 		<!-- <ref bean="session_auth" /> -->
@@ -269,13 +287,14 @@
 	<!-- specify type for constructor argument -->
 	<bean id="authenticationManager"
 		class="de.ids_mannheim.korap.authentication.KustvaktAuthenticationManager">
-		<constructor-arg type="de.ids_mannheim.korap.interfaces.EncryptionIface"
+		<constructor-arg
+			type="de.ids_mannheim.korap.interfaces.EncryptionIface"
 			ref="kustvakt_encryption" />
 		<constructor-arg ref="kustvakt_config" />
 		<!-- inject authentication providers to use -->
 		<property name="providers" ref="kustvakt_authproviders" />
 	</bean>
-	
+
 	<!-- todo: if db interfaces not loaded via spring, does transaction even 
 		work then? -->
 	<!-- the transactional advice (i.e. what 'happens'; see the <aop:advisor/> 
@@ -284,7 +303,8 @@
 		<!-- the transactional semantics... -->
 		<tx:attributes>
 			<!-- all methods starting with 'get' are read-only -->
-			<tx:method name="get*" read-only="true" rollback-for="KorAPException" />
+			<tx:method name="get*" read-only="true"
+				rollback-for="KorAPException" />
 			<!-- other methods use the default transaction settings (see below) -->
 			<tx:method name="*" rollback-for="KorAPException" />
 		</tx:attributes>
@@ -307,11 +327,13 @@
 	</bean>
 
 	<!-- mail -->
-	<bean id="authenticator" class="de.ids_mannheim.korap.service.MailAuthenticator">
+	<bean id="authenticator"
+		class="de.ids_mannheim.korap.service.MailAuthenticator">
 		<constructor-arg index="0" value="${mail.username}" />
 		<constructor-arg index="1" value="${mail.password}" />
 	</bean>
-	<bean id="smtpSession" class="jakarta.mail.Session" factory-method="getInstance">
+	<bean id="smtpSession" class="jakarta.mail.Session"
+		factory-method="getInstance">
 		<constructor-arg index="0">
 			<props>
 				<prop key="mail.smtp.submitter">${mail.username}</prop>
@@ -324,12 +346,14 @@
 		</constructor-arg>
 		<constructor-arg index="1" ref="authenticator" />
 	</bean>
-	<bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
+	<bean id="mailSender"
+		class="org.springframework.mail.javamail.JavaMailSenderImpl">
 		<property name="username" value="${mail.username}" />
 		<property name="password" value="${mail.password}" />
 		<property name="session" ref="smtpSession" />
 	</bean>
-	<bean id="velocityEngine" class="org.apache.velocity.app.VelocityEngine">
+	<bean id="velocityEngine"
+		class="org.apache.velocity.app.VelocityEngine">
 		<constructor-arg index="0">
 			<props>
 				<prop key="resource.loader">class</prop>
diff --git a/full/src/main/resources/default-lite-config.xml b/full/src/main/resources/default-lite-config.xml
index 8069c8e..da27995 100644
--- a/full/src/main/resources/default-lite-config.xml
+++ b/full/src/main/resources/default-lite-config.xml
@@ -1,7 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <beans xmlns="http://www.springframework.org/schema/beans"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
-	xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:util="http://www.springframework.org/schema/util"
+	xmlns:context="http://www.springframework.org/schema/context"
+	xmlns:tx="http://www.springframework.org/schema/tx"
 	xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans.xsd
            http://www.springframework.org/schema/tx
@@ -11,7 +13,8 @@
            http://www.springframework.org/schema/util
            http://www.springframework.org/schema/util/spring-util.xsd">
 
-	<context:component-scan base-package="
+	<context:component-scan
+		base-package="
 		de.ids_mannheim.korap.core.service,
 		de.ids_mannheim.korap.core.web,
 		de.ids_mannheim.korap.web.filter, 
@@ -44,8 +47,10 @@
 		</property>
 	</bean>
 
-	<bean id="config" class="de.ids_mannheim.korap.config.KustvaktConfiguration">
-		<constructor-arg index="0" name="properties" ref="properties" />
+	<bean id="config"
+		class="de.ids_mannheim.korap.config.KustvaktConfiguration">
+		<constructor-arg index="0" name="properties"
+			ref="properties" />
 	</bean>
 
 	<!-- Database -->
@@ -53,7 +58,8 @@
 	<bean id="sqliteDataSource"
 		class="org.springframework.jdbc.datasource.SingleConnectionDataSource"
 		lazy-init="true">
-		<property name="driverClassName" value="${jdbc.driverClassName}" />
+		<property name="driverClassName"
+			value="${jdbc.driverClassName}" />
 		<property name="url" value="${jdbc.url}" />
 		<property name="username" value="${jdbc.username}" />
 		<property name="password" value="${jdbc.password}" />
@@ -70,19 +76,22 @@
 		<!--<property name="initialSize" value="2"/> -->
 		<!--<property name="poolPreparedStatements" value="true"/> -->
 	</bean>
-	<bean id="flywayConfig" class="org.flywaydb.core.api.configuration.ClassicConfiguration">
+	<bean id="flywayConfig"
+		class="org.flywaydb.core.api.configuration.ClassicConfiguration">
 		<property name="baselineOnMigrate" value="true" />
 		<!-- <property name="validateOnMigrate" value="false" /> -->
 		<!-- <property name="cleanOnValidationError" value="true" /> -->
-		<property name="locations" value="#{'${jdbc.schemaPath}'.split(',')}"/>
+		<property name="locations"
+			value="#{'${jdbc.schemaPath}'.split(',')}" />
 		<property name="dataSource" ref="sqliteDataSource" />
 		<property name="outOfOrder" value="true" />
 	</bean>
-	
-	<bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate">
-	    <constructor-arg ref="flywayConfig"/>
+
+	<bean id="flyway" class="org.flywaydb.core.Flyway"
+		init-method="migrate">
+		<constructor-arg ref="flywayConfig" />
 	</bean>
-	
+
 
 	<bean id="entityManagerFactory"
 		class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
@@ -96,7 +105,8 @@
 		<property name="jpaVendorAdapter">
 			<bean id="jpaVendorAdapter"
 				class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
-				<property name="databasePlatform" value="${hibernate.dialect}" />
+				<property name="databasePlatform"
+					value="${hibernate.dialect}" />
 			</bean>
 		</property>
 		<property name="jpaProperties">
@@ -116,8 +126,10 @@
 	<tx:annotation-driven proxy-target-class="true"
 		transaction-manager="transactionManager" />
 
-	<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
-		<property name="entityManagerFactory" ref="entityManagerFactory" />
+	<bean id="transactionManager"
+		class="org.springframework.orm.jpa.JpaTransactionManager">
+		<property name="entityManagerFactory"
+			ref="entityManagerFactory" />
 	</bean>
 
 	<bean id="transactionTemplate"
@@ -130,18 +142,17 @@
 	</bean>
 
 	<!-- Initialization -->
-	<!--
-	<bean id="annotationParser" class="de.ids_mannheim.korap.annotation.AnnotationParser"
-		scope="singleton" />
-	-->
+	<!-- <bean id="annotationParser" class="de.ids_mannheim.korap.annotation.AnnotationParser" 
+		scope="singleton" /> -->
 	<!-- Search Engine -->
-	<bean id="search_krill" class="de.ids_mannheim.korap.web.SearchKrill">
+	<bean id="search_krill"
+		class="de.ids_mannheim.korap.web.SearchKrill">
 		<constructor-arg value="${krill.indexDir}" />
 	</bean>
-	
+
 
 	<!-- Filters -->
-	<!-- <bean id="APIVersionFilter" class="de.ids_mannheim.korap.web.APIVersionFilter"
+	<!-- <bean id="APIVersionFilter" class="de.ids_mannheim.korap.web.APIVersionFilter" 
 		scope="singleton" /> -->
 
 	<!-- Authentication -->
@@ -149,37 +160,42 @@
 		class="de.ids_mannheim.korap.authentication.DummyAuthenticationManager" />
 
 	<!-- Response handler -->
-	<bean id="kustvaktResponseHandler" class="de.ids_mannheim.korap.web.KustvaktResponseHandler">
+	<bean id="kustvaktResponseHandler"
+		class="de.ids_mannheim.korap.web.KustvaktResponseHandler">
 	</bean>
 
 	<!-- Controllers -->
-	<!-- added via component-scan
-	<bean id="annotationController"
-		class="de.ids_mannheim.korap.web.controller.AnnotationController" />
-	<bean id="searchController" class="de.ids_mannheim.korap.web.controller.SearchController" />
-	<bean id="statisticController"
-		class="de.ids_mannheim.korap.web.controller.StatisticController" />
- 	-->
+	<!-- added via component-scan <bean id="annotationController" class="de.ids_mannheim.korap.web.controller.AnnotationController" 
+		/> <bean id="searchController" class="de.ids_mannheim.korap.web.controller.SearchController" 
+		/> <bean id="statisticController" class="de.ids_mannheim.korap.web.controller.StatisticController" 
+		/> -->
 	<!-- Services -->
 	<bean id="scopeService"
 		class="de.ids_mannheim.korap.oauth2.service.DummyOAuth2ScopeServiceImpl" />
 
 	<!-- DAO -->
-	<bean id="adminDao" class="de.ids_mannheim.korap.dao.DummyAdminDaoImpl" />
-	<bean id="annotationDao" class="de.ids_mannheim.korap.dao.AnnotationDao" />
+	<bean id="adminDao"
+		class="de.ids_mannheim.korap.dao.DummyAdminDaoImpl" />
+	<bean id="annotationDao"
+		class="de.ids_mannheim.korap.dao.AnnotationDao" />
 
 	<!-- DTO Converter -->
-	<bean id="annotationConverter" class="de.ids_mannheim.korap.dto.converter.AnnotationConverter" />
+	<bean id="annotationConverter"
+		class="de.ids_mannheim.korap.dto.converter.AnnotationConverter" />
 
 	<!-- Rewrite -->
-	<bean id="layerMapper" class="de.ids_mannheim.korap.rewrite.LayerMapper" />
-	<bean id="foundryInject" class="de.ids_mannheim.korap.rewrite.FoundryInject" />
+	<bean id="layerMapper"
+		class="de.ids_mannheim.korap.rewrite.LayerMapper" />
+	<bean id="foundryInject"
+		class="de.ids_mannheim.korap.rewrite.FoundryInject" />
 
-	<util:list id="rewriteTasks" value-type="de.ids_mannheim.korap.rewrite.RewriteTask">
+	<util:list id="rewriteTasks"
+		value-type="de.ids_mannheim.korap.rewrite.RewriteTask">
 		<ref bean="foundryInject" />
 	</util:list>
-	
-	<bean id="rewriteHandler" class="de.ids_mannheim.korap.rewrite.RewriteHandler">
+
+	<bean id="rewriteHandler"
+		class="de.ids_mannheim.korap.rewrite.RewriteHandler">
 		<constructor-arg ref="rewriteTasks" />
 	</bean>
 </beans>
\ No newline at end of file
diff --git a/full/src/main/resources/ehcache.xml b/full/src/main/resources/ehcache.xml
index 22f2f55..077e260 100644
--- a/full/src/main/resources/ehcache.xml
+++ b/full/src/main/resources/ehcache.xml
@@ -1,43 +1,29 @@
-<ehcache xsi:noNamespaceSchemaLocation="http://www.ehcache.org/ehcache.xsd"
+<ehcache
+	xsi:noNamespaceSchemaLocation="http://www.ehcache.org/ehcache.xsd"
 	updateCheck="true" monitoring="autodetect" dynamicConfig="true">
-	
-    <defaultCache eternal='true' overflowToDisk='false'/>
-    <!--maxBytesLocalHeap="200M"-->
-    <diskStore path="./cache_store"/>
-    
-           
-    <!-- EM --> 
-    <cache name='authorization'
-           timeToLiveSeconds="1000"
-           eternal='false'
-           memoryStoreEvictionPolicy="LRU"
-           maxEntriesLocalHeap="100"
-           overflowToDisk='false'/>
-           
-    <cache name='access_token'
-           timeToIdleSeconds="3600"
-           timeToLiveSeconds="15000"
-           eternal='false'
-           memoryStoreEvictionPolicy="LRU"
-           maxEntriesLocalHeap="500"
-           overflowToDisk='false'/>  
-           
-    <!-- <cache name="named_vc" 
-		eternal="true" 
-		memoryStoreEvictionPolicy="LRU"
-		maxBytesLocalHeap="256M" 
-		maxBytesLocalDisk="2G"
-		diskExpiryThreadIntervalSeconds = "120" > 
-		<persistence strategy="localTempSwap"/>
-		<sizeOfPolicy maxDepth="3000" maxDepthExceededBehavior="abort" />
-	-->     
-	
-	<cache name="total_results"
-    	timeToIdleSeconds="3600"
-        timeToLiveSeconds="15000"
-        eternal='false'
-        memoryStoreEvictionPolicy="LRU"
-        overflowToDisk='false'
-         maxEntriesLocalHeap="500"
-	/>
+
+	<defaultCache eternal='true' overflowToDisk='false' />
+	<!--maxBytesLocalHeap="200M" -->
+	<diskStore path="./cache_store" />
+
+
+	<!-- EM -->
+	<cache name='authorization' timeToLiveSeconds="1000"
+		eternal='false' memoryStoreEvictionPolicy="LRU"
+		maxEntriesLocalHeap="100" overflowToDisk='false' />
+
+	<cache name='access_token' timeToIdleSeconds="3600"
+		timeToLiveSeconds="15000" eternal='false'
+		memoryStoreEvictionPolicy="LRU" maxEntriesLocalHeap="500"
+		overflowToDisk='false' />
+
+	<!-- <cache name="named_vc" eternal="true" memoryStoreEvictionPolicy="LRU" 
+		maxBytesLocalHeap="256M" maxBytesLocalDisk="2G" diskExpiryThreadIntervalSeconds 
+		= "120" > <persistence strategy="localTempSwap"/> <sizeOfPolicy maxDepth="3000" 
+		maxDepthExceededBehavior="abort" /> -->
+
+	<cache name="total_results" timeToIdleSeconds="3600"
+		timeToLiveSeconds="15000" eternal='false'
+		memoryStoreEvictionPolicy="LRU" overflowToDisk='false'
+		maxEntriesLocalHeap="500" />
 </ehcache>
diff --git a/full/src/test/java/de/ids_mannheim/korap/authentication/APIAuthenticationTest.java b/full/src/test/java/de/ids_mannheim/korap/authentication/APIAuthenticationTest.java
index 3c8f808..eeb3ea6 100644
--- a/full/src/test/java/de/ids_mannheim/korap/authentication/APIAuthenticationTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/authentication/APIAuthenticationTest.java
@@ -34,9 +34,13 @@
     private FullConfiguration config;
 
     @Test
-    public void testDeprecatedService() throws KustvaktException {
-        String userAuthHeader = HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("dory", "password");
-        Response response = target().path(API_VERSION).path("auth").path("apiToken").request().header(Attributes.AUTHORIZATION, userAuthHeader).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
+    public void testDeprecatedService () throws KustvaktException {
+        String userAuthHeader = HttpAuthorizationHandler
+                .createBasicAuthorizationHeaderValue("dory", "password");
+        Response response = target().path(API_VERSION).path("auth")
+                .path("apiToken").request()
+                .header(Attributes.AUTHORIZATION, userAuthHeader)
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -44,7 +48,8 @@
     }
 
     @Test
-    public void testCreateGetTokenContext() throws KustvaktException, IOException, InterruptedException, JOSEException {
+    public void testCreateGetTokenContext () throws KustvaktException,
+            IOException, InterruptedException, JOSEException {
         User user = new KorAPUser();
         user.setUsername("testUser");
         Map<String, Object> attr = new HashMap<>();
diff --git a/full/src/test/java/de/ids_mannheim/korap/authentication/AuthenticationFilterTest.java b/full/src/test/java/de/ids_mannheim/korap/authentication/AuthenticationFilterTest.java
index 892219b..9e6f120 100644
--- a/full/src/test/java/de/ids_mannheim/korap/authentication/AuthenticationFilterTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/authentication/AuthenticationFilterTest.java
@@ -14,12 +14,16 @@
 public class AuthenticationFilterTest extends SpringJerseyTest {
 
     @Test
-    public void testAuthenticationWithUnknownScheme() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=die]").queryParam("ql", "poliqarp").request().header(Attributes.AUTHORIZATION, "Blah blah").get();
+    public void testAuthenticationWithUnknownScheme ()
+            throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=die]").queryParam("ql", "poliqarp")
+                .request().header(Attributes.AUTHORIZATION, "Blah blah").get();
         String entity = response.readEntity(String.class);
         JsonNode n = JsonUtils.readTree(entity);
         assertEquals(n.at("/errors/0/0").asText(), "2001");
-        assertEquals(n.at("/errors/0/1").asText(), "Authentication scheme is not supported.");
+        assertEquals(n.at("/errors/0/1").asText(),
+                "Authentication scheme is not supported.");
         assertEquals(n.at("/errors/0/2").asText(), "Blah");
     }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/authentication/LdapAuth3Test.java b/full/src/test/java/de/ids_mannheim/korap/authentication/LdapAuth3Test.java
index f7c8a86..0580bba 100644
--- a/full/src/test/java/de/ids_mannheim/korap/authentication/LdapAuth3Test.java
+++ b/full/src/test/java/de/ids_mannheim/korap/authentication/LdapAuth3Test.java
@@ -19,7 +19,6 @@
 import static de.ids_mannheim.korap.authentication.LdapAuth3.*;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 
-
 public class LdapAuth3Test {
 
     public static final String TEST_LDAP_CONF = "src/test/resources/test-ldap.conf";
@@ -35,11 +34,17 @@
     static InMemoryDirectoryServer server;
 
     @BeforeAll
-    static void startDirectoryServer() throws LDAPException, GeneralSecurityException {
-        InMemoryDirectoryServerConfig config = new InMemoryDirectoryServerConfig("dc=example,dc=com");
-        config.addAdditionalBindCredentials("cn=admin,dc=example,dc=com", "adminpassword");
+    static void startDirectoryServer ()
+            throws LDAPException, GeneralSecurityException {
+        InMemoryDirectoryServerConfig config = new InMemoryDirectoryServerConfig(
+                "dc=example,dc=com");
+        config.addAdditionalBindCredentials("cn=admin,dc=example,dc=com",
+                "adminpassword");
         config.setSchema(null);
-        final SSLUtil serverSSLUtil = new SSLUtil(new KeyStoreKeyManager(keyStorePath, "password".toCharArray(), "PKCS12", "server-cert"), new TrustStoreTrustManager(keyStorePath));
+        final SSLUtil serverSSLUtil = new SSLUtil(
+                new KeyStoreKeyManager(keyStorePath, "password".toCharArray(),
+                        "PKCS12", "server-cert"),
+                new TrustStoreTrustManager(keyStorePath));
         final SSLUtil clientSslUtil = new SSLUtil(new TrustAllTrustManager());
         config.setListenerConfigs(// Listener name
                 InMemoryListenerConfig.createLDAPConfig(// Listener name
@@ -50,7 +55,8 @@
                 InMemoryListenerConfig.createLDAPSConfig(// Listener name
                         "LDAPS", // Listen address. (null = listen on all interfaces)
                         null, // Listen port (0 = automatically choose an available port)
-                        3269, serverSSLUtil.createSSLServerSocketFactory(), clientSslUtil.createSSLSocketFactory()));
+                        3269, serverSSLUtil.createSSLServerSocketFactory(),
+                        clientSslUtil.createSSLSocketFactory()));
         server = new InMemoryDirectoryServer(config);
         String configPath = TEST_LDAP_USERS_LDIF;
         server.importFromLDIF(true, configPath);
@@ -58,130 +64,167 @@
     }
 
     @AfterAll
-    static void shutDownDirectoryServer() {
+    static void shutDownDirectoryServer () {
         server.shutDown(true);
     }
 
     @Test
-    public void loginWithExtraProfileNameWorks() throws LDAPException {
-        assertEquals(LDAP_AUTH_ROK, LdapAuth3.login("testuser123", "password", TEST_LDAP_CONF));
+    public void loginWithExtraProfileNameWorks () throws LDAPException {
+        assertEquals(LDAP_AUTH_ROK,
+                LdapAuth3.login("testuser123", "password", TEST_LDAP_CONF));
     }
 
     @Test
-    public void loginWithUidWorks() throws LDAPException {
-        assertEquals(LDAP_AUTH_ROK, LdapAuth3.login("testuser", "password", TEST_LDAP_CONF));
+    public void loginWithUidWorks () throws LDAPException {
+        assertEquals(LDAP_AUTH_ROK,
+                LdapAuth3.login("testuser", "password", TEST_LDAP_CONF));
     }
 
     @Test
-    public void loginWithUidAndBase64PasswordWorks() throws LDAPException {
+    public void loginWithUidAndBase64PasswordWorks () throws LDAPException {
         final byte[] passwordBytes = StaticUtils.getBytes("password");
         String pw = Base64.encode(passwordBytes);
-        assertEquals(LDAP_AUTH_ROK, LdapAuth3.login("testuser", pw, TEST_LDAP_CONF));
+        assertEquals(LDAP_AUTH_ROK,
+                LdapAuth3.login("testuser", pw, TEST_LDAP_CONF));
     }
 
     @Test
-    public void loginWithEmailWorks() throws LDAPException {
+    public void loginWithEmailWorks () throws LDAPException {
         final byte[] passwordBytes = StaticUtils.getBytes("password");
         String pw = Base64.encode(passwordBytes);
-        assertEquals(LDAP_AUTH_ROK, LdapAuth3.login("testuser@example.com", pw, TEST_LDAP_CONF));
+        assertEquals(LDAP_AUTH_ROK,
+                LdapAuth3.login("testuser@example.com", pw, TEST_LDAP_CONF));
     }
 
     @Test
-    public void allLoginPasswordCombinationsWork() throws LDAPException {
-        assertEquals(LDAP_AUTH_ROK, LdapAuth3.login("uid", "userPassword", TEST_LDAP_CONF));
-        assertEquals(LDAP_AUTH_ROK, LdapAuth3.login("uid", "extraPassword", TEST_LDAP_CONF));
-        assertEquals(LDAP_AUTH_ROK, LdapAuth3.login("mail@example.org", "userPassword", TEST_LDAP_CONF));
-        assertEquals(LDAP_AUTH_ROK, LdapAuth3.login("mail@example.org", "extraPassword", TEST_LDAP_CONF));
-        assertEquals(LDAP_AUTH_ROK, LdapAuth3.login("extraProfile", "userPassword", TEST_LDAP_CONF));
-        assertEquals(LDAP_AUTH_ROK, LdapAuth3.login("extraProfile", "extraPassword", TEST_LDAP_CONF));
+    public void allLoginPasswordCombinationsWork () throws LDAPException {
+        assertEquals(LDAP_AUTH_ROK,
+                LdapAuth3.login("uid", "userPassword", TEST_LDAP_CONF));
+        assertEquals(LDAP_AUTH_ROK,
+                LdapAuth3.login("uid", "extraPassword", TEST_LDAP_CONF));
+        assertEquals(LDAP_AUTH_ROK, LdapAuth3.login("mail@example.org",
+                "userPassword", TEST_LDAP_CONF));
+        assertEquals(LDAP_AUTH_ROK, LdapAuth3.login("mail@example.org",
+                "extraPassword", TEST_LDAP_CONF));
+        assertEquals(LDAP_AUTH_ROK, LdapAuth3.login("extraProfile",
+                "userPassword", TEST_LDAP_CONF));
+        assertEquals(LDAP_AUTH_ROK, LdapAuth3.login("extraProfile",
+                "extraPassword", TEST_LDAP_CONF));
     }
 
     @Test
-    public void loginWithWrongEmailFails() throws LDAPException {
-        assertEquals(LDAP_AUTH_RUNKNOWN, LdapAuth3.login("notestuser@example.com", "topsecret", TEST_LDAP_CONF));
+    public void loginWithWrongEmailFails () throws LDAPException {
+        assertEquals(LDAP_AUTH_RUNKNOWN, LdapAuth3
+                .login("notestuser@example.com", "topsecret", TEST_LDAP_CONF));
     }
 
     @Test
-    public void loginWithEmailAndWrongPasswordFails() throws LDAPException {
-        assertEquals(LDAP_AUTH_RUNKNOWN, LdapAuth3.login("testuser@example.com", "wrongpw", TEST_LDAP_CONF));
+    public void loginWithEmailAndWrongPasswordFails () throws LDAPException {
+        assertEquals(LDAP_AUTH_RUNKNOWN, LdapAuth3.login("testuser@example.com",
+                "wrongpw", TEST_LDAP_CONF));
     }
 
     @Test
-    public void loginWithUsernameAndWrongPasswordFails() throws LDAPException {
-        assertEquals(LDAP_AUTH_RUNKNOWN, LdapAuth3.login("testuser", "wrongpw", TEST_LDAP_CONF));
+    public void loginWithUsernameAndWrongPasswordFails () throws LDAPException {
+        assertEquals(LDAP_AUTH_RUNKNOWN,
+                LdapAuth3.login("testuser", "wrongpw", TEST_LDAP_CONF));
     }
 
     @Test
-    public void loginOfNotRegisteredUserFails() throws LDAPException {
-        assertEquals(LDAP_AUTH_RNOTREG, LdapAuth3.login("not_registered_user", "topsecret", TEST_LDAP_CONF));
+    public void loginOfNotRegisteredUserFails () throws LDAPException {
+        assertEquals(LDAP_AUTH_RNOTREG, LdapAuth3.login("not_registered_user",
+                "topsecret", TEST_LDAP_CONF));
     }
 
     @Test
-    public void blockedUserIsRefused() throws LDAPException {
-        assertEquals(LDAP_AUTH_RLOCKED, LdapAuth3.login("nameOfBlockedUser", "topsecret", TEST_LDAP_CONF));
+    public void blockedUserIsRefused () throws LDAPException {
+        assertEquals(LDAP_AUTH_RLOCKED, LdapAuth3.login("nameOfBlockedUser",
+                "topsecret", TEST_LDAP_CONF));
     }
 
     @Test
-    public void loginWithUsernameOverSSLWorks() throws LDAPException {
-        assertEquals(LDAP_AUTH_ROK, LdapAuth3.login("testuser", "password", TEST_LDAPS_CONF));
+    public void loginWithUsernameOverSSLWorks () throws LDAPException {
+        assertEquals(LDAP_AUTH_ROK,
+                LdapAuth3.login("testuser", "password", TEST_LDAPS_CONF));
     }
 
     @Test
-    public void loginOnTrustedServerWorks() throws LDAPException {
-        assertEquals(LDAP_AUTH_ROK, LdapAuth3.login("testuser", "password", TEST_LDAPS_TS_CONF));
+    public void loginOnTrustedServerWorks () throws LDAPException {
+        assertEquals(LDAP_AUTH_ROK,
+                LdapAuth3.login("testuser", "password", TEST_LDAPS_TS_CONF));
     }
 
     @Test
-    public void loginOnTrustedServerWithWrongPassswordFails() throws LDAPException {
-        assertEquals(LDAP_AUTH_RUNKNOWN, LdapAuth3.login("testuser", "topsecrets", TEST_LDAPS_TS_CONF));
+    public void loginOnTrustedServerWithWrongPassswordFails ()
+            throws LDAPException {
+        assertEquals(LDAP_AUTH_RUNKNOWN,
+                LdapAuth3.login("testuser", "topsecrets", TEST_LDAPS_TS_CONF));
     }
 
     @Test
-    public void passwordWithAsteriskWorks() throws LDAPException {
-        assertEquals(LDAP_AUTH_ROK, LdapAuth3.login("test", "top*ecret", TEST_LDAPS_CONF));
+    public void passwordWithAsteriskWorks () throws LDAPException {
+        assertEquals(LDAP_AUTH_ROK,
+                LdapAuth3.login("test", "top*ecret", TEST_LDAPS_CONF));
     }
 
     @Test
-    public void passwordWithGlobOperatorFails() throws LDAPException {
-        assertEquals(LDAP_AUTH_RUNKNOWN, LdapAuth3.login("testuser", "passw*", TEST_LDAPS_TS_CONF));
-        assertEquals(LDAP_AUTH_ROK, LdapAuth3.login("testuser", "password", TEST_LDAPS_TS_CONF));
+    public void passwordWithGlobOperatorFails () throws LDAPException {
+        assertEquals(LDAP_AUTH_RUNKNOWN,
+                LdapAuth3.login("testuser", "passw*", TEST_LDAPS_TS_CONF));
+        assertEquals(LDAP_AUTH_ROK,
+                LdapAuth3.login("testuser", "password", TEST_LDAPS_TS_CONF));
     }
 
     @Test
-    public void passwordWithExistenceOperatorFails() throws LDAPException {
-        assertEquals(LDAP_AUTH_RUNKNOWN, LdapAuth3.login("testuser", "*", TEST_LDAPS_TS_CONF));
-        assertEquals(LDAP_AUTH_ROK, LdapAuth3.login("testuser", "password", TEST_LDAPS_TS_CONF));
+    public void passwordWithExistenceOperatorFails () throws LDAPException {
+        assertEquals(LDAP_AUTH_RUNKNOWN,
+                LdapAuth3.login("testuser", "*", TEST_LDAPS_TS_CONF));
+        assertEquals(LDAP_AUTH_ROK,
+                LdapAuth3.login("testuser", "password", TEST_LDAPS_TS_CONF));
     }
 
     @Test
-    public void gettingMailAttributeForUid() throws LDAPException {
-        assertEquals(LdapAuth3.getEmail("testuser", TEST_LDAP_CONF), "testuser@example.com");
-        assertEquals(LdapAuth3.getEmail("testuser2", TEST_LDAPS_CONF), "peter@example.org");
+    public void gettingMailAttributeForUid () throws LDAPException {
+        assertEquals(LdapAuth3.getEmail("testuser", TEST_LDAP_CONF),
+                "testuser@example.com");
+        assertEquals(LdapAuth3.getEmail("testuser2", TEST_LDAPS_CONF),
+                "peter@example.org");
         assertEquals(null, LdapAuth3.getEmail("non-exsting", TEST_LDAPS_CONF));
     }
 
     @Test
-    public void gettingUsernameForEmail() throws LDAPException {
-        assertEquals(LdapAuth3.getUsername("testuser@example.com", TEST_LDAP_CONF), "idsTestUser");
-        assertEquals(LdapAuth3.getUsername("peter@example.org", TEST_LDAPS_CONF), "testuser2");
-        assertEquals(null, LdapAuth3.getUsername("non-exsting", TEST_LDAPS_CONF));
-        assertEquals(LdapAuth3.getUsername("testUser2", TEST_LDAPS_CONF), "testuser2");
+    public void gettingUsernameForEmail () throws LDAPException {
+        assertEquals(
+                LdapAuth3.getUsername("testuser@example.com", TEST_LDAP_CONF),
+                "idsTestUser");
+        assertEquals(
+                LdapAuth3.getUsername("peter@example.org", TEST_LDAPS_CONF),
+                "testuser2");
+        assertEquals(null,
+                LdapAuth3.getUsername("non-exsting", TEST_LDAPS_CONF));
+        assertEquals(LdapAuth3.getUsername("testUser2", TEST_LDAPS_CONF),
+                "testuser2");
         // login with uid, get idsC2Profile username
-        assertEquals(LdapAuth3.getUsername("testUser", TEST_LDAPS_CONF), "idsTestUser");
+        assertEquals(LdapAuth3.getUsername("testUser", TEST_LDAPS_CONF),
+                "idsTestUser");
     }
 
     @Test
-    public void gettingMailAttributeForNotRegisteredUserWorks() throws LDAPException {
-        assertEquals(LdapAuth3.getEmail("not_registered_user", TEST_LDAP_CONF), "not_registered_user@example.com");
+    public void gettingMailAttributeForNotRegisteredUserWorks ()
+            throws LDAPException {
+        assertEquals(LdapAuth3.getEmail("not_registered_user", TEST_LDAP_CONF),
+                "not_registered_user@example.com");
     }
 
     @Test
-    public void gettingMailAttributeForBlockedUserWorks() throws LDAPException {
-        assertEquals(LdapAuth3.getEmail("nameOfBlockedUser", TEST_LDAP_CONF), "nameOfBlockedUser@example.com");
+    public void gettingMailAttributeForBlockedUserWorks ()
+            throws LDAPException {
+        assertEquals(LdapAuth3.getEmail("nameOfBlockedUser", TEST_LDAP_CONF),
+                "nameOfBlockedUser@example.com");
     }
 
     @Test
-    public void canLoadLdapConfig() {
+    public void canLoadLdapConfig () {
         LDAPConfig ldapConfig = new LDAPConfig(TEST_LDAPS_CONF);
         assertEquals(3269, ldapConfig.port);
         assertEquals(ldapConfig.host, "localhost");
diff --git a/full/src/test/java/de/ids_mannheim/korap/authentication/LdapOAuth2Test.java b/full/src/test/java/de/ids_mannheim/korap/authentication/LdapOAuth2Test.java
index fd59d79..c45cc37 100644
--- a/full/src/test/java/de/ids_mannheim/korap/authentication/LdapOAuth2Test.java
+++ b/full/src/test/java/de/ids_mannheim/korap/authentication/LdapOAuth2Test.java
@@ -56,38 +56,43 @@
     private String redirectUri = "https://client.com/redirect";
 
     @BeforeAll
-    static void startTestLDAPServer() throws LDAPException, GeneralSecurityException {
+    static void startTestLDAPServer ()
+            throws LDAPException, GeneralSecurityException {
         LdapAuth3Test.startDirectoryServer();
     }
 
     @AfterAll
-    static void stopTestLDAPServer() {
+    static void stopTestLDAPServer () {
         LdapAuth3Test.shutDownDirectoryServer();
     }
 
     @BeforeEach
-    public void setLDAPAuthentication() {
+    public void setLDAPAuthentication () {
         config.setOAuth2passwordAuthentication(AuthenticationMethod.LDAP);
     }
 
     @AfterEach
-    public void resetAuthenticationMethod() {
+    public void resetAuthenticationMethod () {
         config.setOAuth2passwordAuthentication(AuthenticationMethod.TEST);
     }
 
     @Test
-    public void testRequestTokenPasswordUnknownUser() throws KustvaktException {
-        Response response = requestTokenWithPassword(superClientId, clientSecret, "unknown", "password");
+    public void testRequestTokenPasswordUnknownUser ()
+            throws KustvaktException {
+        Response response = requestTokenWithPassword(superClientId,
+                clientSecret, "unknown", "password");
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(2023, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "LDAP Authentication failed due to unknown user or password!");
+        assertEquals(node.at("/errors/0/1").asText(),
+                "LDAP Authentication failed due to unknown user or password!");
     }
 
     @Test
-    public void testMapEmailToUsername() throws KustvaktException {
-        Response response = requestTokenWithPassword(superClientId, clientSecret, testUserEmail, "password");
+    public void testMapEmailToUsername () throws KustvaktException {
+        Response response = requestTokenWithPassword(superClientId,
+                clientSecret, testUserEmail, "password");
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String accessToken = node.at("/access_token").asText();
@@ -102,29 +107,39 @@
         String clientSecret = node.at("/client_secret").asText();
         testRequestTokenWithAuthorization(clientId, clientSecret, accessToken);
     }
-    
+
     private void testRegisterPublicClient (String accessToken)
             throws KustvaktException {
         OAuth2ClientJson json = new OAuth2ClientJson();
         json.setName("LDAP test client");
         json.setType(OAuth2ClientType.PUBLIC);
-        json.setDescription("Test registering a public client with LDAP authentication");
-        Response response = target().path(API_VERSION).path("oauth2").path("client").path("register").request().header(Attributes.AUTHORIZATION, "Bearer " + accessToken).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).post(Entity.json(json));
+        json.setDescription(
+                "Test registering a public client with LDAP authentication");
+        Response response = target().path(API_VERSION).path("oauth2")
+                .path("client").path("register").request()
+                .header(Attributes.AUTHORIZATION, "Bearer " + accessToken)
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .post(Entity.json(json));
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String clientId = node.at("/client_id").asText();
         OAuth2Client client = clientDao.retrieveClientById(clientId);
         assertEquals(testUsername, client.getRegisteredBy());
     }
-    
+
     private JsonNode testRegisterConfidentialClient (String accessToken)
             throws KustvaktException {
         OAuth2ClientJson json = new OAuth2ClientJson();
         json.setName("LDAP test client");
         json.setType(OAuth2ClientType.CONFIDENTIAL);
         json.setRedirectURI(redirectUri);
-        json.setDescription("Test registering a confidential client with LDAP authentication");
-        Response response = target().path(API_VERSION).path("oauth2").path("client").path("register").request().header(Attributes.AUTHORIZATION, "Bearer " + accessToken).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).post(Entity.json(json));
+        json.setDescription(
+                "Test registering a confidential client with LDAP authentication");
+        Response response = target().path(API_VERSION).path("oauth2")
+                .path("client").path("register").request()
+                .header(Attributes.AUTHORIZATION, "Bearer " + accessToken)
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .post(Entity.json(json));
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String clientId = node.at("/client_id").asText();
@@ -133,14 +148,23 @@
         return node;
     }
 
-    private void testRequestTokenWithAuthorization(String clientId, String clientSecret, String accessToken) throws KustvaktException {
+    private void testRequestTokenWithAuthorization (String clientId,
+            String clientSecret, String accessToken) throws KustvaktException {
         String authHeader = "Bearer " + accessToken;
-        Response response = target().path(API_VERSION).path("oauth2").path("authorize").queryParam("response_type", "code").queryParam("client_id", clientId).queryParam("client_secret", clientSecret).queryParam("scope", "search match_info").request().header(Attributes.AUTHORIZATION, authHeader).get();
-        assertEquals(Status.TEMPORARY_REDIRECT.getStatusCode(), response.getStatus());
+        Response response = target().path(API_VERSION).path("oauth2")
+                .path("authorize").queryParam("response_type", "code")
+                .queryParam("client_id", clientId)
+                .queryParam("client_secret", clientSecret)
+                .queryParam("scope", "search match_info").request()
+                .header(Attributes.AUTHORIZATION, authHeader).get();
+        assertEquals(Status.TEMPORARY_REDIRECT.getStatusCode(),
+                response.getStatus());
         URI redirectUri = response.getLocation();
-        MultiValueMap<String, String> params = UriComponentsBuilder.fromUri(redirectUri).build().getQueryParams();
+        MultiValueMap<String, String> params = UriComponentsBuilder
+                .fromUri(redirectUri).build().getQueryParams();
         String code = params.getFirst("code");
-        response = requestTokenWithAuthorizationCodeAndForm(clientId, clientSecret, code);
+        response = requestTokenWithAuthorizationCodeAndForm(clientId,
+                clientSecret, code);
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
         String at = node.at("/access_token").asText();
         AccessToken accessTokenObj = accessDao.retrieveAccessToken(at);
diff --git a/full/src/test/java/de/ids_mannheim/korap/authentication/RandomCodeGeneratorTest.java b/full/src/test/java/de/ids_mannheim/korap/authentication/RandomCodeGeneratorTest.java
index a3694f0..9ffe776 100644
--- a/full/src/test/java/de/ids_mannheim/korap/authentication/RandomCodeGeneratorTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/authentication/RandomCodeGeneratorTest.java
@@ -17,14 +17,16 @@
     private RandomCodeGenerator random;
 
     @Test
-    public void testRandomGenerator() throws NoSuchAlgorithmException, KustvaktException {
+    public void testRandomGenerator ()
+            throws NoSuchAlgorithmException, KustvaktException {
         String value = random.createRandomCode();
         assertEquals(22, value.length());
         // System.out.println(value);
     }
 
     @Disabled
-    public void testRandomGeneratorPerformance() throws NoSuchAlgorithmException, KustvaktException {
+    public void testRandomGeneratorPerformance ()
+            throws NoSuchAlgorithmException, KustvaktException {
         long min = Integer.MAX_VALUE, max = Integer.MIN_VALUE;
         String code;
         while (true) {
@@ -39,7 +41,8 @@
                 min = duration;
             else if (duration > max)
                 max = duration;
-            System.out.println("d : " + duration + " min :" + min + ", max: " + max);
+            System.out.println(
+                    "d : " + duration + " min :" + min + ", max: " + max);
         }
     }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/cache/NamedVCLoaderTest.java b/full/src/test/java/de/ids_mannheim/korap/cache/NamedVCLoaderTest.java
index 8d3d275..7b7db2f 100644
--- a/full/src/test/java/de/ids_mannheim/korap/cache/NamedVCLoaderTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/cache/NamedVCLoaderTest.java
@@ -27,7 +27,8 @@
     private QueryDao dao;
 
     @Test
-    public void testNamedVCLoader() throws IOException, QueryException, KustvaktException {
+    public void testNamedVCLoader ()
+            throws IOException, QueryException, KustvaktException {
         String vcId = "named-vc1";
         vcLoader.loadVCToCache(vcId, "/vc/named-vc1.jsonld");
         assertTrue(VirtualCorpusCache.contains(vcId));
diff --git a/full/src/test/java/de/ids_mannheim/korap/cache/TotalResultTest.java b/full/src/test/java/de/ids_mannheim/korap/cache/TotalResultTest.java
index 5beb40b..819f7a3 100644
--- a/full/src/test/java/de/ids_mannheim/korap/cache/TotalResultTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/cache/TotalResultTest.java
@@ -3,7 +3,6 @@
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
-
 import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import com.fasterxml.jackson.databind.JsonNode;
@@ -18,15 +17,15 @@
 
     @Autowired
     private SearchService searchService;
-    
+
     @Test
     public void testClearCache () {
         for (int i = 1; i < 10; i++) {
             searchService.getTotalResultCache().storeInCache(i, "10");
         }
-        
+
         searchService.getTotalResultCache().clearCache();
-        
+
         assertEquals(0, searchService.getTotalResultCache()
                 .getAllCacheElements().size());
     }
@@ -34,48 +33,77 @@
     @Test
     public void testSearchWithPaging () throws KustvaktException {
         searchService.getTotalResultCache().clearCache();
-        
+
         assertEquals(0, searchService.getTotalResultCache()
                 .getAllCacheElements().size());
-        
+
         Response response = target().path(API_VERSION).path("search")
                 .queryParam("q", "[orth=die]").queryParam("ql", "poliqarp")
                 .queryParam("page", "1").request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertTrue(node.at("/meta/totalResults").isNumber(), "totalResults should be a number");
+        assertTrue(node.at("/meta/totalResults").isNumber(),
+                "totalResults should be a number");
         int totalResults = node.at("/meta/totalResults").asInt();
-        assertEquals(1, searchService.getTotalResultCache().getAllCacheElements().size());
-        response = target().path(API_VERSION).path("search").queryParam("q", "[orth=die]").queryParam("ql", "poliqarp").queryParam("page", "2").request().get();
+        assertEquals(1, searchService.getTotalResultCache()
+                .getAllCacheElements().size());
+        response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=die]").queryParam("ql", "poliqarp")
+                .queryParam("page", "2").request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         entity = response.readEntity(String.class);
         node = JsonUtils.readTree(entity);
-        assertTrue(node.at("/meta/totalResults").isNumber(), "totalResults should be a number");
+        assertTrue(node.at("/meta/totalResults").isNumber(),
+                "totalResults should be a number");
         assertEquals(totalResults, node.at("/meta/totalResults").asInt());
-        assertEquals(1, searchService.getTotalResultCache().getAllCacheElements().size());
+        assertEquals(1, searchService.getTotalResultCache()
+                .getAllCacheElements().size());
         assertTrue(node.at("/meta/cutOff").isMissingNode());
         testSearchWithCutOff();
     }
 
     @Test
-    public void testSearchWithCutOffTrue() throws KustvaktException {
-        int cacheSize = searchService.getTotalResultCache().getAllCacheElements().size();
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "ich").queryParam("ql", "poliqarp").queryParam("page", "2").queryParam("cutoff", "true").request().get();
+    public void testSearchWithCutOffTrue () throws KustvaktException {
+        int cacheSize = searchService.getTotalResultCache()
+                .getAllCacheElements().size();
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "ich").queryParam("ql", "poliqarp")
+                .queryParam("page", "2").queryParam("cutoff", "true").request()
+                .get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
-        String query = "{\"meta\":{\"startPage\":2,\"tokens\":false,\"cutOff\":" + "true,\"snippets\":true,\"timeout\":10000},\"query\":{\"@type\":" + "\"koral:token\",\"wrap\":{\"@type\":\"koral:term\",\"match\":" + "\"match:eq\",\"layer\":\"orth\",\"key\":\"ich\",\"foundry\":" + "\"opennlp\",\"rewrites\":[{\"@type\":\"koral:rewrite\",\"src\":" + "\"Kustvakt\",\"operation\":\"operation:injection\",\"scope\":" + "\"foundry\"}]}},\"@context\":\"http://korap.ids-mannheim.de/ns" + "/koral/0.3/context.jsonld\",\"collection\":{\"@type\":\"koral:" + "doc\",\"match\":\"match:eq\",\"type\":\"type:regex\",\"value\":" + "\"CC-BY.*\",\"key\":\"availability\",\"rewrites\":[{\"@type\":" + "\"koral:rewrite\",\"src\":\"Kustvakt\",\"operation\":\"operation:" + "insertion\",\"scope\":\"availability(FREE)\"}]}}";
+        String query = "{\"meta\":{\"startPage\":2,\"tokens\":false,\"cutOff\":"
+                + "true,\"snippets\":true,\"timeout\":10000},\"query\":{\"@type\":"
+                + "\"koral:token\",\"wrap\":{\"@type\":\"koral:term\",\"match\":"
+                + "\"match:eq\",\"layer\":\"orth\",\"key\":\"ich\",\"foundry\":"
+                + "\"opennlp\",\"rewrites\":[{\"@type\":\"koral:rewrite\",\"src\":"
+                + "\"Kustvakt\",\"operation\":\"operation:injection\",\"scope\":"
+                + "\"foundry\"}]}},\"@context\":\"http://korap.ids-mannheim.de/ns"
+                + "/koral/0.3/context.jsonld\",\"collection\":{\"@type\":\"koral:"
+                + "doc\",\"match\":\"match:eq\",\"type\":\"type:regex\",\"value\":"
+                + "\"CC-BY.*\",\"key\":\"availability\",\"rewrites\":[{\"@type\":"
+                + "\"koral:rewrite\",\"src\":\"Kustvakt\",\"operation\":\"operation:"
+                + "insertion\",\"scope\":\"availability(FREE)\"}]}}";
         int cacheKey = searchService.createTotalResultCacheKey(query);
-        assertEquals(null, searchService.getTotalResultCache().getCacheValue(cacheKey));
-        assertEquals(cacheSize, searchService.getTotalResultCache().getAllCacheElements().size());
+        assertEquals(null,
+                searchService.getTotalResultCache().getCacheValue(cacheKey));
+        assertEquals(cacheSize, searchService.getTotalResultCache()
+                .getAllCacheElements().size());
     }
 
-    private void testSearchWithCutOff() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=die]").queryParam("ql", "poliqarp").queryParam("page", "3").queryParam("cutoff", "false").request().get();
+    private void testSearchWithCutOff () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=die]").queryParam("ql", "poliqarp")
+                .queryParam("page", "3").queryParam("cutoff", "false").request()
+                .get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertTrue(node.at("/meta/cutOff").isMissingNode());
-        response = target().path(API_VERSION).path("search").queryParam("q", "[orth=die]").queryParam("ql", "poliqarp").queryParam("page", "4").queryParam("cutoff", "true").request().get();
+        response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=die]").queryParam("ql", "poliqarp")
+                .queryParam("page", "4").queryParam("cutoff", "true").request()
+                .get();
         entity = response.readEntity(String.class);
         node = JsonUtils.readTree(entity);
         assertTrue(node.at("/meta/cutOff").asBoolean());
diff --git a/full/src/test/java/de/ids_mannheim/korap/config/LiteJerseyTest.java b/full/src/test/java/de/ids_mannheim/korap/config/LiteJerseyTest.java
index 98fa24b..80b00a5 100644
--- a/full/src/test/java/de/ids_mannheim/korap/config/LiteJerseyTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/config/LiteJerseyTest.java
@@ -25,16 +25,21 @@
     @Autowired
     protected GenericApplicationContext applicationContext;
 
-    public static String[] classPackages = new String[]{"de.ids_mannheim.korap.core.web", "de.ids_mannheim.korap.web.filter", "de.ids_mannheim.korap.web.utils", "de.ids_mannheim.korap.test", "com.fasterxml.jackson.jaxrs.json"};
+    public static String[] classPackages = new String[] {
+            "de.ids_mannheim.korap.core.web",
+            "de.ids_mannheim.korap.web.filter",
+            "de.ids_mannheim.korap.web.utils", "de.ids_mannheim.korap.test",
+            "com.fasterxml.jackson.jaxrs.json" };
 
     @Override
-    protected TestContainerFactory getTestContainerFactory() throws TestContainerException {
+    protected TestContainerFactory getTestContainerFactory ()
+            throws TestContainerException {
         return new GrizzlyWebTestContainerFactory();
     }
 
     @BeforeEach
     @Override
-    public void setUp() throws Exception {
+    public void setUp () throws Exception {
         GenericWebApplicationContext genericContext = new GenericWebApplicationContext();
         genericContext.setParent(this.applicationContext);
         genericContext.setClassLoader(this.applicationContext.getClassLoader());
@@ -43,7 +48,11 @@
     }
 
     @Override
-    protected DeploymentContext configureDeployment() {
-        return ServletDeploymentContext.forServlet(new ServletContainer(new ResourceConfig().packages(classPackages))).addListener(StaticContextLoaderListener.class).contextParam("adminToken", "secret").build();
+    protected DeploymentContext configureDeployment () {
+        return ServletDeploymentContext
+                .forServlet(new ServletContainer(
+                        new ResourceConfig().packages(classPackages)))
+                .addListener(StaticContextLoaderListener.class)
+                .contextParam("adminToken", "secret").build();
     }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/config/SpringJerseyTest.java b/full/src/test/java/de/ids_mannheim/korap/config/SpringJerseyTest.java
index 1fca983..a1baccb 100644
--- a/full/src/test/java/de/ids_mannheim/korap/config/SpringJerseyTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/config/SpringJerseyTest.java
@@ -28,16 +28,19 @@
     @Autowired
     protected GenericApplicationContext applicationContext;
 
-    public static String[] classPackages = new String[]{"de.ids_mannheim.korap.web", "de.ids_mannheim.korap.core.web", "de.ids_mannheim.korap.test", "com.fasterxml.jackson.jaxrs.json"};
+    public static String[] classPackages = new String[] {
+            "de.ids_mannheim.korap.web", "de.ids_mannheim.korap.core.web",
+            "de.ids_mannheim.korap.test", "com.fasterxml.jackson.jaxrs.json" };
 
     @Override
-    protected TestContainerFactory getTestContainerFactory() throws TestContainerException {
+    protected TestContainerFactory getTestContainerFactory ()
+            throws TestContainerException {
         return new GrizzlyWebTestContainerFactory();
     }
 
     @BeforeEach
     @Override
-    public void setUp() throws Exception {
+    public void setUp () throws Exception {
         GenericWebApplicationContext genericContext = new GenericWebApplicationContext();
         genericContext.setParent(this.applicationContext);
         genericContext.setClassLoader(this.applicationContext.getClassLoader());
@@ -46,7 +49,11 @@
     }
 
     @Override
-    protected DeploymentContext configureDeployment() {
-        return ServletDeploymentContext.forServlet(new ServletContainer(new ResourceConfig().packages(classPackages))).addListener(StaticContextLoaderListener.class).contextParam("adminToken", "secret").build();
+    protected DeploymentContext configureDeployment () {
+        return ServletDeploymentContext
+                .forServlet(new ServletContainer(
+                        new ResourceConfig().packages(classPackages)))
+                .addListener(StaticContextLoaderListener.class)
+                .contextParam("adminToken", "secret").build();
     }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/config/StaticContextLoaderListener.java b/full/src/test/java/de/ids_mannheim/korap/config/StaticContextLoaderListener.java
index d4cf8d9..018bd6e 100644
--- a/full/src/test/java/de/ids_mannheim/korap/config/StaticContextLoaderListener.java
+++ b/full/src/test/java/de/ids_mannheim/korap/config/StaticContextLoaderListener.java
@@ -1,6 +1,5 @@
 package de.ids_mannheim.korap.config;
 
-
 import org.springframework.web.context.ContextLoaderListener;
 import org.springframework.web.context.WebApplicationContext;
 
@@ -23,14 +22,14 @@
         super(applicationContext);
     }
 
-	@Override
-	public void contextInitialized(ServletContextEvent event) {
+    @Override
+    public void contextInitialized (ServletContextEvent event) {
         contextClassLoader = Thread.currentThread().getContextClassLoader();
         super.contextInitialized(event);
-	}
+    }
 
-	@Override
-	public void contextDestroyed(ServletContextEvent event) {
+    @Override
+    public void contextDestroyed (ServletContextEvent event) {
         // Perform the destruction with the same contextual ClassLoader that was present
         // during initialization.
         // This a workaround for a bug in org.glassfish.grizzly.servlet.WebappContext
@@ -43,5 +42,5 @@
         super.contextDestroyed(event);
 
         Thread.currentThread().setContextClassLoader(loader);
-	}
+    }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/config/TestVariables.java b/full/src/test/java/de/ids_mannheim/korap/config/TestVariables.java
index 1e157a5..e4658ce 100644
--- a/full/src/test/java/de/ids_mannheim/korap/config/TestVariables.java
+++ b/full/src/test/java/de/ids_mannheim/korap/config/TestVariables.java
@@ -9,67 +9,44 @@
 
     public static final String RESULT = "{\n"
             + "\t\"@context\": \"http://korap.ids-mannheim.de/ns/KoralQuery/v0.3/context.jsonld\",\n"
-            + "\t\"meta\": {\n"
-            + "\t\t\"count\": 25,\n"
-            + "\t\t\"startIndex\": 0,\n"
-            + "\t\t\"timeout\": 120000,\n"
-            + "\t\t\"context\": {\n"
-            + "\t\t\t\"left\": [\"token\", 6],\n"
-            + "\t\t\t\"right\": [\"token\", 6]\n"
-            + "\t\t},\n"
+            + "\t\"meta\": {\n" + "\t\t\"count\": 25,\n"
+            + "\t\t\"startIndex\": 0,\n" + "\t\t\"timeout\": 120000,\n"
+            + "\t\t\"context\": {\n" + "\t\t\t\"left\": [\"token\", 6],\n"
+            + "\t\t\t\"right\": [\"token\", 6]\n" + "\t\t},\n"
             + "\t\t\"fields\": [\"pubDate\", \"subTitle\", \"author\", \"pubPlace\", \"title\", \"textSigle\", \"UID\", \"ID\", \"layerInfos\", \"corpusSigle\", \"docSigle\", \"corpusID\", \"textClass\"],\n"
             + "\t\t\"version\": \"0.55.5\",\n"
             + "\t\t\"benchmark\": \"0.117436617 s\",\n"
             + "\t\t\"totalResults\": 31,\n"
             + "\t\t\"serialQuery\": \"tokens:s:das\",\n"
-            + "\t\t\"itemsPerPage\": 25\n"
-            + "\t},\n"
-            + "\t\"query\": {\n"
-            + "\t\t\"@type\": \"koral:token\",\n"
-            + "\t\t\"wrap\": {\n"
-            + "\t\t\t\"@type\": \"koral:term\",\n"
-            + "\t\t\t\"key\": \"das\",\n"
+            + "\t\t\"itemsPerPage\": 25\n" + "\t},\n" + "\t\"query\": {\n"
+            + "\t\t\"@type\": \"koral:token\",\n" + "\t\t\"wrap\": {\n"
+            + "\t\t\t\"@type\": \"koral:term\",\n" + "\t\t\t\"key\": \"das\",\n"
             + "\t\t\t\"layer\": \"orth\",\n"
             + "\t\t\t\"match\": \"match:eq\",\n"
-            + "\t\t\t\"foundry\": \"opennlp\",\n"
-            + "\t\t\t\"rewrites\": [{\n"
+            + "\t\t\t\"foundry\": \"opennlp\",\n" + "\t\t\t\"rewrites\": [{\n"
             + "\t\t\t\t\"@type\": \"koral:rewrite\",\n"
             + "\t\t\t\t\"src\": \"Kustvakt\",\n"
             + "\t\t\t\t\"operation\": \"operation:injection\",\n"
-            + "\t\t\t\t\"scope\": \"foundry\"\n"
-            + "\t\t\t}]\n"
-            + "\t\t},\n"
-            + "\t\t\"idn\": \"das_0\",\n"
-            + "\t\t\"rewrites\": [{\n"
+            + "\t\t\t\t\"scope\": \"foundry\"\n" + "\t\t\t}]\n" + "\t\t},\n"
+            + "\t\t\"idn\": \"das_0\",\n" + "\t\t\"rewrites\": [{\n"
             + "\t\t\t\"@type\": \"koral:rewrite\",\n"
             + "\t\t\t\"src\": \"Kustvakt\",\n"
             + "\t\t\t\"operation\": \"operation:injection\",\n"
-            + "\t\t\t\"scope\": \"idn\"\n"
-            + "\t\t}]\n"
-            + "\t},\n"
-            + "\t\"collection\": {\n"
-            + "\t\t\"@type\": \"koral:docGroup\",\n"
+            + "\t\t\t\"scope\": \"idn\"\n" + "\t\t}]\n" + "\t},\n"
+            + "\t\"collection\": {\n" + "\t\t\"@type\": \"koral:docGroup\",\n"
             + "\t\t\"operation\": \"operation:or\",\n"
-            + "\t\t\"operands\": [{\n"
-            + "\t\t\t\"@type\": \"koral:doc\",\n"
+            + "\t\t\"operands\": [{\n" + "\t\t\t\"@type\": \"koral:doc\",\n"
             + "\t\t\t\"key\": \"corpusSigle\",\n"
-            + "\t\t\t\"value\": \"GOE\",\n"
-            + "\t\t\t\"match\": \"match:eq\"\n"
-            + "\t\t}, {\n"
-            + "\t\t\t\"@type\": \"koral:doc\",\n"
+            + "\t\t\t\"value\": \"GOE\",\n" + "\t\t\t\"match\": \"match:eq\"\n"
+            + "\t\t}, {\n" + "\t\t\t\"@type\": \"koral:doc\",\n"
             + "\t\t\t\"key\": \"corpusSigle\",\n"
-            + "\t\t\t\"value\": \"WPD\",\n"
-            + "\t\t\t\"match\": \"match:eq\"\n"
-            + "\t\t}],\n"
-            + "\t\t\"rewrites\": [{\n"
+            + "\t\t\t\"value\": \"WPD\",\n" + "\t\t\t\"match\": \"match:eq\"\n"
+            + "\t\t}],\n" + "\t\t\"rewrites\": [{\n"
             + "\t\t\t\"@type\": \"koral:rewrite\",\n"
             + "\t\t\t\"src\": \"Kustvakt\",\n"
             + "\t\t\t\"operation\": \"operation:insertion\",\n"
-            + "\t\t\t\"scope\": \"corpusSigle\"\n"
-            + "\t\t}]\n"
-            + "\t},\n"
-            + "\t\"matches\": [{\n"
-            + "\t\t\"field\": \"tokens\",\n"
+            + "\t\t\t\"scope\": \"corpusSigle\"\n" + "\t\t}]\n" + "\t},\n"
+            + "\t\"matches\": [{\n" + "\t\t\"field\": \"tokens\",\n"
             + "\t\t\"textClass\": \"wissenschaft populaerwissenschaft\",\n"
             + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
             + "\t\t\"textSigle\": \"WPD_AAA.00004\",\n"
@@ -78,14 +55,11 @@
             + "\t\t\"title\": \"A (Logik)\",\n"
             + "\t\t\"author\": \"Zenogantner; ElRaki; 1\",\n"
             + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
-            + "\t\t\"startMore\": true,\n"
-            + "\t\t\"endMore\": true,\n"
+            + "\t\t\"startMore\": true,\n" + "\t\t\"endMore\": true,\n"
             + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>z.B. mit dem Wort Barbara&quot; bezeichnet, </span><mark>das</mark><span class=\\\"context-right\\\"> dreimal den Buchstaben a enthält, aber<span class=\\\"more\\\"></span></span>\",\n"
             + "\t\t\"matchID\": \"match-WPD_AAA.00004-p195-196\",\n"
-            + "\t\t\"UID\": 0,\n"
-            + "\t\t\"pubDate\": \"2005-03-28\"\n"
-            + "\t}, {\n"
-            + "\t\t\"field\": \"tokens\",\n"
+            + "\t\t\"UID\": 0,\n" + "\t\t\"pubDate\": \"2005-03-28\"\n"
+            + "\t}, {\n" + "\t\t\"field\": \"tokens\",\n"
             + "\t\t\"textClass\": \"kultur musik freizeit-unterhaltung reisen\",\n"
             + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
             + "\t\t\"textSigle\": \"WPD_AAA.02439\",\n"
@@ -94,14 +68,11 @@
             + "\t\t\"title\": \"Aegukka\",\n"
             + "\t\t\"author\": \"ThorstenS; 2\",\n"
             + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
-            + "\t\t\"startMore\": true,\n"
-            + "\t\t\"endMore\": true,\n"
+            + "\t\t\"startMore\": true,\n" + "\t\t\"endMore\": true,\n"
             + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>wörtlich &quot;Das Lied der Liebe für </span><mark>das</mark><span class=\\\"context-right\\\"> Land&quot;, oder &quot;Das patriotische Lied&quot;. Es<span class=\\\"more\\\"></span></span>\",\n"
             + "\t\t\"matchID\": \"match-WPD_AAA.02439-p22-23\",\n"
-            + "\t\t\"UID\": 0,\n"
-            + "\t\t\"pubDate\": \"2005-03-28\"\n"
-            + "\t}, {\n"
-            + "\t\t\"field\": \"tokens\",\n"
+            + "\t\t\"UID\": 0,\n" + "\t\t\"pubDate\": \"2005-03-28\"\n"
+            + "\t}, {\n" + "\t\t\"field\": \"tokens\",\n"
             + "\t\t\"textClass\": \"kultur musik freizeit-unterhaltung reisen\",\n"
             + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
             + "\t\t\"textSigle\": \"WPD_AAA.02439\",\n"
@@ -110,14 +81,11 @@
             + "\t\t\"title\": \"Aegukka\",\n"
             + "\t\t\"author\": \"ThorstenS; 2\",\n"
             + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
-            + "\t\t\"startMore\": true,\n"
-            + "\t\t\"endMore\": true,\n"
+            + "\t\t\"startMore\": true,\n" + "\t\t\"endMore\": true,\n"
             + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>Besatzungszeit von 1910 bis 1945 wurde </span><mark>das</mark><span class=\\\"context-right\\\"> Lied verboten. Im Ausland lebende Koreaner<span class=\\\"more\\\"></span></span>\",\n"
             + "\t\t\"matchID\": \"match-WPD_AAA.02439-p74-75\",\n"
-            + "\t\t\"UID\": 0,\n"
-            + "\t\t\"pubDate\": \"2005-03-28\"\n"
-            + "\t}, {\n"
-            + "\t\t\"field\": \"tokens\",\n"
+            + "\t\t\"UID\": 0,\n" + "\t\t\"pubDate\": \"2005-03-28\"\n"
+            + "\t}, {\n" + "\t\t\"field\": \"tokens\",\n"
             + "\t\t\"textClass\": \"kultur musik freizeit-unterhaltung reisen\",\n"
             + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
             + "\t\t\"textSigle\": \"WPD_AAA.02439\",\n"
@@ -126,348 +94,262 @@
             + "\t\t\"title\": \"Aegukka\",\n"
             + "\t\t\"author\": \"ThorstenS; 2\",\n"
             + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
-            + "\t\t\"startMore\": true,\n"
-            + "\t\t\"endMore\": true,\n"
+            + "\t\t\"startMore\": true,\n" + "\t\t\"endMore\": true,\n"
             + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>3. Deutsche Übersetzung 1. Strophe Bis </span><mark>das</mark><span class=\\\"context-right\\\"> Meer des Ostens ausdörrt und der<span class=\\\"more\\\"></span></span>\",\n"
             + "\t\t\"matchID\": \"match-WPD_AAA.02439-p298-299\",\n"
-            + "\t\t\"UID\": 0,\n"
-            + "\t\t\"pubDate\": \"2005-03-28\"\n"
-            + "\t}, {\n"
-            + "\t\t\"field\": \"tokens\",\n"
+            + "\t\t\"UID\": 0,\n" + "\t\t\"pubDate\": \"2005-03-28\"\n"
+            + "\t}, {\n" + "\t\t\"field\": \"tokens\",\n"
             + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
             + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
             + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
             + "\t\t\"docSigle\": \"WPD_AAA\",\n"
-            + "\t\t\"corpusSigle\": \"WPD\",\n"
-            + "\t\t\"title\": \"A\",\n"
+            + "\t\t\"corpusSigle\": \"WPD\",\n" + "\t\t\"title\": \"A\",\n"
             + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
             + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
-            + "\t\t\"startMore\": true,\n"
-            + "\t\t\"endMore\": true,\n"
+            + "\t\t\"startMore\": true,\n" + "\t\t\"endMore\": true,\n"
             + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>Ausnahme von Fremdwörtern und Namen ist </span><mark>das</mark><span class=\\\"context-right\\\"> A der einzige Buchstabe im Deutschen<span class=\\\"more\\\"></span></span>\",\n"
             + "\t\t\"matchID\": \"match-WPD_AAA.00001-p41-42\",\n"
-            + "\t\t\"UID\": 0,\n"
-            + "\t\t\"pubDate\": \"2005-03-28\"\n"
-            + "\t}, {\n"
-            + "\t\t\"field\": \"tokens\",\n"
+            + "\t\t\"UID\": 0,\n" + "\t\t\"pubDate\": \"2005-03-28\"\n"
+            + "\t}, {\n" + "\t\t\"field\": \"tokens\",\n"
             + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
             + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
             + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
             + "\t\t\"docSigle\": \"WPD_AAA\",\n"
-            + "\t\t\"corpusSigle\": \"WPD\",\n"
-            + "\t\t\"title\": \"A\",\n"
+            + "\t\t\"corpusSigle\": \"WPD\",\n" + "\t\t\"title\": \"A\",\n"
             + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
             + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
-            + "\t\t\"startMore\": true,\n"
-            + "\t\t\"endMore\": true,\n"
+            + "\t\t\"startMore\": true,\n" + "\t\t\"endMore\": true,\n"
             + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>flache Stellung niedergedrückt wird. Stellt man </span><mark>das</mark><span class=\\\"context-right\\\"> Verhältnis der drei Hauptvokale a, i<span class=\\\"more\\\"></span></span>\",\n"
             + "\t\t\"matchID\": \"match-WPD_AAA.00001-p107-108\",\n"
-            + "\t\t\"UID\": 0,\n"
-            + "\t\t\"pubDate\": \"2005-03-28\"\n"
-            + "\t}, {\n"
-            + "\t\t\"field\": \"tokens\",\n"
+            + "\t\t\"UID\": 0,\n" + "\t\t\"pubDate\": \"2005-03-28\"\n"
+            + "\t}, {\n" + "\t\t\"field\": \"tokens\",\n"
             + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
             + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
             + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
             + "\t\t\"docSigle\": \"WPD_AAA\",\n"
-            + "\t\t\"corpusSigle\": \"WPD\",\n"
-            + "\t\t\"title\": \"A\",\n"
+            + "\t\t\"corpusSigle\": \"WPD\",\n" + "\t\t\"title\": \"A\",\n"
             + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
             + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
-            + "\t\t\"startMore\": true,\n"
-            + "\t\t\"endMore\": true,\n"
+            + "\t\t\"startMore\": true,\n" + "\t\t\"endMore\": true,\n"
             + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>kommt i als der hellste an </span><mark>das</mark><span class=\\\"context-right\\\"> obere, u als der dumpfeste an<span class=\\\"more\\\"></span></span>\",\n"
             + "\t\t\"matchID\": \"match-WPD_AAA.00001-p127-128\",\n"
-            + "\t\t\"UID\": 0,\n"
-            + "\t\t\"pubDate\": \"2005-03-28\"\n"
-            + "\t}, {\n"
-            + "\t\t\"field\": \"tokens\",\n"
+            + "\t\t\"UID\": 0,\n" + "\t\t\"pubDate\": \"2005-03-28\"\n"
+            + "\t}, {\n" + "\t\t\"field\": \"tokens\",\n"
             + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
             + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
             + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
             + "\t\t\"docSigle\": \"WPD_AAA\",\n"
-            + "\t\t\"corpusSigle\": \"WPD\",\n"
-            + "\t\t\"title\": \"A\",\n"
+            + "\t\t\"corpusSigle\": \"WPD\",\n" + "\t\t\"title\": \"A\",\n"
             + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
             + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
-            + "\t\t\"startMore\": true,\n"
-            + "\t\t\"endMore\": true,\n"
+            + "\t\t\"startMore\": true,\n" + "\t\t\"endMore\": true,\n"
             + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>obere, u als der dumpfeste an </span><mark>das</mark><span class=\\\"context-right\\\"> untere Ende, a als der mittlere<span class=\\\"more\\\"></span></span>\",\n"
             + "\t\t\"matchID\": \"match-WPD_AAA.00001-p134-135\",\n"
-            + "\t\t\"UID\": 0,\n"
-            + "\t\t\"pubDate\": \"2005-03-28\"\n"
-            + "\t}, {\n"
-            + "\t\t\"field\": \"tokens\",\n"
+            + "\t\t\"UID\": 0,\n" + "\t\t\"pubDate\": \"2005-03-28\"\n"
+            + "\t}, {\n" + "\t\t\"field\": \"tokens\",\n"
             + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
             + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
             + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
             + "\t\t\"docSigle\": \"WPD_AAA\",\n"
-            + "\t\t\"corpusSigle\": \"WPD\",\n"
-            + "\t\t\"title\": \"A\",\n"
+            + "\t\t\"corpusSigle\": \"WPD\",\n" + "\t\t\"title\": \"A\",\n"
             + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
             + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
-            + "\t\t\"startMore\": true,\n"
-            + "\t\t\"endMore\": true,\n"
+            + "\t\t\"startMore\": true,\n" + "\t\t\"endMore\": true,\n"
             + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>im 9. Jahrhundert v. Chr. war </span><mark>das</mark><span class=\\\"context-right\\\"> Schriftzeichen bereits stark stilisiert, die Hörner<span class=\\\"more\\\"></span></span>\",\n"
             + "\t\t\"matchID\": \"match-WPD_AAA.00001-p271-272\",\n"
-            + "\t\t\"UID\": 0,\n"
-            + "\t\t\"pubDate\": \"2005-03-28\"\n"
-            + "\t}, {\n"
-            + "\t\t\"field\": \"tokens\",\n"
+            + "\t\t\"UID\": 0,\n" + "\t\t\"pubDate\": \"2005-03-28\"\n"
+            + "\t}, {\n" + "\t\t\"field\": \"tokens\",\n"
             + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
             + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
             + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
             + "\t\t\"docSigle\": \"WPD_AAA\",\n"
-            + "\t\t\"corpusSigle\": \"WPD\",\n"
-            + "\t\t\"title\": \"A\",\n"
+            + "\t\t\"corpusSigle\": \"WPD\",\n" + "\t\t\"title\": \"A\",\n"
             + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
             + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
-            + "\t\t\"startMore\": true,\n"
-            + "\t\t\"endMore\": true,\n"
+            + "\t\t\"startMore\": true,\n" + "\t\t\"endMore\": true,\n"
             + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>im Alphabet inne. Als die Griechen </span><mark>das</mark><span class=\\\"context-right\\\"> Phönizische Alphabet übernamen, drehten sie das<span class=\\\"more\\\"></span></span>\",\n"
             + "\t\t\"matchID\": \"match-WPD_AAA.00001-p313-314\",\n"
-            + "\t\t\"UID\": 0,\n"
-            + "\t\t\"pubDate\": \"2005-03-28\"\n"
-            + "\t}, {\n"
-            + "\t\t\"field\": \"tokens\",\n"
+            + "\t\t\"UID\": 0,\n" + "\t\t\"pubDate\": \"2005-03-28\"\n"
+            + "\t}, {\n" + "\t\t\"field\": \"tokens\",\n"
             + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
             + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
             + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
             + "\t\t\"docSigle\": \"WPD_AAA\",\n"
-            + "\t\t\"corpusSigle\": \"WPD\",\n"
-            + "\t\t\"title\": \"A\",\n"
+            + "\t\t\"corpusSigle\": \"WPD\",\n" + "\t\t\"title\": \"A\",\n"
             + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
             + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
-            + "\t\t\"startMore\": true,\n"
-            + "\t\t\"endMore\": true,\n"
+            + "\t\t\"startMore\": true,\n" + "\t\t\"endMore\": true,\n"
             + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>das Phönizische Alphabet übernamen, drehten sie </span><mark>das</mark><span class=\\\"context-right\\\"> Zeichen um 90 Grad und machten<span class=\\\"more\\\"></span></span>\",\n"
             + "\t\t\"matchID\": \"match-WPD_AAA.00001-p319-320\",\n"
-            + "\t\t\"UID\": 0,\n"
-            + "\t\t\"pubDate\": \"2005-03-28\"\n"
-            + "\t}, {\n"
-            + "\t\t\"field\": \"tokens\",\n"
+            + "\t\t\"UID\": 0,\n" + "\t\t\"pubDate\": \"2005-03-28\"\n"
+            + "\t}, {\n" + "\t\t\"field\": \"tokens\",\n"
             + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
             + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
             + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
             + "\t\t\"docSigle\": \"WPD_AAA\",\n"
-            + "\t\t\"corpusSigle\": \"WPD\",\n"
-            + "\t\t\"title\": \"A\",\n"
+            + "\t\t\"corpusSigle\": \"WPD\",\n" + "\t\t\"title\": \"A\",\n"
             + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
             + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
-            + "\t\t\"startMore\": true,\n"
-            + "\t\t\"endMore\": true,\n"
+            + "\t\t\"startMore\": true,\n" + "\t\t\"endMore\": true,\n"
             + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>um 90 Grad und machten daraus </span><mark>das</mark><span class=\\\"context-right\\\"> Alpha. Da das Griechische reich an<span class=\\\"more\\\"></span></span>\",\n"
             + "\t\t\"matchID\": \"match-WPD_AAA.00001-p327-328\",\n"
-            + "\t\t\"UID\": 0,\n"
-            + "\t\t\"pubDate\": \"2005-03-28\"\n"
-            + "\t}, {\n"
-            + "\t\t\"field\": \"tokens\",\n"
+            + "\t\t\"UID\": 0,\n" + "\t\t\"pubDate\": \"2005-03-28\"\n"
+            + "\t}, {\n" + "\t\t\"field\": \"tokens\",\n"
             + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
             + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
             + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
             + "\t\t\"docSigle\": \"WPD_AAA\",\n"
-            + "\t\t\"corpusSigle\": \"WPD\",\n"
-            + "\t\t\"title\": \"A\",\n"
+            + "\t\t\"corpusSigle\": \"WPD\",\n" + "\t\t\"title\": \"A\",\n"
             + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
             + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
-            + "\t\t\"startMore\": true,\n"
-            + "\t\t\"endMore\": true,\n"
+            + "\t\t\"startMore\": true,\n" + "\t\t\"endMore\": true,\n"
             + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>und machten daraus das Alpha. Da </span><mark>das</mark><span class=\\\"context-right\\\"> Griechische reich an Vokalen war, verwendeten<span class=\\\"more\\\"></span></span>\",\n"
             + "\t\t\"matchID\": \"match-WPD_AAA.00001-p330-331\",\n"
-            + "\t\t\"UID\": 0,\n"
-            + "\t\t\"pubDate\": \"2005-03-28\"\n"
-            + "\t}, {\n"
-            + "\t\t\"field\": \"tokens\",\n"
+            + "\t\t\"UID\": 0,\n" + "\t\t\"pubDate\": \"2005-03-28\"\n"
+            + "\t}, {\n" + "\t\t\"field\": \"tokens\",\n"
             + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
             + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
             + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
             + "\t\t\"docSigle\": \"WPD_AAA\",\n"
-            + "\t\t\"corpusSigle\": \"WPD\",\n"
-            + "\t\t\"title\": \"A\",\n"
+            + "\t\t\"corpusSigle\": \"WPD\",\n" + "\t\t\"title\": \"A\",\n"
             + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
             + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
-            + "\t\t\"startMore\": true,\n"
-            + "\t\t\"endMore\": true,\n"
+            + "\t\t\"startMore\": true,\n" + "\t\t\"endMore\": true,\n"
             + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>reich an Vokalen war, verwendeten sie </span><mark>das</mark><span class=\\\"context-right\\\"> Zeichen für den Lautwert a. Die<span class=\\\"more\\\"></span></span>\",\n"
             + "\t\t\"matchID\": \"match-WPD_AAA.00001-p338-339\",\n"
-            + "\t\t\"UID\": 0,\n"
-            + "\t\t\"pubDate\": \"2005-03-28\"\n"
-            + "\t}, {\n"
-            + "\t\t\"field\": \"tokens\",\n"
+            + "\t\t\"UID\": 0,\n" + "\t\t\"pubDate\": \"2005-03-28\"\n"
+            + "\t}, {\n" + "\t\t\"field\": \"tokens\",\n"
             + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
             + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
             + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
             + "\t\t\"docSigle\": \"WPD_AAA\",\n"
-            + "\t\t\"corpusSigle\": \"WPD\",\n"
-            + "\t\t\"title\": \"A\",\n"
+            + "\t\t\"corpusSigle\": \"WPD\",\n" + "\t\t\"title\": \"A\",\n"
             + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
             + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
-            + "\t\t\"startMore\": true,\n"
-            + "\t\t\"endMore\": true,\n"
+            + "\t\t\"startMore\": true,\n" + "\t\t\"endMore\": true,\n"
             + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>den Lautwert a. Die Etrusker übernahmen </span><mark>das</mark><span class=\\\"context-right\\\"> frühgriechische Alpha und ließen es größtenteils<span class=\\\"more\\\"></span></span>\",\n"
             + "\t\t\"matchID\": \"match-WPD_AAA.00001-p347-348\",\n"
-            + "\t\t\"UID\": 0,\n"
-            + "\t\t\"pubDate\": \"2005-03-28\"\n"
-            + "\t}, {\n"
-            + "\t\t\"field\": \"tokens\",\n"
+            + "\t\t\"UID\": 0,\n" + "\t\t\"pubDate\": \"2005-03-28\"\n"
+            + "\t}, {\n" + "\t\t\"field\": \"tokens\",\n"
             + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
             + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
             + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
             + "\t\t\"docSigle\": \"WPD_AAA\",\n"
-            + "\t\t\"corpusSigle\": \"WPD\",\n"
-            + "\t\t\"title\": \"A\",\n"
+            + "\t\t\"corpusSigle\": \"WPD\",\n" + "\t\t\"title\": \"A\",\n"
             + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
             + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
-            + "\t\t\"startMore\": true,\n"
-            + "\t\t\"endMore\": true,\n"
+            + "\t\t\"startMore\": true,\n" + "\t\t\"endMore\": true,\n"
             + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>von rechts nach links) versahen sie </span><mark>das</mark><span class=\\\"context-right\\\"> Zeichen mit einem Abschwung nach links<span class=\\\"more\\\"></span></span>\",\n"
             + "\t\t\"matchID\": \"match-WPD_AAA.00001-p365-366\",\n"
-            + "\t\t\"UID\": 0,\n"
-            + "\t\t\"pubDate\": \"2005-03-28\"\n"
-            + "\t}, {\n"
-            + "\t\t\"field\": \"tokens\",\n"
+            + "\t\t\"UID\": 0,\n" + "\t\t\"pubDate\": \"2005-03-28\"\n"
+            + "\t}, {\n" + "\t\t\"field\": \"tokens\",\n"
             + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
             + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
             + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
             + "\t\t\"docSigle\": \"WPD_AAA\",\n"
-            + "\t\t\"corpusSigle\": \"WPD\",\n"
-            + "\t\t\"title\": \"A\",\n"
+            + "\t\t\"corpusSigle\": \"WPD\",\n" + "\t\t\"title\": \"A\",\n"
             + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
             + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
-            + "\t\t\"startMore\": true,\n"
-            + "\t\t\"endMore\": true,\n"
+            + "\t\t\"startMore\": true,\n" + "\t\t\"endMore\": true,\n"
             + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>Abschwung nach links. Als die Römer </span><mark>das</mark><span class=\\\"context-right\\\"> lateinische Alphabet schufen, verwendeten sie das<span class=\\\"more\\\"></span></span>\",\n"
             + "\t\t\"matchID\": \"match-WPD_AAA.00001-p375-376\",\n"
-            + "\t\t\"UID\": 0,\n"
-            + "\t\t\"pubDate\": \"2005-03-28\"\n"
-            + "\t}, {\n"
-            + "\t\t\"field\": \"tokens\",\n"
+            + "\t\t\"UID\": 0,\n" + "\t\t\"pubDate\": \"2005-03-28\"\n"
+            + "\t}, {\n" + "\t\t\"field\": \"tokens\",\n"
             + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
             + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
             + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
             + "\t\t\"docSigle\": \"WPD_AAA\",\n"
-            + "\t\t\"corpusSigle\": \"WPD\",\n"
-            + "\t\t\"title\": \"A\",\n"
+            + "\t\t\"corpusSigle\": \"WPD\",\n" + "\t\t\"title\": \"A\",\n"
             + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
             + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
-            + "\t\t\"startMore\": true,\n"
-            + "\t\t\"endMore\": true,\n"
+            + "\t\t\"startMore\": true,\n" + "\t\t\"endMore\": true,\n"
             + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>das lateinische Alphabet schufen, verwendeten sie </span><mark>das</mark><span class=\\\"context-right\\\"> A aus dem etruskischen Alphabet, der<span class=\\\"more\\\"></span></span>\",\n"
             + "\t\t\"matchID\": \"match-WPD_AAA.00001-p381-382\",\n"
-            + "\t\t\"UID\": 0,\n"
-            + "\t\t\"pubDate\": \"2005-03-28\"\n"
-            + "\t}, {\n"
-            + "\t\t\"field\": \"tokens\",\n"
+            + "\t\t\"UID\": 0,\n" + "\t\t\"pubDate\": \"2005-03-28\"\n"
+            + "\t}, {\n" + "\t\t\"field\": \"tokens\",\n"
             + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
             + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
             + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
             + "\t\t\"docSigle\": \"WPD_AAA\",\n"
-            + "\t\t\"corpusSigle\": \"WPD\",\n"
-            + "\t\t\"title\": \"A\",\n"
+            + "\t\t\"corpusSigle\": \"WPD\",\n" + "\t\t\"title\": \"A\",\n"
             + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
             + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
-            + "\t\t\"startMore\": true,\n"
-            + "\t\t\"endMore\": true,\n"
+            + "\t\t\"startMore\": true,\n" + "\t\t\"endMore\": true,\n"
             + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>in der Biologie steht A für </span><mark>das</mark><span class=\\\"context-right\\\"> Nukleosid Adenosin steht A die Base<span class=\\\"more\\\"></span></span>\",\n"
             + "\t\t\"matchID\": \"match-WPD_AAA.00001-p404-405\",\n"
-            + "\t\t\"UID\": 0,\n"
-            + "\t\t\"pubDate\": \"2005-03-28\"\n"
-            + "\t}, {\n"
-            + "\t\t\"field\": \"tokens\",\n"
+            + "\t\t\"UID\": 0,\n" + "\t\t\"pubDate\": \"2005-03-28\"\n"
+            + "\t}, {\n" + "\t\t\"field\": \"tokens\",\n"
             + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
             + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
             + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
             + "\t\t\"docSigle\": \"WPD_AAA\",\n"
-            + "\t\t\"corpusSigle\": \"WPD\",\n"
-            + "\t\t\"title\": \"A\",\n"
+            + "\t\t\"corpusSigle\": \"WPD\",\n" + "\t\t\"title\": \"A\",\n"
             + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
             + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
-            + "\t\t\"startMore\": true,\n"
-            + "\t\t\"endMore\": true,\n"
+            + "\t\t\"startMore\": true,\n" + "\t\t\"endMore\": true,\n"
             + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>Wert 10, siehe auch Hexadezimalsystem. steht </span><mark>das</mark><span class=\\\"context-right\\\"> Symbol ∀ (ein auf den Kopf gestelltes<span class=\\\"more\\\"></span></span>\",\n"
             + "\t\t\"matchID\": \"match-WPD_AAA.00001-p526-527\",\n"
-            + "\t\t\"UID\": 0,\n"
-            + "\t\t\"pubDate\": \"2005-03-28\"\n"
-            + "\t}, {\n"
-            + "\t\t\"field\": \"tokens\",\n"
+            + "\t\t\"UID\": 0,\n" + "\t\t\"pubDate\": \"2005-03-28\"\n"
+            + "\t}, {\n" + "\t\t\"field\": \"tokens\",\n"
             + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
             + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
             + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
             + "\t\t\"docSigle\": \"WPD_AAA\",\n"
-            + "\t\t\"corpusSigle\": \"WPD\",\n"
-            + "\t\t\"title\": \"A\",\n"
+            + "\t\t\"corpusSigle\": \"WPD\",\n" + "\t\t\"title\": \"A\",\n"
             + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
             + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
-            + "\t\t\"startMore\": true,\n"
-            + "\t\t\"endMore\": true,\n"
+            + "\t\t\"startMore\": true,\n" + "\t\t\"endMore\": true,\n"
             + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>für die Vorsilbe Atto ist A </span><mark>das</mark><span class=\\\"context-right\\\"> Einheitensymbol der elektrischen Stromstärke Ampere in<span class=\\\"more\\\"></span></span>\",\n"
             + "\t\t\"matchID\": \"match-WPD_AAA.00001-p624-625\",\n"
-            + "\t\t\"UID\": 0,\n"
-            + "\t\t\"pubDate\": \"2005-03-28\"\n"
-            + "\t}, {\n"
-            + "\t\t\"field\": \"tokens\",\n"
+            + "\t\t\"UID\": 0,\n" + "\t\t\"pubDate\": \"2005-03-28\"\n"
+            + "\t}, {\n" + "\t\t\"field\": \"tokens\",\n"
             + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
             + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
             + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
             + "\t\t\"docSigle\": \"WPD_AAA\",\n"
-            + "\t\t\"corpusSigle\": \"WPD\",\n"
-            + "\t\t\"title\": \"A\",\n"
+            + "\t\t\"corpusSigle\": \"WPD\",\n" + "\t\t\"title\": \"A\",\n"
             + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
             + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
-            + "\t\t\"startMore\": true,\n"
-            + "\t\t\"endMore\": true,\n"
+            + "\t\t\"startMore\": true,\n" + "\t\t\"endMore\": true,\n"
             + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>Anordnung (Rechtswesen), Agent (Börse), Aufzeichung (Rechtsw.), </span><mark>das</mark><span class=\\\"context-right\\\"> Flächenmaß Acre und Ausgabe A ist<span class=\\\"more\\\"></span></span>\",\n"
             + "\t\t\"matchID\": \"match-WPD_AAA.00001-p757-758\",\n"
-            + "\t\t\"UID\": 0,\n"
-            + "\t\t\"pubDate\": \"2005-03-28\"\n"
-            + "\t}, {\n"
-            + "\t\t\"field\": \"tokens\",\n"
+            + "\t\t\"UID\": 0,\n" + "\t\t\"pubDate\": \"2005-03-28\"\n"
+            + "\t}, {\n" + "\t\t\"field\": \"tokens\",\n"
             + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
             + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
             + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
             + "\t\t\"docSigle\": \"WPD_AAA\",\n"
-            + "\t\t\"corpusSigle\": \"WPD\",\n"
-            + "\t\t\"title\": \"A\",\n"
+            + "\t\t\"corpusSigle\": \"WPD\",\n" + "\t\t\"title\": \"A\",\n"
             + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
             + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
-            + "\t\t\"startMore\": true,\n"
-            + "\t\t\"endMore\": true,\n"
+            + "\t\t\"startMore\": true,\n" + "\t\t\"endMore\": true,\n"
             + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>Band). in Redewendungen für den Anfang (</span><mark>das</mark><span class=\\\"context-right\\\"> A und O, von A bis<span class=\\\"more\\\"></span></span>\",\n"
             + "\t\t\"matchID\": \"match-WPD_AAA.00001-p777-778\",\n"
-            + "\t\t\"UID\": 0,\n"
-            + "\t\t\"pubDate\": \"2005-03-28\"\n"
-            + "\t}, {\n"
-            + "\t\t\"field\": \"tokens\",\n"
+            + "\t\t\"UID\": 0,\n" + "\t\t\"pubDate\": \"2005-03-28\"\n"
+            + "\t}, {\n" + "\t\t\"field\": \"tokens\",\n"
             + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
             + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
             + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
             + "\t\t\"docSigle\": \"WPD_AAA\",\n"
-            + "\t\t\"corpusSigle\": \"WPD\",\n"
-            + "\t\t\"title\": \"A\",\n"
+            + "\t\t\"corpusSigle\": \"WPD\",\n" + "\t\t\"title\": \"A\",\n"
             + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
             + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
-            + "\t\t\"startMore\": true,\n"
-            + "\t\t\"endMore\": true,\n"
+            + "\t\t\"startMore\": true,\n" + "\t\t\"endMore\": true,\n"
             + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>Z). a ist die Abkürzung für </span><mark>das</mark><span class=\\\"context-right\\\"> Flächenmaß Ar in der Kaufmannssprache bedeutet<span class=\\\"more\\\"></span></span>\",\n"
             + "\t\t\"matchID\": \"match-WPD_AAA.00001-p790-791\",\n"
-            + "\t\t\"UID\": 0,\n"
-            + "\t\t\"pubDate\": \"2005-03-28\"\n"
-            + "\t}, {\n"
-            + "\t\t\"field\": \"tokens\",\n"
+            + "\t\t\"UID\": 0,\n" + "\t\t\"pubDate\": \"2005-03-28\"\n"
+            + "\t}, {\n" + "\t\t\"field\": \"tokens\",\n"
             + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
             + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
             + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
             + "\t\t\"docSigle\": \"WPD_AAA\",\n"
-            + "\t\t\"corpusSigle\": \"WPD\",\n"
-            + "\t\t\"title\": \"A\",\n"
+            + "\t\t\"corpusSigle\": \"WPD\",\n" + "\t\t\"title\": \"A\",\n"
             + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
             + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
-            + "\t\t\"startMore\": true,\n"
-            + "\t\t\"endMore\": true,\n"
+            + "\t\t\"startMore\": true,\n" + "\t\t\"endMore\": true,\n"
             + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>ad zu) ‚[das Stück] zu...‘ für </span><mark>das</mark><span class=\\\"context-right\\\"> Französische à „nach“, z. B. in<span class=\\\"more\\\"></span></span>\",\n"
             + "\t\t\"matchID\": \"match-WPD_AAA.00001-p805-806\",\n"
             + "\t\t\"UID\": 0,\n" + "\t\t\"pubDate\": \"2005-03-28\"\n"
             + "\t}]\n" + "}";
 
-
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/dao/RolePrivilegeDaoTest.java b/full/src/test/java/de/ids_mannheim/korap/dao/RolePrivilegeDaoTest.java
index 59ca413..13b2c91 100644
--- a/full/src/test/java/de/ids_mannheim/korap/dao/RolePrivilegeDaoTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/dao/RolePrivilegeDaoTest.java
@@ -27,13 +27,14 @@
     private PrivilegeDao privilegeDao;
 
     @Test
-    public void retrievePredefinedRole() {
-        Role r = roleDao.retrieveRoleById(PredefinedRole.USER_GROUP_ADMIN.getId());
+    public void retrievePredefinedRole () {
+        Role r = roleDao
+                .retrieveRoleById(PredefinedRole.USER_GROUP_ADMIN.getId());
         assertEquals(1, r.getId());
     }
 
     @Test
-    public void createDeleteRole() {
+    public void createDeleteRole () {
         String roleName = "vc editor";
         List<PrivilegeType> privileges = new ArrayList<PrivilegeType>();
         privileges.add(PrivilegeType.READ);
@@ -46,7 +47,7 @@
     }
 
     @Test
-    public void updateRole() {
+    public void updateRole () {
         Role role = roleDao.retrieveRoleByName("USER_GROUP_MEMBER");
         roleDao.editRoleName(role.getId(), "USER_GROUP_MEMBER role");
         role = roleDao.retrieveRoleById(role.getId());
@@ -57,7 +58,7 @@
     }
 
     @Test
-    public void addDeletePrivilegeOfExistingRole() {
+    public void addDeletePrivilegeOfExistingRole () {
         Role role = roleDao.retrieveRoleByName("USER_GROUP_MEMBER");
         List<Privilege> privileges = role.getPrivileges();
         assertEquals(1, role.getPrivileges().size());
diff --git a/full/src/test/java/de/ids_mannheim/korap/dao/UserGroupDaoTest.java b/full/src/test/java/de/ids_mannheim/korap/dao/UserGroupDaoTest.java
index dd5fcf5..1ee65bf 100644
--- a/full/src/test/java/de/ids_mannheim/korap/dao/UserGroupDaoTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/dao/UserGroupDaoTest.java
@@ -47,11 +47,12 @@
     private FullConfiguration config;
 
     @Test
-    public void createDeleteNewUserGroup() throws KustvaktException {
+    public void createDeleteNewUserGroup () throws KustvaktException {
         String groupName = "test group";
         String createdBy = "test class";
         // create group
-        int groupId = userGroupDao.createGroup(groupName, null, createdBy, UserGroupStatus.ACTIVE);
+        int groupId = userGroupDao.createGroup(groupName, null, createdBy,
+                UserGroupStatus.ACTIVE);
         // retrieve group
         UserGroup group = userGroupDao.retrieveGroupById(groupId, true);
         assertEquals(groupName, group.getName());
@@ -71,39 +72,47 @@
         ArrayList<Role> roleList = new ArrayList<>(2);
         roleList.addAll(roles);
         Collections.sort(roleList);
-        assertEquals(PredefinedRole.USER_GROUP_ADMIN.getId(), roleList.get(0).getId());
-        assertEquals(PredefinedRole.VC_ACCESS_ADMIN.getId(), roleList.get(1).getId());
+        assertEquals(PredefinedRole.USER_GROUP_ADMIN.getId(),
+                roleList.get(0).getId());
+        assertEquals(PredefinedRole.VC_ACCESS_ADMIN.getId(),
+                roleList.get(1).getId());
         // retrieve VC by group
         List<QueryDO> vc = virtualCorpusDao.retrieveQueryByGroup(groupId);
         assertEquals(0, vc.size());
         // soft delete group
-        userGroupDao.deleteGroup(groupId, createdBy, config.isSoftDeleteGroup());
+        userGroupDao.deleteGroup(groupId, createdBy,
+                config.isSoftDeleteGroup());
         group = userGroupDao.retrieveGroupById(groupId);
         assertEquals(UserGroupStatus.DELETED, group.getStatus());
         // hard delete
         userGroupDao.deleteGroup(groupId, createdBy, false);
-        KustvaktException exception = assertThrows(KustvaktException.class, () -> {
-            userGroupDao.retrieveGroupById(groupId);
-        });
-        assertEquals(StatusCodes.NO_RESOURCE_FOUND, exception.getStatusCode().intValue());
+        KustvaktException exception = assertThrows(KustvaktException.class,
+                () -> {
+                    userGroupDao.retrieveGroupById(groupId);
+                });
+        assertEquals(StatusCodes.NO_RESOURCE_FOUND,
+                exception.getStatusCode().intValue());
     }
 
     @Test
-    public void retrieveGroupWithMembers() throws KustvaktException {
+    public void retrieveGroupWithMembers () throws KustvaktException {
         // dory group
-        List<UserGroupMember> members = userGroupDao.retrieveGroupById(2, true).getMembers();
+        List<UserGroupMember> members = userGroupDao.retrieveGroupById(2, true)
+                .getMembers();
         assertEquals(4, members.size());
         UserGroupMember m = members.get(1);
         Set<Role> roles = m.getRoles();
         assertEquals(2, roles.size());
         List<Role> sortedRoles = new ArrayList<>(roles);
         Collections.sort(sortedRoles);
-        assertEquals(PredefinedRole.USER_GROUP_MEMBER.name(), sortedRoles.get(0).getName());
-        assertEquals(PredefinedRole.VC_ACCESS_MEMBER.name(), sortedRoles.get(1).getName());
+        assertEquals(PredefinedRole.USER_GROUP_MEMBER.name(),
+                sortedRoles.get(0).getName());
+        assertEquals(PredefinedRole.VC_ACCESS_MEMBER.name(),
+                sortedRoles.get(1).getName());
     }
 
     @Test
-    public void retrieveGroupByUserId() throws KustvaktException {
+    public void retrieveGroupByUserId () throws KustvaktException {
         List<UserGroup> group = userGroupDao.retrieveGroupByUserId("dory");
         assertEquals(2, group.size());
         group = userGroupDao.retrieveGroupByUserId("pearl");
@@ -111,15 +120,18 @@
     }
 
     @Test
-    public void addVCToGroup() throws KustvaktException {
+    public void addVCToGroup () throws KustvaktException {
         // dory group
         int groupId = 2;
         UserGroup group = userGroupDao.retrieveGroupById(groupId);
         String createdBy = "dory";
         String name = "dory new vc";
-        int id = virtualCorpusDao.createQuery(name, ResourceType.PROJECT, QueryType.VIRTUAL_CORPUS, CorpusAccess.PUB, "corpusSigle=WPD15", "", "", "", false, createdBy, null, null);
+        int id = virtualCorpusDao.createQuery(name, ResourceType.PROJECT,
+                QueryType.VIRTUAL_CORPUS, CorpusAccess.PUB, "corpusSigle=WPD15",
+                "", "", "", false, createdBy, null, null);
         QueryDO virtualCorpus = virtualCorpusDao.retrieveQueryById(id);
-        userGroupDao.addQueryToGroup(virtualCorpus, createdBy, QueryAccessStatus.ACTIVE, group);
+        userGroupDao.addQueryToGroup(virtualCorpus, createdBy,
+                QueryAccessStatus.ACTIVE, group);
         List<QueryDO> vc = virtualCorpusDao.retrieveQueryByGroup(groupId);
         assertEquals(2, vc.size());
         assertEquals(name, vc.get(1).getName());
diff --git a/full/src/test/java/de/ids_mannheim/korap/dao/UserGroupMemberDaoTest.java b/full/src/test/java/de/ids_mannheim/korap/dao/UserGroupMemberDaoTest.java
index 93e3b78..e3fdc87 100644
--- a/full/src/test/java/de/ids_mannheim/korap/dao/UserGroupMemberDaoTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/dao/UserGroupMemberDaoTest.java
@@ -27,19 +27,21 @@
     private RoleDao roleDao;
 
     @Test
-    public void testRetrieveMemberByRole() throws KustvaktException {
+    public void testRetrieveMemberByRole () throws KustvaktException {
         // dory group
-        List<UserGroupMember> vcaAdmins = dao.retrieveMemberByRole(2, PredefinedRole.VC_ACCESS_ADMIN.getId());
+        List<UserGroupMember> vcaAdmins = dao.retrieveMemberByRole(2,
+                PredefinedRole.VC_ACCESS_ADMIN.getId());
         // System.out.println(vcaAdmins);
         assertEquals(1, vcaAdmins.size());
         assertEquals(vcaAdmins.get(0).getUserId(), "dory");
     }
 
     @Test
-    public void testAddSameMemberRole() throws KustvaktException {
+    public void testAddSameMemberRole () throws KustvaktException {
         UserGroupMember member = dao.retrieveMemberById("dory", 1);
         Set<Role> roles = member.getRoles();
-        Role adminRole = roleDao.retrieveRoleById(PredefinedRole.USER_GROUP_ADMIN.getId());
+        Role adminRole = roleDao
+                .retrieveRoleById(PredefinedRole.USER_GROUP_ADMIN.getId());
         roles.add(adminRole);
         member.setRoles(roles);
         dao.updateMember(member);
diff --git a/full/src/test/java/de/ids_mannheim/korap/dao/VirtualCorpusAccessDaoTest.java b/full/src/test/java/de/ids_mannheim/korap/dao/VirtualCorpusAccessDaoTest.java
index 6be38cf..72f1e0f 100644
--- a/full/src/test/java/de/ids_mannheim/korap/dao/VirtualCorpusAccessDaoTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/dao/VirtualCorpusAccessDaoTest.java
@@ -23,7 +23,7 @@
     private QueryAccessDao dao;
 
     @Test
-    public void getAccessByVC() throws KustvaktException {
+    public void getAccessByVC () throws KustvaktException {
         List<QueryAccess> vcaList = dao.retrieveActiveAccessByQuery(2);
         QueryAccess access = vcaList.get(0);
         assertEquals(QueryAccessStatus.ACTIVE, access.getStatus());
diff --git a/full/src/test/java/de/ids_mannheim/korap/dao/VirtualCorpusDaoTest.java b/full/src/test/java/de/ids_mannheim/korap/dao/VirtualCorpusDaoTest.java
index 95af5dc..cfd226b 100644
--- a/full/src/test/java/de/ids_mannheim/korap/dao/VirtualCorpusDaoTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/dao/VirtualCorpusDaoTest.java
@@ -25,8 +25,9 @@
     private QueryDao dao;
 
     @Test
-    public void testListVCByType() throws KustvaktException {
-        List<QueryDO> vcList = dao.retrieveQueryByType(ResourceType.PUBLISHED, null, QueryType.VIRTUAL_CORPUS);
+    public void testListVCByType () throws KustvaktException {
+        List<QueryDO> vcList = dao.retrieveQueryByType(ResourceType.PUBLISHED,
+                null, QueryType.VIRTUAL_CORPUS);
         assertEquals(1, vcList.size());
         QueryDO vc = vcList.get(0);
         assertEquals(4, vc.getId());
@@ -35,40 +36,48 @@
     }
 
     @Test
-    public void testSystemVC() throws KustvaktException {
+    public void testSystemVC () throws KustvaktException {
         // insert vc
-        int id = dao.createQuery("system-vc", ResourceType.SYSTEM, QueryType.VIRTUAL_CORPUS, User.CorpusAccess.FREE, "corpusSigle=GOE", "definition", "description", "experimental", false, "test class", null, null);
+        int id = dao.createQuery("system-vc", ResourceType.SYSTEM,
+                QueryType.VIRTUAL_CORPUS, User.CorpusAccess.FREE,
+                "corpusSigle=GOE", "definition", "description", "experimental",
+                false, "test class", null, null);
         // select vc
-        List<QueryDO> vcList = dao.retrieveQueryByType(ResourceType.SYSTEM, null, QueryType.VIRTUAL_CORPUS);
+        List<QueryDO> vcList = dao.retrieveQueryByType(ResourceType.SYSTEM,
+                null, QueryType.VIRTUAL_CORPUS);
         assertEquals(2, vcList.size());
         QueryDO vc = dao.retrieveQueryById(id);
         // delete vc
         dao.deleteQuery(vc);
         // check if vc has been deleted
-        KustvaktException exception = assertThrows(KustvaktException.class, () -> {
-            dao.retrieveQueryById(id);
-        });
-        assertEquals(StatusCodes.NO_RESOURCE_FOUND, exception.getStatusCode().intValue());
+        KustvaktException exception = assertThrows(KustvaktException.class,
+                () -> {
+                    dao.retrieveQueryById(id);
+                });
+        assertEquals(StatusCodes.NO_RESOURCE_FOUND,
+                exception.getStatusCode().intValue());
     }
 
     @Test
     public void testNonUniqueVC () throws KustvaktException {
-        
-        PersistenceException exception = assertThrows(PersistenceException.class, ()->{
-            dao.createQuery("system-vc", ResourceType.SYSTEM,
-                    QueryType.VIRTUAL_CORPUS, User.CorpusAccess.FREE,
-                    "corpusSigle=GOE", "definition", "description", "experimental",
-                    false, "system", null, null);
-        });
-        
+
+        PersistenceException exception = assertThrows(
+                PersistenceException.class, () -> {
+                    dao.createQuery("system-vc", ResourceType.SYSTEM,
+                            QueryType.VIRTUAL_CORPUS, User.CorpusAccess.FREE,
+                            "corpusSigle=GOE", "definition", "description",
+                            "experimental", false, "system", null, null);
+                });
+
         assertEquals(exception.getMessage(),
                 "Converting `org.hibernate.exception.GenericJDBCException` "
-                + "to JPA `PersistenceException` : could not execute statement");
+                        + "to JPA `PersistenceException` : could not execute statement");
     }
 
     @Test
-    public void retrieveSystemVC() throws KustvaktException {
-        List<QueryDO> vc = dao.retrieveQueryByType(ResourceType.SYSTEM, null, QueryType.VIRTUAL_CORPUS);
+    public void retrieveSystemVC () throws KustvaktException {
+        List<QueryDO> vc = dao.retrieveQueryByType(ResourceType.SYSTEM, null,
+                QueryType.VIRTUAL_CORPUS);
         assertEquals(1, vc.size());
     }
 
@@ -78,8 +87,9 @@
      * @throws KustvaktException
      */
     @Test
-    public void retrieveVCByUserDory() throws KustvaktException {
-        List<QueryDO> virtualCorpora = dao.retrieveQueryByUser("dory", QueryType.VIRTUAL_CORPUS);
+    public void retrieveVCByUserDory () throws KustvaktException {
+        List<QueryDO> virtualCorpora = dao.retrieveQueryByUser("dory",
+                QueryType.VIRTUAL_CORPUS);
         // System.out.println(virtualCorpora);
         assertEquals(4, virtualCorpora.size());
         // ordered by id
@@ -97,8 +107,9 @@
      * @throws KustvaktException
      */
     @Test
-    public void retrieveVCByUserNemo() throws KustvaktException {
-        List<QueryDO> virtualCorpora = dao.retrieveQueryByUser("nemo", QueryType.VIRTUAL_CORPUS);
+    public void retrieveVCByUserNemo () throws KustvaktException {
+        List<QueryDO> virtualCorpora = dao.retrieveQueryByUser("nemo",
+                QueryType.VIRTUAL_CORPUS);
         assertEquals(3, virtualCorpora.size());
         Iterator<QueryDO> i = virtualCorpora.iterator();
         assertEquals(i.next().getName(), "group-vc");
@@ -113,8 +124,9 @@
      * @throws KustvaktException
      */
     @Test
-    public void retrieveVCByUserMarlin() throws KustvaktException {
-        List<QueryDO> virtualCorpora = dao.retrieveQueryByUser("marlin", QueryType.VIRTUAL_CORPUS);
+    public void retrieveVCByUserMarlin () throws KustvaktException {
+        List<QueryDO> virtualCorpora = dao.retrieveQueryByUser("marlin",
+                QueryType.VIRTUAL_CORPUS);
         assertEquals(3, virtualCorpora.size());
         Iterator<QueryDO> i = virtualCorpora.iterator();
         assertEquals(i.next().getName(), "system-vc");
@@ -129,8 +141,9 @@
      * @throws KustvaktException
      */
     @Test
-    public void retrieveVCByUserPearl() throws KustvaktException {
-        List<QueryDO> virtualCorpora = dao.retrieveQueryByUser("pearl", QueryType.VIRTUAL_CORPUS);
+    public void retrieveVCByUserPearl () throws KustvaktException {
+        List<QueryDO> virtualCorpora = dao.retrieveQueryByUser("pearl",
+                QueryType.VIRTUAL_CORPUS);
         assertEquals(2, virtualCorpora.size());
         Iterator<QueryDO> i = virtualCorpora.iterator();
         assertEquals(i.next().getName(), "system-vc");
diff --git a/full/src/test/java/de/ids_mannheim/korap/misc/BCryptTest.java b/full/src/test/java/de/ids_mannheim/korap/misc/BCryptTest.java
index a679a12..ce1abb3 100644
--- a/full/src/test/java/de/ids_mannheim/korap/misc/BCryptTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/misc/BCryptTest.java
@@ -8,7 +8,7 @@
 public class BCryptTest {
 
     @Test
-    public void testSalt() {
+    public void testSalt () {
         String salt = BCrypt.gensalt(8);
         // System.out.println(salt);
         String plain = "secret";
diff --git a/full/src/test/java/de/ids_mannheim/korap/misc/CollectionQueryBuilderTest.java b/full/src/test/java/de/ids_mannheim/korap/misc/CollectionQueryBuilderTest.java
index 980d749..0935f6c 100644
--- a/full/src/test/java/de/ids_mannheim/korap/misc/CollectionQueryBuilderTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/misc/CollectionQueryBuilderTest.java
@@ -17,7 +17,7 @@
 public class CollectionQueryBuilderTest {
 
     @Test
-    public void testsimpleAdd() throws KustvaktException {
+    public void testsimpleAdd () throws KustvaktException {
         KoralCollectionQueryBuilder b = new KoralCollectionQueryBuilder();
         b.with("corpusSigle=WPD");
         JsonNode node = JsonUtils.readTree(b.toJSON());
@@ -27,41 +27,48 @@
     }
 
     @Test
-    public void testSimpleConjunction() throws KustvaktException {
+    public void testSimpleConjunction () throws KustvaktException {
         KoralCollectionQueryBuilder b = new KoralCollectionQueryBuilder();
         b.with("corpusSigle=WPD & textClass=freizeit");
         JsonNode node = JsonUtils.readTree(b.toJSON());
         assertNotNull(node);
         assertEquals(node.at("/collection/@type").asText(), "koral:docGroup");
-        assertEquals(node.at("/collection/operation").asText(), "operation:and");
-        assertEquals(node.at("/collection/operands/0/key").asText(), "corpusSigle");
-        assertEquals(node.at("/collection/operands/1/key").asText(), "textClass");
+        assertEquals(node.at("/collection/operation").asText(),
+                "operation:and");
+        assertEquals(node.at("/collection/operands/0/key").asText(),
+                "corpusSigle");
+        assertEquals(node.at("/collection/operands/1/key").asText(),
+                "textClass");
     }
 
     @Test
-    public void testSimpleDisjunction() throws KustvaktException {
+    public void testSimpleDisjunction () throws KustvaktException {
         KoralCollectionQueryBuilder b = new KoralCollectionQueryBuilder();
         b.with("corpusSigle=WPD | textClass=freizeit");
         JsonNode node = JsonUtils.readTree(b.toJSON());
         assertNotNull(node);
         assert node.at("/collection/operation").asText().equals("operation:or");
-        assert node.at("/collection/operands/0/key").asText().equals("corpusSigle");
-        assert node.at("/collection/operands/1/key").asText().equals("textClass");
+        assert node.at("/collection/operands/0/key").asText()
+                .equals("corpusSigle");
+        assert node.at("/collection/operands/1/key").asText()
+                .equals("textClass");
     }
 
     @Test
-    public void testComplexSubQuery() throws KustvaktException {
+    public void testComplexSubQuery () throws KustvaktException {
         KoralCollectionQueryBuilder b = new KoralCollectionQueryBuilder();
         b.with("(corpusSigle=WPD) | (textClass=freizeit & corpusSigle=BRZ13)");
         JsonNode node = JsonUtils.readTree(b.toJSON());
         assertNotNull(node);
         assert node.at("/collection/operation").asText().equals("operation:or");
-        assert node.at("/collection/operands/0/key").asText().equals("corpusSigle");
-        assert node.at("/collection/operands/1/@type").asText().equals("koral:docGroup");
+        assert node.at("/collection/operands/0/key").asText()
+                .equals("corpusSigle");
+        assert node.at("/collection/operands/1/@type").asText()
+                .equals("koral:docGroup");
     }
 
     @Test
-    public void testAddResourceQueryAfter() throws KustvaktException {
+    public void testAddResourceQueryAfter () throws KustvaktException {
         KoralCollectionQueryBuilder b = new KoralCollectionQueryBuilder();
         b.with("(textClass=politik & title=\"random title\") | textClass=wissenschaft");
         KoralCollectionQueryBuilder c = new KoralCollectionQueryBuilder();
@@ -69,19 +76,26 @@
         c.with("corpusSigle=WPD");
         JsonNode node = JsonUtils.readTree(c.toJSON());
         assertNotNull(node);
-        assertEquals(node.at("/collection/operands/1/@type").asText(), "koral:doc");
-        assertEquals(node.at("/collection/operands/0/@type").asText(), "koral:docGroup");
+        assertEquals(node.at("/collection/operands/1/@type").asText(),
+                "koral:doc");
+        assertEquals(node.at("/collection/operands/0/@type").asText(),
+                "koral:docGroup");
         assertEquals(2, node.at("/collection/operands").size());
         assertEquals(2, node.at("/collection/operands/0/operands").size());
-        assertEquals(2, node.at("/collection/operands/0/operands/0/operands").size());
-        assertEquals(node.at("/collection/operation").asText(), "operation:and");
-        assertEquals(node.at("/collection/operands/0/operation").asText(), "operation:or");
-        assertEquals(node.at("/collection/operands/0/operands/0/operation").asText(), "operation:and");
+        assertEquals(2,
+                node.at("/collection/operands/0/operands/0/operands").size());
+        assertEquals(node.at("/collection/operation").asText(),
+                "operation:and");
+        assertEquals(node.at("/collection/operands/0/operation").asText(),
+                "operation:or");
+        assertEquals(
+                node.at("/collection/operands/0/operands/0/operation").asText(),
+                "operation:and");
         assertEquals(node.at("/collection/operands/1/value").asText(), "WPD");
     }
 
     @Test
-    public void testAddComplexResourceQueryAfter() throws KustvaktException {
+    public void testAddComplexResourceQueryAfter () throws KustvaktException {
         KoralCollectionQueryBuilder b = new KoralCollectionQueryBuilder();
         b.with("(title=\"random title\") | (textClass=wissenschaft)");
         KoralCollectionQueryBuilder c = new KoralCollectionQueryBuilder();
@@ -89,16 +103,26 @@
         c.with("(corpusSigle=BRZ13 | corpusSigle=AZPS)");
         JsonNode node = JsonUtils.readTree(c.toJSON());
         assertNotNull(node);
-        assertEquals(node.at("/collection/operands/0/@type").asText(), "koral:docGroup");
-        assertEquals(node.at("/collection/operands/1/@type").asText(), "koral:docGroup");
-        assertEquals(node.at("/collection/operands/1/operands/0/value").asText(), "BRZ13");
-        assertEquals(node.at("/collection/operands/1/operands/1/value").asText(), "AZPS");
-        assertEquals(node.at("/collection/operands/0/operands/0/value").asText(), "random title");
-        assertEquals(node.at("/collection/operands/0/operands/1/value").asText(), "wissenschaft");
+        assertEquals(node.at("/collection/operands/0/@type").asText(),
+                "koral:docGroup");
+        assertEquals(node.at("/collection/operands/1/@type").asText(),
+                "koral:docGroup");
+        assertEquals(
+                node.at("/collection/operands/1/operands/0/value").asText(),
+                "BRZ13");
+        assertEquals(
+                node.at("/collection/operands/1/operands/1/value").asText(),
+                "AZPS");
+        assertEquals(
+                node.at("/collection/operands/0/operands/0/value").asText(),
+                "random title");
+        assertEquals(
+                node.at("/collection/operands/0/operands/1/value").asText(),
+                "wissenschaft");
     }
 
     @Test
-    public void testBuildQuery() throws KustvaktException {
+    public void testBuildQuery () throws KustvaktException {
         String coll = "corpusSigle=WPD";
         String query = "[base=Haus]";
         QuerySerializer check = new QuerySerializer();
@@ -111,12 +135,17 @@
         assertNotNull(res);
         assertEquals(res.at("/collection/@type").asText(), "koral:docGroup");
         assertEquals(res.at("/collection/operation").asText(), "operation:and");
-        assertEquals(res.at("/collection/operands/0/@type").asText(), "koral:doc");
-        assertEquals(res.at("/collection/operands/1/value").asText(), "freizeit");
-        assertEquals(res.at("/collection/operands/1/key").asText(), "textClass");
-        assertEquals(res.at("/collection/operands/1/@type").asText(), "koral:doc");
+        assertEquals(res.at("/collection/operands/0/@type").asText(),
+                "koral:doc");
+        assertEquals(res.at("/collection/operands/1/value").asText(),
+                "freizeit");
+        assertEquals(res.at("/collection/operands/1/key").asText(),
+                "textClass");
+        assertEquals(res.at("/collection/operands/1/@type").asText(),
+                "koral:doc");
         assertEquals(res.at("/collection/operands/0/value").asText(), "WPD");
-        assertEquals(res.at("/collection/operands/0/key").asText(), "corpusSigle");
+        assertEquals(res.at("/collection/operands/0/key").asText(),
+                "corpusSigle");
         // check also that query is still there
         assertEquals(res.at("/query/@type").asText(), "koral:token");
         assertEquals(res.at("/query/wrap/@type").asText(), "koral:term");
@@ -125,7 +154,7 @@
     }
 
     @Test
-    public void testBaseQueryBuild() throws KustvaktException {
+    public void testBaseQueryBuild () throws KustvaktException {
         KoralCollectionQueryBuilder b = new KoralCollectionQueryBuilder();
         b.with("(corpusSigle=ADF) | (textClass=freizeit & corpusSigle=WPD)");
         KoralCollectionQueryBuilder c = new KoralCollectionQueryBuilder();
@@ -134,14 +163,16 @@
         JsonNode base = (JsonNode) c.rebaseCollection();
         assertNotNull(base);
         assertEquals(base.at("/collection/@type").asText(), "koral:docGroup");
-        assertEquals(base.at("/collection/operands/1/@type").asText(), "koral:doc");
+        assertEquals(base.at("/collection/operands/1/@type").asText(),
+                "koral:doc");
         assertEquals(base.at("/collection/operands/1/value").asText(), "BRZ13");
-        assertEquals(base.at("/collection/operands/0/@type").asText(), "koral:docGroup");
+        assertEquals(base.at("/collection/operands/0/@type").asText(),
+                "koral:docGroup");
         assertEquals(base.at("/collection/operands/0/operands").size(), 2);
     }
 
     @Test
-    public void testNodeMergeWithBase() throws KustvaktException {
+    public void testNodeMergeWithBase () throws KustvaktException {
         String coll = "corpusSigle=WPD";
         String query = "[base=Haus]";
         QuerySerializer check = new QuerySerializer();
@@ -155,12 +186,13 @@
         node = b.mergeWith(node);
         assertNotNull(node);
         assertEquals(node.at("/collection/@type").asText(), "koral:docGroup");
-        assertEquals(node.at("/collection/operation").asText(), "operation:and");
+        assertEquals(node.at("/collection/operation").asText(),
+                "operation:and");
         assertEquals(2, node.at("/collection/operands").size());
     }
 
     @Test
-    public void testNodeMergeWithoutBase() throws KustvaktException {
+    public void testNodeMergeWithoutBase () throws KustvaktException {
         String query = "[base=Haus]";
         QuerySerializer check = new QuerySerializer();
         check.setQuery(query, "poliqarp");
@@ -178,7 +210,8 @@
     }
 
     @Test
-    public void testNodeMergeWithoutBaseWrongOperator() throws KustvaktException {
+    public void testNodeMergeWithoutBaseWrongOperator ()
+            throws KustvaktException {
         String query = "[base=Haus]";
         QuerySerializer check = new QuerySerializer();
         check.setQuery(query, "poliqarp");
@@ -197,11 +230,10 @@
     }
 
     @Test
-    public void testStoredCollectionBaseQueryBuild() {
-    }
+    public void testStoredCollectionBaseQueryBuild () {}
 
     @Test
-    public void testAddOROperator() throws KustvaktException {
+    public void testAddOROperator () throws KustvaktException {
         String coll = "corpusSigle=WPD";
         String query = "[base=Haus]";
         QuerySerializer check = new QuerySerializer();
@@ -218,7 +250,7 @@
     }
 
     @Test
-    public void testAddANDOperator() throws KustvaktException {
+    public void testAddANDOperator () throws KustvaktException {
         String coll = "corpusSigle=WPD";
         String query = "[base=Haus]";
         QuerySerializer check = new QuerySerializer();
@@ -230,12 +262,13 @@
         JsonNode node = (JsonNode) test.rebaseCollection();
         assertNotNull(node);
         assertEquals(node.at("/collection/@type").asText(), "koral:docGroup");
-        assertEquals(node.at("/collection/operation").asText(), "operation:and");
+        assertEquals(node.at("/collection/operation").asText(),
+                "operation:and");
         assertEquals(2, node.at("/collection/operands/1/operands").size());
     }
 
     @Test
-    public void testAddDefaultOperator() throws KustvaktException {
+    public void testAddDefaultOperator () throws KustvaktException {
         String coll = "corpusSigle=WPD";
         String query = "[base=Haus]";
         QuerySerializer check = new QuerySerializer();
@@ -247,12 +280,13 @@
         JsonNode node = (JsonNode) test.rebaseCollection();
         assertNotNull(node);
         assertEquals(node.at("/collection/@type").asText(), "koral:docGroup");
-        assertEquals(node.at("/collection/operation").asText(), "operation:and");
+        assertEquals(node.at("/collection/operation").asText(),
+                "operation:and");
         assertEquals(2, node.at("/collection/operands/1/operands").size());
     }
 
     @Test
-    public void testBaseCollectionNull() throws KustvaktException {
+    public void testBaseCollectionNull () throws KustvaktException {
         // base is missing collection segment
         QuerySerializer s = new QuerySerializer();
         s.setQuery("[base=Haus]", "poliqarp");
@@ -260,18 +294,24 @@
         total.setBaseQuery(s.toJSON());
         KoralCollectionQueryBuilder builder = new KoralCollectionQueryBuilder();
         builder.with("textClass=politik & corpusSigle=WPD");
-        JsonNode node = total.and().mergeWith((JsonNode) builder.rebaseCollection());
+        JsonNode node = total.and()
+                .mergeWith((JsonNode) builder.rebaseCollection());
         assertNotNull(node);
         assertEquals(node.at("/collection/@type").asText(), "koral:docGroup");
-        assertEquals(node.at("/collection/operation").asText(), "operation:and");
-        assertEquals(node.at("/collection/operands/0/@type").asText(), "koral:doc");
-        assertEquals(node.at("/collection/operands/1/@type").asText(), "koral:doc");
-        assertEquals(node.at("/collection/operands/0/key").asText(), "textClass");
-        assertEquals(node.at("/collection/operands/1/key").asText(), "corpusSigle");
+        assertEquals(node.at("/collection/operation").asText(),
+                "operation:and");
+        assertEquals(node.at("/collection/operands/0/@type").asText(),
+                "koral:doc");
+        assertEquals(node.at("/collection/operands/1/@type").asText(),
+                "koral:doc");
+        assertEquals(node.at("/collection/operands/0/key").asText(),
+                "textClass");
+        assertEquals(node.at("/collection/operands/1/key").asText(),
+                "corpusSigle");
     }
 
     @Test
-    public void testMergeCollectionNull() throws KustvaktException {
+    public void testMergeCollectionNull () throws KustvaktException {
         // merge json is missing collection segment
         QuerySerializer s = new QuerySerializer();
         s.setQuery("[base=Haus]", "poliqarp");
@@ -279,7 +319,8 @@
         KoralCollectionQueryBuilder total = new KoralCollectionQueryBuilder();
         total.setBaseQuery(s.toJSON());
         KoralCollectionQueryBuilder builder = new KoralCollectionQueryBuilder();
-        JsonNode node = total.and().mergeWith((JsonNode) builder.rebaseCollection());
+        JsonNode node = total.and()
+                .mergeWith((JsonNode) builder.rebaseCollection());
         assertNotNull(node);
         assertEquals(node.at("/collection/@type").asText(), "koral:doc");
         assertEquals(node.at("/collection/key").asText(), "textClass");
diff --git a/full/src/test/java/de/ids_mannheim/korap/misc/ConfigTest.java b/full/src/test/java/de/ids_mannheim/korap/misc/ConfigTest.java
index 7fa7e33..f683230 100644
--- a/full/src/test/java/de/ids_mannheim/korap/misc/ConfigTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/misc/ConfigTest.java
@@ -26,19 +26,19 @@
     KustvaktConfiguration config;
 
     @Test
-    public void testConfigLoader() {
+    public void testConfigLoader () {
         InputStream stream = ConfigLoader.loadConfigStream("kustvakt.conf");
         assertNotNull(stream);
     }
 
     @Test
-    public void testPropertyLoader() throws IOException {
+    public void testPropertyLoader () throws IOException {
         Properties p = ConfigLoader.loadProperties("kustvakt.conf");
         assertNotNull(p);
     }
 
     @Test
-    public void testServiceInfo() {
+    public void testServiceInfo () {
         String version = ServiceInfo.getInfo().getVersion();
         String name = ServiceInfo.getInfo().getName();
         assertNotEquals("UNKNOWN", version, "wrong version");
@@ -46,8 +46,10 @@
     }
 
     @Test
-    public void testProperties() {
-        assertEquals("opennlp", config.getDefault_orthography(), "token layer does not match");
-        assertEquals(TimeUtils.convertTimeToSeconds("1D"), config.getLongTokenTTL(), "token expiration does not match");
+    public void testProperties () {
+        assertEquals("opennlp", config.getDefault_orthography(),
+                "token layer does not match");
+        assertEquals(TimeUtils.convertTimeToSeconds("1D"),
+                config.getLongTokenTTL(), "token expiration does not match");
     }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/misc/KoralNodeTest.java b/full/src/test/java/de/ids_mannheim/korap/misc/KoralNodeTest.java
index 7e974f3..eb9051b 100644
--- a/full/src/test/java/de/ids_mannheim/korap/misc/KoralNodeTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/misc/KoralNodeTest.java
@@ -16,7 +16,7 @@
 
     // todo: 21.10.15 --> e.g. injection does not tell you if an entire node was injected, or just a value!
     @Test
-    public void addToNode() {
+    public void addToNode () {
         ObjectNode node = JsonUtils.createObjectNode();
         KoralNode knode = KoralNode.wrapNode(node);
         knode.put("value_1", "setting_1");
@@ -24,7 +24,7 @@
     }
 
     @Test
-    public void removeFromNode() {
+    public void removeFromNode () {
         ObjectNode node = JsonUtils.createObjectNode();
         node.put("value_1", "setting_1");
         KoralNode knode = KoralNode.wrapNode(node);
@@ -33,16 +33,16 @@
     }
 
     @Test
-    public void replaceObject() {
+    public void replaceObject () {
         ObjectNode node = JsonUtils.createObjectNode();
         node.put("value_1", "setting_1");
         KoralNode knode = KoralNode.wrapNode(node);
         knode.replace("value_1", "settings_2", null);
-        assertEquals(knode.rawNode().toString(), "{\"value_1\":\"settings_2\"}");
+        assertEquals(knode.rawNode().toString(),
+                "{\"value_1\":\"settings_2\"}");
     }
 
     // todo: 21.10.15 --> if a node is injected, that node must contain a "rewrites" reference?!
     @Test
-    public void addNodeToKoral() {
-    }
+    public void addNodeToKoral () {}
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/misc/LocalQueryTest.java b/full/src/test/java/de/ids_mannheim/korap/misc/LocalQueryTest.java
index a7b5c01..9591a0e 100644
--- a/full/src/test/java/de/ids_mannheim/korap/misc/LocalQueryTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/misc/LocalQueryTest.java
@@ -29,12 +29,12 @@
     KustvaktConfiguration config;
 
     @PostConstruct
-    public void setup() throws Exception {
+    public void setup () throws Exception {
         index = config.getIndexDir();
     }
 
     @Test
-    public void testQuery() throws KustvaktException {
+    public void testQuery () throws KustvaktException {
         String qstring = "creationDate since 1786 & creationDate until 1788";
         // qstring = "creationDate since 1765 & creationDate until 1768";
         // qstring = "textType = Aphorismus";
@@ -47,7 +47,7 @@
     }
 
     @Test
-    public void testCollQuery() throws IOException, KustvaktException {
+    public void testCollQuery () throws IOException, KustvaktException {
         String qstring = "creationDate since 1800 & creationDate until 1820";
         CollectionQueryProcessor processor = new CollectionQueryProcessor();
         processor.process(qstring);
@@ -59,7 +59,7 @@
     }
 
     @Test
-    public void testCollQuery2() throws IOException {
+    public void testCollQuery2 () throws IOException {
         String query = "{\"@context\":\"http://korap.ids-mannheim.de/ns/koral/0.3/context.jsonld\",\"errors\":[],\"warnings\":[],\"messages\":[],\"collection\":{\"@type\":\"koral:docGroup\",\"operation\":\"operation:and\",\"operands\":[{\"@type\":\"koral:doc\",\"key\":\"creationDate\",\"type\":\"type:date\",\"value\":\"1786\",\"match\":\"match:geq\"},{\"@type\":\"koral:doc\",\"key\":\"creationDate\",\"type\":\"type:date\",\"value\":\"1788\",\"match\":\"match:leq\"}]},\"query\":{},\"meta\":{}}";
         KrillCollection c = new KrillCollection(query);
         c.setIndex(new SearchKrill(index).getIndex());
diff --git a/full/src/test/java/de/ids_mannheim/korap/misc/MapUtilsTest.java b/full/src/test/java/de/ids_mannheim/korap/misc/MapUtilsTest.java
index 35e995e..4d59790 100644
--- a/full/src/test/java/de/ids_mannheim/korap/misc/MapUtilsTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/misc/MapUtilsTest.java
@@ -14,23 +14,23 @@
 
     @SuppressWarnings("unchecked")
     @Test
-    public void testConvertToMap() {
+    public void testConvertToMap () {
         MultivaluedMap<String, String> mm = new MultivaluedHashMap<String, String>();
-        mm.put("k1", Arrays.asList(new String[]{"a", "b", "c"}));
-        mm.put("k2", Arrays.asList(new String[]{"d", "e", "f"}));
+        mm.put("k1", Arrays.asList(new String[] { "a", "b", "c" }));
+        mm.put("k2", Arrays.asList(new String[] { "d", "e", "f" }));
         Map<String, String> map = MapUtils.toMap(mm);
         assertEquals(map.get("k1"), "a b c");
         assertEquals(map.get("k2"), "d e f");
     }
 
     @Test
-    public void testConvertNullMap() {
+    public void testConvertNullMap () {
         Map<String, String> map = MapUtils.toMap(null);
         assertEquals(0, map.size());
     }
 
     @Test
-    public void testConvertEmptyMap() {
+    public void testConvertEmptyMap () {
         MultivaluedMap<String, String> mm = new MultivaluedHashMap<String, String>();
         Map<String, String> map = MapUtils.toMap(mm);
         assertEquals(0, map.size());
diff --git a/full/src/test/java/de/ids_mannheim/korap/misc/MetaQueryBuilderTest.java b/full/src/test/java/de/ids_mannheim/korap/misc/MetaQueryBuilderTest.java
index c6328c3..7eda84d 100644
--- a/full/src/test/java/de/ids_mannheim/korap/misc/MetaQueryBuilderTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/misc/MetaQueryBuilderTest.java
@@ -8,15 +8,15 @@
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 
-
 /**
  * Created by hanl on 17.04.16.
  */
 public class MetaQueryBuilderTest {
 
     @Test
-    public void testSpanContext() {
-        MetaQueryBuilder m = QueryBuilderUtil.defaultMetaBuilder(0, 1, 5, "sentence", false);
+    public void testSpanContext () {
+        MetaQueryBuilder m = QueryBuilderUtil.defaultMetaBuilder(0, 1, 5,
+                "sentence", false);
         Map<?, ?> map = m.raw();
         assertEquals(map.get("context"), "sentence");
         assertEquals(1, map.get("startPage"));
diff --git a/full/src/test/java/de/ids_mannheim/korap/misc/RegexTest.java b/full/src/test/java/de/ids_mannheim/korap/misc/RegexTest.java
index 518ae39..634530b 100644
--- a/full/src/test/java/de/ids_mannheim/korap/misc/RegexTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/misc/RegexTest.java
@@ -10,7 +10,7 @@
 public class RegexTest {
 
     @Test
-    public void testQuote() {
+    public void testQuote () {
         String s = "ah[\"-\"]";
         Matcher m = AnnotationParser.quotePattern.matcher(s);
         if (m.find()) {
diff --git a/full/src/test/java/de/ids_mannheim/korap/misc/ScopesTest.java b/full/src/test/java/de/ids_mannheim/korap/misc/ScopesTest.java
index 4d82706..ad92c36 100644
--- a/full/src/test/java/de/ids_mannheim/korap/misc/ScopesTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/misc/ScopesTest.java
@@ -9,10 +9,8 @@
 public class ScopesTest {
 
     @Test
-    public void testScopes() {
-    }
+    public void testScopes () {}
 
     @Test
-    public void testOpenIDScopes() {
-    }
+    public void testOpenIDScopes () {}
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/misc/SerializationTest.java b/full/src/test/java/de/ids_mannheim/korap/misc/SerializationTest.java
index 7471e12..dd4ca5b 100644
--- a/full/src/test/java/de/ids_mannheim/korap/misc/SerializationTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/misc/SerializationTest.java
@@ -11,7 +11,7 @@
 public class SerializationTest {
 
     @Test
-    public void testSettingsObject() {
+    public void testSettingsObject () {
         // String t = "poliqarp_test";
         // UserSettings s = new UserSettings();
         // Map map = s.toObjectMap();
diff --git a/full/src/test/java/de/ids_mannheim/korap/misc/StringUtilsTest.java b/full/src/test/java/de/ids_mannheim/korap/misc/StringUtilsTest.java
index 657ba0b..f7dfb3a 100644
--- a/full/src/test/java/de/ids_mannheim/korap/misc/StringUtilsTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/misc/StringUtilsTest.java
@@ -16,7 +16,7 @@
 public class StringUtilsTest {
 
     @Test
-    public void testTextIToDoc() {
+    public void testTextIToDoc () {
         String textSigle = "WPD_AAA.02439";
         String docSigle = "WPD_AAA";
         assertEquals(docSigle, StringUtils.getDocSigle(textSigle));
@@ -24,13 +24,14 @@
     }
 
     @Test
-    public void testBasicHttpSplit() throws KustvaktException {
+    public void testBasicHttpSplit () throws KustvaktException {
         String s2 = new String(Base64.encodeBase64("test:testPass".getBytes()));
         String[] f2 = TransferEncoding.decodeBase64(s2);
         assertEquals(f2[0], "test");
         assertEquals(f2[1], "testPass");
         HttpAuthorizationHandler handler = new HttpAuthorizationHandler();
-        String s1 = "basic " + new String(Base64.encodeBase64("test:testPass".getBytes()));
+        String s1 = "basic "
+                + new String(Base64.encodeBase64("test:testPass".getBytes()));
         AuthorizationData f1 = handler.parseAuthorizationHeaderValue(s1);
         assertEquals(s2, f1.getToken());
     }
diff --git a/full/src/test/java/de/ids_mannheim/korap/misc/TestNullableSqls.java b/full/src/test/java/de/ids_mannheim/korap/misc/TestNullableSqls.java
index 86a2a79..8fcb1d0 100644
--- a/full/src/test/java/de/ids_mannheim/korap/misc/TestNullableSqls.java
+++ b/full/src/test/java/de/ids_mannheim/korap/misc/TestNullableSqls.java
@@ -1,4 +1,5 @@
 package de.ids_mannheim.korap.misc;
+
 /**
  * @author hanl
  * @date 30/01/2016
diff --git a/full/src/test/java/de/ids_mannheim/korap/rewrite/CollectionRewriteTest.java b/full/src/test/java/de/ids_mannheim/korap/rewrite/CollectionRewriteTest.java
index ae8e39b..e205ce3 100644
--- a/full/src/test/java/de/ids_mannheim/korap/rewrite/CollectionRewriteTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/rewrite/CollectionRewriteTest.java
@@ -24,72 +24,89 @@
     public KustvaktConfiguration config;
 
     @Test
-    public void testCollectionNodeRemoveCorpusIdNoErrors() throws KustvaktException {
+    public void testCollectionNodeRemoveCorpusIdNoErrors ()
+            throws KustvaktException {
         RewriteHandler handler = new RewriteHandler(config);
         handler.add(CollectionConstraint.class);
         QuerySerializer s = new QuerySerializer();
         s.setQuery(TestVariables.SIMPLE_ADD_QUERY, "poliqarp");
         s.setCollection("textClass=politik & corpusSigle=WPD");
         String result = s.toJSON();
-        JsonNode node = JsonUtils.readTree(handler.processQuery(result, User.UserFactory.getUser("test_user")));
+        JsonNode node = JsonUtils.readTree(handler.processQuery(result,
+                User.UserFactory.getUser("test_user")));
         assertNotNull(node);
         assertEquals(1, node.at("/collection/operands").size());
     }
 
     @Test
-    public void testCollectionNodeDeletionNotification() {
-    }
+    public void testCollectionNodeDeletionNotification () {}
 
     @Test
-    public void testCollectionNodeRemoveAllCorpusIdNoErrors() throws KustvaktException {
+    public void testCollectionNodeRemoveAllCorpusIdNoErrors ()
+            throws KustvaktException {
         RewriteHandler handler = new RewriteHandler(config);
         handler.add(CollectionConstraint.class);
         QuerySerializer s = new QuerySerializer();
         s.setQuery(TestVariables.SIMPLE_ADD_QUERY, "poliqarp");
         s.setCollection("corpusSigle=BRZ13 & corpusSigle=WPD");
         String result = s.toJSON();
-        JsonNode node = JsonUtils.readTree(handler.processQuery(result, User.UserFactory.getUser("test_user")));
+        JsonNode node = JsonUtils.readTree(handler.processQuery(result,
+                User.UserFactory.getUser("test_user")));
         assertNotNull(node);
         assertEquals(0, node.at("/collection/operands").size());
-        assertEquals(node.at("/collection/rewrites/0/@type").asText(), "koral:rewrite");
+        assertEquals(node.at("/collection/rewrites/0/@type").asText(),
+                "koral:rewrite");
     }
 
     @Test
-    public void testCollectionNodeRemoveGroupedCorpusIdNoErrors() throws KustvaktException {
+    public void testCollectionNodeRemoveGroupedCorpusIdNoErrors ()
+            throws KustvaktException {
         RewriteHandler handler = new RewriteHandler(config);
         handler.add(CollectionConstraint.class);
         QuerySerializer s = new QuerySerializer();
         s.setQuery(TestVariables.SIMPLE_ADD_QUERY, "poliqarp");
-        s.setCollection("(corpusSigle=BRZ13 & textClass=Wissenschaft) & corpusSigle=WPD");
+        s.setCollection(
+                "(corpusSigle=BRZ13 & textClass=Wissenschaft) & corpusSigle=WPD");
         String result = s.toJSON();
-        JsonNode node = JsonUtils.readTree(handler.processQuery(result, User.UserFactory.getUser("test_user")));
+        JsonNode node = JsonUtils.readTree(handler.processQuery(result,
+                User.UserFactory.getUser("test_user")));
         assertNotNull(node);
-        assertEquals(node.at("/collection/operands/0/@type").asText(), "koral:docGroup");
-        assertEquals(node.at("/collection/operands/0/operands/0/key").asText(), "textClass");
-        assertEquals(node.at("/collection/rewrites/0/@type").asText(), "koral:rewrite");
+        assertEquals(node.at("/collection/operands/0/@type").asText(),
+                "koral:docGroup");
+        assertEquals(node.at("/collection/operands/0/operands/0/key").asText(),
+                "textClass");
+        assertEquals(node.at("/collection/rewrites/0/@type").asText(),
+                "koral:rewrite");
     }
 
     // fixme: will probably fail when one doc groups are being refactored
     @Test
-    public void testCollectionCleanEmptyDocGroupNoErrors() throws KustvaktException {
+    public void testCollectionCleanEmptyDocGroupNoErrors ()
+            throws KustvaktException {
         RewriteHandler handler = new RewriteHandler(config);
         handler.add(CollectionConstraint.class);
         handler.add(CollectionCleanRewrite.class);
         QuerySerializer s = new QuerySerializer();
         s.setQuery(TestVariables.SIMPLE_ADD_QUERY, "poliqarp");
-        s.setCollection("(corpusSigle=BRZ13 & corpusSigle=WPD) & textClass=Wissenschaft & textClass=Sport");
+        s.setCollection(
+                "(corpusSigle=BRZ13 & corpusSigle=WPD) & textClass=Wissenschaft & textClass=Sport");
         String result = s.toJSON();
-        JsonNode node = JsonUtils.readTree(handler.processQuery(result, User.UserFactory.getUser("test_user")));
+        JsonNode node = JsonUtils.readTree(handler.processQuery(result,
+                User.UserFactory.getUser("test_user")));
         assertNotNull(node);
         assertEquals(node.at("/collection/@type").asText(), "koral:docGroup");
         assertEquals(2, node.at("/collection/operands").size());
-        assertEquals(node.at("/collection/operands/0/key").asText(), "textClass");
-        assertEquals(node.at("/collection/operands/1/key").asText(), "textClass");
-        assertEquals(node.at("/collection/rewrites/0/@type").asText(), "koral:rewrite");
+        assertEquals(node.at("/collection/operands/0/key").asText(),
+                "textClass");
+        assertEquals(node.at("/collection/operands/1/key").asText(),
+                "textClass");
+        assertEquals(node.at("/collection/rewrites/0/@type").asText(),
+                "koral:rewrite");
     }
 
     @Test
-    public void testCollectionCleanMoveOneDocFromGroupUpNoErrors() throws KustvaktException {
+    public void testCollectionCleanMoveOneDocFromGroupUpNoErrors ()
+            throws KustvaktException {
         RewriteHandler handler = new RewriteHandler(config);
         handler.add(CollectionConstraint.class);
         handler.add(CollectionCleanRewrite.class);
@@ -97,123 +114,164 @@
         s.setQuery(TestVariables.SIMPLE_ADD_QUERY, "poliqarp");
         s.setCollection("(corpusSigle=BRZ13 & textClass=wissenschaft)");
         String result = s.toJSON();
-        JsonNode node = JsonUtils.readTree(handler.processQuery(result, User.UserFactory.getUser("test_user")));
+        JsonNode node = JsonUtils.readTree(handler.processQuery(result,
+                User.UserFactory.getUser("test_user")));
         assertNotNull(node);
         assertEquals(node.at("/collection/@type").asText(), "koral:doc");
         assertEquals(node.at("/collection/key").asText(), "textClass");
         assertEquals(node.at("/collection/value").asText(), "wissenschaft");
-        assertEquals(node.at("/collection/rewrites/0/@type").asText(), "koral:rewrite");
+        assertEquals(node.at("/collection/rewrites/0/@type").asText(),
+                "koral:rewrite");
     }
 
     @Test
-    public void testCollectionCleanEmptyGroupAndMoveOneFromGroupUpNoErrors() throws KustvaktException {
+    public void testCollectionCleanEmptyGroupAndMoveOneFromGroupUpNoErrors ()
+            throws KustvaktException {
         RewriteHandler handler = new RewriteHandler(config);
         handler.add(CollectionConstraint.class);
         handler.add(CollectionCleanRewrite.class);
         QuerySerializer s = new QuerySerializer();
         s.setQuery(TestVariables.SIMPLE_ADD_QUERY, "poliqarp");
-        s.setCollection("(corpusSigle=BRZ13 & corpusSigle=WPD) & textClass=Wissenschaft");
+        s.setCollection(
+                "(corpusSigle=BRZ13 & corpusSigle=WPD) & textClass=Wissenschaft");
         String result = s.toJSON();
-        JsonNode node = JsonUtils.readTree(handler.processQuery(result, User.UserFactory.getUser("test_user")));
+        JsonNode node = JsonUtils.readTree(handler.processQuery(result,
+                User.UserFactory.getUser("test_user")));
         assertNotNull(node);
         assertEquals(node.at("/collection/@type").asText(), "koral:doc");
         assertEquals(node.at("/collection/key").asText(), "textClass");
-        assertEquals(node.at("/collection/rewrites/0/@type").asText(), "koral:rewrite");
+        assertEquals(node.at("/collection/rewrites/0/@type").asText(),
+                "koral:rewrite");
     }
 
     @Test
-    public void testCollectionRemoveAndMoveOneFromGroupUpNoErrors() throws KustvaktException {
+    public void testCollectionRemoveAndMoveOneFromGroupUpNoErrors ()
+            throws KustvaktException {
         RewriteHandler handler = new RewriteHandler(config);
         handler.add(CollectionConstraint.class);
         handler.add(CollectionCleanRewrite.class);
         QuerySerializer s = new QuerySerializer();
         s.setQuery(TestVariables.SIMPLE_ADD_QUERY, "poliqarp");
-        s.setCollection("(docID=random & textClass=Wissenschaft) & corpusSigle=WPD");
+        s.setCollection(
+                "(docID=random & textClass=Wissenschaft) & corpusSigle=WPD");
         String org = s.toJSON();
-        JsonNode node = JsonUtils.readTree(handler.processQuery(org, User.UserFactory.getUser("test_user")));
+        JsonNode node = JsonUtils.readTree(handler.processQuery(org,
+                User.UserFactory.getUser("test_user")));
         assertNotNull(node);
         assertEquals(node.at("/collection/@type").asText(), "koral:docGroup");
         assertEquals(2, node.at("/collection/operands").size());
-        assertEquals(node.at("/collection/operands/0/@type").asText(), "koral:doc");
-        assertEquals(node.at("/collection/operands/1/@type").asText(), "koral:doc");
-        assertEquals(node.at("/collection/rewrites/0/@type").asText(), "koral:rewrite");
+        assertEquals(node.at("/collection/operands/0/@type").asText(),
+                "koral:doc");
+        assertEquals(node.at("/collection/operands/1/@type").asText(),
+                "koral:doc");
+        assertEquals(node.at("/collection/rewrites/0/@type").asText(),
+                "koral:rewrite");
     }
 
     @Test
-    public void testPublicCollectionRewriteEmptyAdd() throws KustvaktException {
+    public void testPublicCollectionRewriteEmptyAdd ()
+            throws KustvaktException {
         RewriteHandler handler = new RewriteHandler(config);
         handler.add(CollectionRewrite.class);
         QuerySerializer s = new QuerySerializer();
         s.setQuery(TestVariables.SIMPLE_ADD_QUERY, "poliqarp");
         String org = s.toJSON();
-        JsonNode node = JsonUtils.readTree(handler.processQuery(org, User.UserFactory.getUser("test_user")));
+        JsonNode node = JsonUtils.readTree(handler.processQuery(org,
+                User.UserFactory.getUser("test_user")));
         assertNotNull(node);
         assertEquals(node.at("/collection/key").asText(), "availability");
         assertEquals(node.at("/collection/value").asText(), "CC-BY.*");
-        assertEquals(node.at("/collection/rewrites/0/@type").asText(), "koral:rewrite");
-        assertEquals(node.at("/collection/rewrites/0/scope").asText(), "availability(FREE)");
+        assertEquals(node.at("/collection/rewrites/0/@type").asText(),
+                "koral:rewrite");
+        assertEquals(node.at("/collection/rewrites/0/scope").asText(),
+                "availability(FREE)");
         // todo:
     }
 
     @Test
-    public void testPublicCollectionRewriteNonEmptyAdd() throws KustvaktException {
+    public void testPublicCollectionRewriteNonEmptyAdd ()
+            throws KustvaktException {
         RewriteHandler handler = new RewriteHandler(config);
         handler.add(CollectionRewrite.class);
         QuerySerializer s = new QuerySerializer();
         s.setQuery(TestVariables.SIMPLE_ADD_QUERY, "poliqarp");
         s.setCollection("(docSigle=WPD_AAA & textClass=wissenschaft)");
         String org = s.toJSON();
-        JsonNode node = JsonUtils.readTree(handler.processQuery(org, User.UserFactory.getUser("test_user")));
+        JsonNode node = JsonUtils.readTree(handler.processQuery(org,
+                User.UserFactory.getUser("test_user")));
         assertNotNull(node);
         assertEquals(2, node.at("/collection/operands").size());
-        assertEquals(node.at("/collection/operands/0/key").asText(), "availability");
-        assertEquals(node.at("/collection/operands/0/value").asText(), "CC-BY.*");
-        assertEquals(node.at("/collection/operands/1/operands/0/key").asText(), "docSigle");
-        assertEquals(node.at("/collection/operands/1/operands/1/key").asText(), "textClass");
-        assertEquals(node.at("/collection/rewrites/0/@type").asText(), "koral:rewrite");
-        assertEquals(node.at("/collection/rewrites/0/scope").asText(), "availability(FREE)");
+        assertEquals(node.at("/collection/operands/0/key").asText(),
+                "availability");
+        assertEquals(node.at("/collection/operands/0/value").asText(),
+                "CC-BY.*");
+        assertEquals(node.at("/collection/operands/1/operands/0/key").asText(),
+                "docSigle");
+        assertEquals(node.at("/collection/operands/1/operands/1/key").asText(),
+                "textClass");
+        assertEquals(node.at("/collection/rewrites/0/@type").asText(),
+                "koral:rewrite");
+        assertEquals(node.at("/collection/rewrites/0/scope").asText(),
+                "availability(FREE)");
     }
 
     @Test
-    public void testRemoveCorpusFromDifferentGroups() throws KustvaktException {
+    public void testRemoveCorpusFromDifferentGroups ()
+            throws KustvaktException {
         RewriteHandler handler = new RewriteHandler(config);
         handler.add(CollectionConstraint.class);
         QuerySerializer s = new QuerySerializer();
         s.setQuery(TestVariables.SIMPLE_ADD_QUERY, "poliqarp");
-        s.setCollection("(corpusSigle=BRZ14 & textClass=wissenschaft) | (corpusSigle=AZPR | textClass=freizeit)");
+        s.setCollection(
+                "(corpusSigle=BRZ14 & textClass=wissenschaft) | (corpusSigle=AZPR | textClass=freizeit)");
         String org = s.toJSON();
-        JsonNode node = JsonUtils.readTree(handler.processQuery(org, User.UserFactory.getUser("test_user")));
+        JsonNode node = JsonUtils.readTree(handler.processQuery(org,
+                User.UserFactory.getUser("test_user")));
         assertNotNull(node);
         assertEquals(node.at("/collection/@type").asText(), "koral:docGroup");
         assertEquals(2, node.at("/collection/operands").size());
-        assertEquals(node.at("/collection/operands/0/@type").asText(), "koral:docGroup");
-        assertEquals(node.at("/collection/operands/1/@type").asText(), "koral:docGroup");
+        assertEquals(node.at("/collection/operands/0/@type").asText(),
+                "koral:docGroup");
+        assertEquals(node.at("/collection/operands/1/@type").asText(),
+                "koral:docGroup");
         assertEquals(1, node.at("/collection/operands/0/operands").size());
         assertEquals(1, node.at("/collection/operands/1/operands").size());
-        assertEquals(node.at("/collection/rewrites/0/@type").asText(), "koral:rewrite");
+        assertEquals(node.at("/collection/rewrites/0/@type").asText(),
+                "koral:rewrite");
     }
 
     @Test
-    public void testRemoveOneCorpusAndMoveDocFromTwoGroups() throws KustvaktException {
+    public void testRemoveOneCorpusAndMoveDocFromTwoGroups ()
+            throws KustvaktException {
         RewriteHandler handler = new RewriteHandler(config);
         handler.add(CollectionConstraint.class);
         // todo: use this collection query also to test clean up filter! after reduction of corpusSigle (wiss | freizeit)!
         handler.add(CollectionCleanRewrite.class);
         QuerySerializer s = new QuerySerializer();
         s.setQuery(TestVariables.SIMPLE_ADD_QUERY, "poliqarp");
-        s.setCollection("(corpusSigle=BRZ14 & textClass=wissenschaft) | (corpusSigle=AZPR | textClass=freizeit)");
+        s.setCollection(
+                "(corpusSigle=BRZ14 & textClass=wissenschaft) | (corpusSigle=AZPR | textClass=freizeit)");
         String org = s.toJSON();
-        JsonNode node = JsonUtils.readTree(handler.processQuery(org, User.UserFactory.getUser("test_user")));
+        JsonNode node = JsonUtils.readTree(handler.processQuery(org,
+                User.UserFactory.getUser("test_user")));
         assertNotNull(node);
         assertEquals(node.at("/collection/@type").asText(), "koral:docGroup");
         assertEquals(2, node.at("/collection/operands").size());
-        assertEquals(node.at("/collection/operands/0/@type").asText(), "koral:doc");
-        assertEquals(node.at("/collection/operands/0/@type").asText(), "koral:doc");
-        assertEquals(node.at("/collection/operands/0/key").asText(), "textClass");
-        assertEquals(node.at("/collection/operands/0/value").asText(), "wissenschaft");
-        assertEquals(node.at("/collection/operands/1/@type").asText(), "koral:doc");
-        assertEquals(node.at("/collection/operands/1/key").asText(), "textClass");
-        assertEquals(node.at("/collection/operands/1/value").asText(), "freizeit");
-        assertEquals(node.at("/collection/rewrites/0/@type").asText(), "koral:rewrite");
+        assertEquals(node.at("/collection/operands/0/@type").asText(),
+                "koral:doc");
+        assertEquals(node.at("/collection/operands/0/@type").asText(),
+                "koral:doc");
+        assertEquals(node.at("/collection/operands/0/key").asText(),
+                "textClass");
+        assertEquals(node.at("/collection/operands/0/value").asText(),
+                "wissenschaft");
+        assertEquals(node.at("/collection/operands/1/@type").asText(),
+                "koral:doc");
+        assertEquals(node.at("/collection/operands/1/key").asText(),
+                "textClass");
+        assertEquals(node.at("/collection/operands/1/value").asText(),
+                "freizeit");
+        assertEquals(node.at("/collection/rewrites/0/@type").asText(),
+                "koral:rewrite");
     }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/rewrite/FoundryRewriteTest.java b/full/src/test/java/de/ids_mannheim/korap/rewrite/FoundryRewriteTest.java
index 65d3752..51e7fc5 100644
--- a/full/src/test/java/de/ids_mannheim/korap/rewrite/FoundryRewriteTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/rewrite/FoundryRewriteTest.java
@@ -44,50 +44,67 @@
     private LayerMapper m;
 
     @Test
-    public void testSearchRewriteFoundryWithUserSetting() throws KustvaktException {
+    public void testSearchRewriteFoundryWithUserSetting ()
+            throws KustvaktException {
         // create user setting
         String json = "{\"pos-foundry\":\"opennlp\"}";
         String username = "foundryRewriteTest";
         String pathUsername = "~" + username;
-        Response response = target().path(API_VERSION).path(pathUsername).path("setting").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).put(Entity.json(json));
+        Response response = target().path(API_VERSION).path(pathUsername)
+                .path("setting").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .put(Entity.json(json));
         assertEquals(Status.CREATED.getStatusCode(), response.getStatus());
         // search
-        response = target().path(API_VERSION).path("search").queryParam("q", "[pos=ADJA]").queryParam("ql", "poliqarp").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).accept(MediaType.APPLICATION_JSON).get();
+        response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[pos=ADJA]").queryParam("ql", "poliqarp")
+                .request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .accept(MediaType.APPLICATION_JSON).get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         assertEquals(node.at("/query/wrap/foundry").asText(), "opennlp");
-        assertEquals(node.at("/query/wrap/rewrites/0/scope").asText(), "foundry");
+        assertEquals(node.at("/query/wrap/rewrites/0/scope").asText(),
+                "foundry");
     }
 
     @Test
-    public void testRewritePosFoundryWithUserSetting() throws KustvaktException {
+    public void testRewritePosFoundryWithUserSetting ()
+            throws KustvaktException {
         // EM: see
         // full/src/main/resources/db/insert/V3.6__insert_default_settings.sql
         String username = "bubbles";
         QuerySerializer s = new QuerySerializer();
         s.setQuery("[pos=ADJA]", "poliqarp");
-        String result = handler.processQuery(s.toJSON(), new KorAPUser(username));
+        String result = handler.processQuery(s.toJSON(),
+                new KorAPUser(username));
         JsonNode node = JsonUtils.readTree(result);
         assertEquals(node.at("/query/wrap/foundry").asText(), "corenlp");
-        assertEquals(node.at("/query/wrap/rewrites/0/scope").asText(), "foundry");
+        assertEquals(node.at("/query/wrap/rewrites/0/scope").asText(),
+                "foundry");
     }
 
     @Test
-    public void testRewriteLemmaFoundryWithUserSetting() throws KustvaktException {
+    public void testRewriteLemmaFoundryWithUserSetting ()
+            throws KustvaktException {
         String username = "bubbles";
         QuerySerializer s = new QuerySerializer();
         s.setQuery("[base=Haus]", "poliqarp");
-        String result = handler.processQuery(s.toJSON(), new KorAPUser(username));
+        String result = handler.processQuery(s.toJSON(),
+                new KorAPUser(username));
         JsonNode node = JsonUtils.readTree(result);
         // EM: only for testing, in fact, opennlp lemma does not
         // exist!
         assertEquals(node.at("/query/wrap/foundry").asText(), "opennlp");
-        assertEquals(node.at("/query/wrap/rewrites/0/scope").asText(), "foundry");
+        assertEquals(node.at("/query/wrap/rewrites/0/scope").asText(),
+                "foundry");
     }
 
     @Test
-    public void testDefaultLayerMapperThrowsNoException() {
+    public void testDefaultLayerMapperThrowsNoException () {
         assertEquals(config.getDefault_lemma(), m.findFoundry("lemma"));
         assertEquals(config.getDefault_pos(), m.findFoundry("pos"));
         assertEquals(config.getDefault_orthography(), m.findFoundry("surface"));
@@ -96,35 +113,42 @@
     }
 
     @Test
-    public void testDefaultFoundryInjectLemmaThrowsNoError() throws KustvaktException {
+    public void testDefaultFoundryInjectLemmaThrowsNoError ()
+            throws KustvaktException {
         QuerySerializer s = new QuerySerializer();
         s.setQuery("[base=Haus]", "poliqarp");
         String result = handler.processQuery(s.toJSON(), new KorAPUser("test"));
         JsonNode node = JsonUtils.readTree(result);
         assertNotNull(node);
         assertFalse(node.at("/query/wrap/foundry").isMissingNode());
-        assertEquals(config.getDefault_lemma(), node.at("/query/wrap/foundry").asText());
+        assertEquals(config.getDefault_lemma(),
+                node.at("/query/wrap/foundry").asText());
         assertEquals(node.at("/query/wrap/layer").asText(), "lemma");
         assertFalse(node.at("/query/wrap/rewrites").isMissingNode());
-        assertEquals(node.at("/query/wrap/rewrites/0/@type").asText(), "koral:rewrite");
+        assertEquals(node.at("/query/wrap/rewrites/0/@type").asText(),
+                "koral:rewrite");
     }
 
     @Test
-    public void testDefaultFoundryInjectPOSNoErrors() throws KustvaktException {
+    public void testDefaultFoundryInjectPOSNoErrors ()
+            throws KustvaktException {
         QuerySerializer s = new QuerySerializer();
         s.setQuery("[pos=ADJA]", "poliqarp");
         String result = handler.processQuery(s.toJSON(), new KorAPUser("test"));
         JsonNode node = JsonUtils.readTree(result);
         assertNotNull(node);
         assertFalse(node.at("/query/wrap/foundry").isMissingNode());
-        assertEquals(config.getDefault_pos(), node.at("/query/wrap/foundry").asText());
+        assertEquals(config.getDefault_pos(),
+                node.at("/query/wrap/foundry").asText());
         assertEquals(node.at("/query/wrap/layer").asText(), "pos");
         assertFalse(node.at("/query/wrap/rewrites").isMissingNode());
-        assertEquals(node.at("/query/wrap/rewrites/0/@type").asText(), "koral:rewrite");
+        assertEquals(node.at("/query/wrap/rewrites/0/@type").asText(),
+                "koral:rewrite");
     }
 
     @Test
-    public void testFoundryInjectJoinedQueryNoErrors() throws KustvaktException {
+    public void testFoundryInjectJoinedQueryNoErrors ()
+            throws KustvaktException {
         QuerySerializer s = new QuerySerializer();
         s.setQuery("[orth=laufe/i & base!=Lauf]", "poliqarp");
         String result = handler.processQuery(s.toJSON(), new KorAPUser("test"));
@@ -138,7 +162,8 @@
     }
 
     @Test
-    public void testFoundryInjectGroupedQueryNoErrors() throws KustvaktException {
+    public void testFoundryInjectGroupedQueryNoErrors ()
+            throws KustvaktException {
         QuerySerializer s = new QuerySerializer();
         s.setQuery("[(base=laufen | tt/pos=VVFIN)]", "poliqarp");
         String result = handler.processQuery(s.toJSON(), new KorAPUser("test"));
@@ -152,7 +177,7 @@
     }
 
     @Test
-    public void testFoundryBaseRewrite() throws KustvaktException {
+    public void testFoundryBaseRewrite () throws KustvaktException {
         QuerySerializer s = new QuerySerializer();
         s.setQuery("[orth=laufen]", "poliqarp");
         String result = handler.processQuery(s.toJSON(), new KorAPUser("test"));
diff --git a/full/src/test/java/de/ids_mannheim/korap/rewrite/IdRewriteTest.java b/full/src/test/java/de/ids_mannheim/korap/rewrite/IdRewriteTest.java
index b0fc1ea..ef33982 100644
--- a/full/src/test/java/de/ids_mannheim/korap/rewrite/IdRewriteTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/rewrite/IdRewriteTest.java
@@ -26,7 +26,7 @@
     private KustvaktConfiguration config;
 
     @Test
-    public void insertTokenId() throws KustvaktException {
+    public void insertTokenId () throws KustvaktException {
         RewriteHandler handler = new RewriteHandler(config);
         assertTrue(handler.add(IdWriter.class));
         String query = "[surface=Wort]";
@@ -39,7 +39,7 @@
     }
 
     @Test
-    public void testIdWriterTest() throws KustvaktException {
+    public void testIdWriterTest () throws KustvaktException {
         RewriteHandler handler = new RewriteHandler(config);
         assertTrue(handler.add(IdWriter.class));
         QuerySerializer s = new QuerySerializer();
diff --git a/full/src/test/java/de/ids_mannheim/korap/rewrite/QueryRewriteTest.java b/full/src/test/java/de/ids_mannheim/korap/rewrite/QueryRewriteTest.java
index 8862def..524dad5 100644
--- a/full/src/test/java/de/ids_mannheim/korap/rewrite/QueryRewriteTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/rewrite/QueryRewriteTest.java
@@ -18,28 +18,42 @@
 public class QueryRewriteTest extends SpringJerseyTest {
 
     @Test
-    public void testRewriteRefNotFound() throws KustvaktException, Exception {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "{q}").queryParam("ql", "poliqarp").resolveTemplate("q", "[orth=der]{#examplequery} Baum").request().get();
+    public void testRewriteRefNotFound () throws KustvaktException, Exception {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "{q}").queryParam("ql", "poliqarp")
+                .resolveTemplate("q", "[orth=der]{#examplequery} Baum")
+                .request().get();
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
-        assertEquals(node.at("/errors/0/1").asText(), "Query system/examplequery is not found.");
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Query system/examplequery is not found.");
     }
 
     @Test
-    public void testRewriteSystemQuery() throws KustvaktException, Exception {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "{q}").queryParam("ql", "poliqarp").resolveTemplate("q", "[orth=der]{#system-q} Baum").request().get();
+    public void testRewriteSystemQuery () throws KustvaktException, Exception {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "{q}").queryParam("ql", "poliqarp")
+                .resolveTemplate("q", "[orth=der]{#system-q} Baum").request()
+                .get();
         String ent = response.readEntity(String.class);
         // System.out.println(ent);
         JsonNode node = JsonUtils.readTree(ent);
     }
 
     @Test
-    public void testRewriteRefRewrite() throws KustvaktException, Exception {
+    public void testRewriteRefRewrite () throws KustvaktException, Exception {
         // Added in the database migration sql for tests
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "{q}").queryParam("ql", "poliqarp").resolveTemplate("q", "[orth=der]{#dory/dory-q} Baum").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("dory", "pass")).get();
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "{q}").queryParam("ql", "poliqarp")
+                .resolveTemplate("q", "[orth=der]{#dory/dory-q} Baum").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("dory", "pass"))
+                .get();
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
-        assertEquals(node.at("/query/operands/1/@type").asText(), "koral:token");
-        assertEquals(node.at("/query/operands/1/rewrites/0/scope").asText(), "@type(koral:queryRef)");
+        assertEquals(node.at("/query/operands/1/@type").asText(),
+                "koral:token");
+        assertEquals(node.at("/query/operands/1/rewrites/0/scope").asText(),
+                "@type(koral:queryRef)");
     }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/rewrite/ResultRewriteTest.java b/full/src/test/java/de/ids_mannheim/korap/rewrite/ResultRewriteTest.java
index 6642514..77767a0 100644
--- a/full/src/test/java/de/ids_mannheim/korap/rewrite/ResultRewriteTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/rewrite/ResultRewriteTest.java
@@ -21,9 +21,11 @@
     public RewriteHandler ha;
 
     @Test
-    public void testPostRewriteNothingToDo() throws KustvaktException {
-        assertEquals(true, ha.add(CollectionRewrite.class), "Handler could not be added to rewrite handler instance!");
+    public void testPostRewriteNothingToDo () throws KustvaktException {
+        assertEquals(true, ha.add(CollectionRewrite.class),
+                "Handler could not be added to rewrite handler instance!");
         String v = ha.processResult(TestVariables.RESULT, null);
-        assertEquals(JsonUtils.readTree(TestVariables.RESULT), JsonUtils.readTree(v), "results do not match");
+        assertEquals(JsonUtils.readTree(TestVariables.RESULT),
+                JsonUtils.readTree(v), "results do not match");
     }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/rewrite/RewriteHandlerTest.java b/full/src/test/java/de/ids_mannheim/korap/rewrite/RewriteHandlerTest.java
index 60b934c..35df9d3 100644
--- a/full/src/test/java/de/ids_mannheim/korap/rewrite/RewriteHandlerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/rewrite/RewriteHandlerTest.java
@@ -79,7 +79,7 @@
     private KustvaktConfiguration config;
 
     @Test
-    public void testRewriteTaskAdd() {
+    public void testRewriteTaskAdd () {
         RewriteHandler handler = new RewriteHandler(config);
         assertTrue(handler.add(FoundryInject.class));
         assertTrue(handler.add(CollectionCleanRewrite.class));
@@ -88,11 +88,12 @@
 
     // throws exception cause of missing configuration
     @Test
-    public void testRewriteConfigThrowsException() {
+    public void testRewriteConfigThrowsException () {
         assertThrows(RuntimeException.class, () -> {
             RewriteHandler handler = new RewriteHandler();
             QuerySerializer s = new QuerySerializer();
-            s.setQuery("[(base=laufen | base=gehen) & tt/pos=VVFIN]", "poliqarp");
+            s.setQuery("[(base=laufen | base=gehen) & tt/pos=VVFIN]",
+                    "poliqarp");
             assertTrue(handler.add(FoundryInject.class));
             handler.processQuery(s.toJSON(), null);
         });
diff --git a/full/src/test/java/de/ids_mannheim/korap/rewrite/VirtualCorpusRewriteTest.java b/full/src/test/java/de/ids_mannheim/korap/rewrite/VirtualCorpusRewriteTest.java
index 170ffd0..f0ea66c 100644
--- a/full/src/test/java/de/ids_mannheim/korap/rewrite/VirtualCorpusRewriteTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/rewrite/VirtualCorpusRewriteTest.java
@@ -36,10 +36,13 @@
     private QueryDao dao;
 
     @Test
-    public void testRefCachedVC() throws KustvaktException, IOException, QueryException {
+    public void testRefCachedVC ()
+            throws KustvaktException, IOException, QueryException {
         vcLoader.loadVCToCache("named-vc1", "/vc/named-vc1.jsonld");
         assertTrue(VirtualCorpusCache.contains("named-vc1"));
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("cq", "referTo named-vc1").request().get();
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("cq", "referTo named-vc1").request().get();
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         node = node.at("/collection");
@@ -54,8 +57,12 @@
         assertFalse(VirtualCorpusCache.contains("named-vc1"));
     }
 
-    private void testRefCachedVCWithUsername() throws KustvaktException, IOException, QueryException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("cq", "referTo \"system/named-vc1\"").request().get();
+    private void testRefCachedVCWithUsername ()
+            throws KustvaktException, IOException, QueryException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("cq", "referTo \"system/named-vc1\"").request()
+                .get();
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         node = node.at("/collection");
@@ -67,8 +74,11 @@
     }
 
     @Test
-    public void testRewriteFreeAndSystemVCRef() throws KustvaktException, Exception {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("cq", "referTo \"system-vc\"").request().get();
+    public void testRewriteFreeAndSystemVCRef ()
+            throws KustvaktException, Exception {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("cq", "referTo \"system-vc\"").request().get();
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         node = node.at("/collection");
@@ -85,8 +95,13 @@
     }
 
     @Test
-    public void testRewritePubAndSystemVCRef() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("cq", "referTo \"system/system-vc\"").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("user", "pass")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
+    public void testRewritePubAndSystemVCRef () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("cq", "referTo \"system/system-vc\"").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("user", "pass"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         node = node.at("/collection");
@@ -100,8 +115,14 @@
     }
 
     @Test
-    public void testRewriteWithDoryVCRef() throws KustvaktException, IOException, QueryException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "Fisch").queryParam("ql", "poliqarp").queryParam("cq", "referTo \"dory/dory-vc\"").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("dory", "pass")).get();
+    public void testRewriteWithDoryVCRef ()
+            throws KustvaktException, IOException, QueryException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "Fisch").queryParam("ql", "poliqarp")
+                .queryParam("cq", "referTo \"dory/dory-vc\"").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("dory", "pass"))
+                .get();
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         node = node.at("/collection");
diff --git a/full/src/test/java/de/ids_mannheim/korap/scenario/ICCTest.java b/full/src/test/java/de/ids_mannheim/korap/scenario/ICCTest.java
index 0119a21..fcc655f 100644
--- a/full/src/test/java/de/ids_mannheim/korap/scenario/ICCTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/scenario/ICCTest.java
@@ -28,12 +28,15 @@
  * this instance:<em>kustvakt-icc.conf</em>.
  *
  * <p>
- * To run a Kustvakt jar with ICC setup, the following files are needed:
+ * To run a Kustvakt jar with ICC setup, the following files are
+ * needed:
  * </p>
  * <ul>
  * <li>a Spring configuration file</li>
- * <li>a Kustvakt configuration file that must be placed at the jar folder</li>
- * <li>a JDBC properties file that must be placed at the jar folder</li>
+ * <li>a Kustvakt configuration file that must be placed at the jar
+ * folder</li>
+ * <li>a JDBC properties file that must be placed at the jar
+ * folder</li>
  * </ul>
  * <p>
  * Example:
@@ -67,12 +70,14 @@
  * </code>
  * </pre>
  *
- * <p>For production, the init-method of Initializator should be changed to init.</p>
+ * <p>For production, the init-method of Initializator should be
+ * changed to init.</p>
  *
  * <pre>
  * <code>
- * &lt;bean id="initializator" class="de.ids_mannheim.de.init.Initializator"
- *   init-method="init"&gt;&lt;/bean&gt;
+ * &lt;bean id="initializator"
+ * class="de.ids_mannheim.de.init.Initializator"
+ * init-method="init"&gt;&lt;/bean&gt;
  * </code>
  * </pre>
  *
@@ -129,22 +134,28 @@
 
     public String basicAuth;
 
-    public ICCTest() throws KustvaktException {
-        basicAuth = HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("user", "password");
+    public ICCTest () throws KustvaktException {
+        basicAuth = HttpAuthorizationHandler
+                .createBasicAuthorizationHeaderValue("user", "password");
     }
 
     @Test
-    public void searchWithoutLogin() throws KustvaktException {
-        Response r = target().path(API_VERSION).path("search").queryParam("q", "[orth=das]").queryParam("ql", "poliqarp").request().get();
+    public void searchWithoutLogin () throws KustvaktException {
+        Response r = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=das]").queryParam("ql", "poliqarp")
+                .request().get();
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), r.getStatus());
         String entity = r.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.AUTHORIZATION_FAILED, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.AUTHORIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
     }
 
     @Test
-    public void searchWithLogin() throws KustvaktException {
-        Response r = target().path(API_VERSION).path("search").queryParam("q", "[orth=das]").queryParam("ql", "poliqarp").request().header(Attributes.AUTHORIZATION, basicAuth).get();
+    public void searchWithLogin () throws KustvaktException {
+        Response r = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=das]").queryParam("ql", "poliqarp")
+                .request().header(Attributes.AUTHORIZATION, basicAuth).get();
         assertEquals(Status.OK.getStatusCode(), r.getStatus());
         String entity = r.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -152,17 +163,23 @@
     }
 
     @Test
-    public void matchInfoWithoutLogin() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("corpus").path("WDD17").path("982").path("72848").path("p2815-2816").queryParam("foundry", "*").request().get();
+    public void matchInfoWithoutLogin () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("corpus")
+                .path("WDD17").path("982").path("72848").path("p2815-2816")
+                .queryParam("foundry", "*").request().get();
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.AUTHORIZATION_FAILED, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.AUTHORIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
     }
 
     @Test
-    public void matchInfoWithLogin() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("corpus").path("WDD17").path("982").path("72848").path("p2815-2816").queryParam("foundry", "*").request().header(Attributes.AUTHORIZATION, basicAuth).get();
+    public void matchInfoWithLogin () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("corpus")
+                .path("WDD17").path("982").path("72848").path("p2815-2816")
+                .queryParam("foundry", "*").request()
+                .header(Attributes.AUTHORIZATION, basicAuth).get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
diff --git a/full/src/test/java/de/ids_mannheim/korap/server/EmbeddedLdapServerTest.java b/full/src/test/java/de/ids_mannheim/korap/server/EmbeddedLdapServerTest.java
index 79f640f..98b35cf 100644
--- a/full/src/test/java/de/ids_mannheim/korap/server/EmbeddedLdapServerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/server/EmbeddedLdapServerTest.java
@@ -18,71 +18,90 @@
 import static de.ids_mannheim.korap.authentication.LdapAuth3.LDAP_AUTH_RUNKNOWN;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 
-
 public class EmbeddedLdapServerTest {
 
     public static final String TEST_EMBEDDED_LDAP_CONF = "src/test/resources/test-embedded-ldap.conf";
 
     @AfterAll
-    static void shutdownEmbeddedLdapServer() {
+    static void shutdownEmbeddedLdapServer () {
         EmbeddedLdapServer.stop();
     }
 
     @Test
-    public void embeddedServerStartsAutomaticallyAndUsersCanLogin() throws LDAPException {
-        assertEquals(LDAP_AUTH_ROK, LdapAuth3.login("user", "password", TEST_EMBEDDED_LDAP_CONF));
+    public void embeddedServerStartsAutomaticallyAndUsersCanLogin ()
+            throws LDAPException {
+        assertEquals(LDAP_AUTH_ROK,
+                LdapAuth3.login("user", "password", TEST_EMBEDDED_LDAP_CONF));
     }
 
     @Test
-    public void usersWithClearPasswordCanLogin() throws LDAPException {
-        assertEquals(LDAP_AUTH_ROK, LdapAuth3.login("user1", "password1", TEST_EMBEDDED_LDAP_CONF));
+    public void usersWithClearPasswordCanLogin () throws LDAPException {
+        assertEquals(LDAP_AUTH_ROK,
+                LdapAuth3.login("user1", "password1", TEST_EMBEDDED_LDAP_CONF));
     }
 
     @Test
-    public void usersWithSHA1PasswordCanLogin() throws LDAPException, NoSuchAlgorithmException {
-        assertEquals(LDAP_AUTH_ROK, LdapAuth3.login("user3", "password3", TEST_EMBEDDED_LDAP_CONF));
+    public void usersWithSHA1PasswordCanLogin ()
+            throws LDAPException, NoSuchAlgorithmException {
+        assertEquals(LDAP_AUTH_ROK,
+                LdapAuth3.login("user3", "password3", TEST_EMBEDDED_LDAP_CONF));
     }
 
     @Test
-    public void usersWithSHA256PasswordCanLogin() throws LDAPException, NoSuchAlgorithmException, InvalidKeySpecException {
-        assertEquals(LDAP_AUTH_ROK, LdapAuth3.login("user4", "password4", TEST_EMBEDDED_LDAP_CONF));
+    public void usersWithSHA256PasswordCanLogin () throws LDAPException,
+            NoSuchAlgorithmException, InvalidKeySpecException {
+        assertEquals(LDAP_AUTH_ROK,
+                LdapAuth3.login("user4", "password4", TEST_EMBEDDED_LDAP_CONF));
     }
 
     @Test
-    public void asteriskPasswordsFail() throws LDAPException {
-        assertEquals(LDAP_AUTH_RUNKNOWN, LdapAuth3.login("user1", "*", TEST_EMBEDDED_LDAP_CONF));
+    public void asteriskPasswordsFail () throws LDAPException {
+        assertEquals(LDAP_AUTH_RUNKNOWN,
+                LdapAuth3.login("user1", "*", TEST_EMBEDDED_LDAP_CONF));
     }
 
     @Test
-    public void loginWithPreencodedPBKDF2Password() throws LDAPException, NoSuchAlgorithmException, InvalidKeySpecException {
+    public void loginWithPreencodedPBKDF2Password () throws LDAPException,
+            NoSuchAlgorithmException, InvalidKeySpecException {
         byte[] salt = new byte[32];
-        KeySpec spec = new PBEKeySpec("password5".toCharArray(), salt, 65536, 256);
-        SecretKeyFactory f = SecretKeyFactory.getInstance("PBKDF2withHmacSHA256");
+        KeySpec spec = new PBEKeySpec("password5".toCharArray(), salt, 65536,
+                256);
+        SecretKeyFactory f = SecretKeyFactory
+                .getInstance("PBKDF2withHmacSHA256");
         byte[] hash = f.generateSecret(spec).getEncoded();
-        final String pbkdf2sha256Password = "{PBKDF2-SHA256}" + Base64.encode(hash);
+        final String pbkdf2sha256Password = "{PBKDF2-SHA256}"
+                + Base64.encode(hash);
         // System.out.println(pbkdf2sha256Password);
-        assertEquals(LDAP_AUTH_ROK, LdapAuth3.login("user5", pbkdf2sha256Password, TEST_EMBEDDED_LDAP_CONF));
+        assertEquals(LDAP_AUTH_ROK, LdapAuth3.login("user5",
+                pbkdf2sha256Password, TEST_EMBEDDED_LDAP_CONF));
     }
 
     @Test
-    public void loginWithUnencodedPBKDF2PasswordFails() throws LDAPException, NoSuchAlgorithmException, InvalidKeySpecException {
-        assertEquals(LDAP_AUTH_RUNKNOWN, LdapAuth3.login("user5", "password5", TEST_EMBEDDED_LDAP_CONF));
+    public void loginWithUnencodedPBKDF2PasswordFails () throws LDAPException,
+            NoSuchAlgorithmException, InvalidKeySpecException {
+        assertEquals(LDAP_AUTH_RUNKNOWN,
+                LdapAuth3.login("user5", "password5", TEST_EMBEDDED_LDAP_CONF));
     }
 
     @Test
-    public void unauthorizedUsersAreNotAllowed() throws LDAPException {
-        assertEquals(LDAP_AUTH_RUNKNOWN, LdapAuth3.login("yuser", "password", TEST_EMBEDDED_LDAP_CONF));
+    public void unauthorizedUsersAreNotAllowed () throws LDAPException {
+        assertEquals(LDAP_AUTH_RUNKNOWN,
+                LdapAuth3.login("yuser", "password", TEST_EMBEDDED_LDAP_CONF));
     }
 
     @Test
-    public void gettingMailForUser() throws LDAPException, UnknownHostException, GeneralSecurityException {
+    public void gettingMailForUser () throws LDAPException,
+            UnknownHostException, GeneralSecurityException {
         EmbeddedLdapServer.startIfNotRunning(TEST_EMBEDDED_LDAP_CONF);
-        assertEquals(LdapAuth3.getEmail("user2", TEST_EMBEDDED_LDAP_CONF), "user2@example.com");
+        assertEquals(LdapAuth3.getEmail("user2", TEST_EMBEDDED_LDAP_CONF),
+                "user2@example.com");
     }
 
     @Test
-    public void gettingMailForNAUTHUserIsNull() throws LDAPException, UnknownHostException, GeneralSecurityException {
+    public void gettingMailForNAUTHUserIsNull () throws LDAPException,
+            UnknownHostException, GeneralSecurityException {
         EmbeddedLdapServer.startIfNotRunning(TEST_EMBEDDED_LDAP_CONF);
-        assertEquals(null, LdapAuth3.getEmail("user1000", TEST_EMBEDDED_LDAP_CONF));
+        assertEquals(null,
+                LdapAuth3.getEmail("user1000", TEST_EMBEDDED_LDAP_CONF));
     }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/service/VirtualCorpusServiceTest.java b/full/src/test/java/de/ids_mannheim/korap/service/VirtualCorpusServiceTest.java
index 60a661f..8799ad7 100644
--- a/full/src/test/java/de/ids_mannheim/korap/service/VirtualCorpusServiceTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/service/VirtualCorpusServiceTest.java
@@ -33,7 +33,7 @@
     private UserGroupService groupService;
 
     @Test
-    public void testCreateNonUniqueVC() throws KustvaktException {
+    public void testCreateNonUniqueVC () throws KustvaktException {
         // EM: message differs depending on the database used
         // for testing. The message below is from sqlite.
         // thrown.expectMessage("A UNIQUE constraint failed "
@@ -43,11 +43,12 @@
         vc.setCorpusQuery("corpusSigle=GOE");
         vc.setType(ResourceType.PRIVATE);
         vc.setQueryType(QueryType.VIRTUAL_CORPUS);
-        assertThrows(KustvaktException.class, () -> vcService.storeQuery(vc, "dory-vc", "dory", "dory"));
+        assertThrows(KustvaktException.class,
+                () -> vcService.storeQuery(vc, "dory-vc", "dory", "dory"));
     }
 
     @Test
-    public void createDeletePublishVC() throws KustvaktException {
+    public void createDeletePublishVC () throws KustvaktException {
         String vcName = "new-published-vc";
         QueryJson vc = new QueryJson();
         vc.setCorpusQuery("corpusSigle=GOE");
@@ -55,7 +56,8 @@
         vc.setQueryType(QueryType.VIRTUAL_CORPUS);
         String username = "VirtualCorpusServiceTest";
         vcService.storeQuery(vc, vcName, username, username);
-        List<QueryAccessDto> accesses = vcService.listQueryAccessByUsername("admin");
+        List<QueryAccessDto> accesses = vcService
+                .listQueryAccessByUsername("admin");
         int size = accesses.size();
         QueryAccessDto dto = accesses.get(accesses.size() - 1);
         assertEquals(vcName, dto.getQueryName());
@@ -66,21 +68,25 @@
         UserGroup group = groupService.retrieveUserGroupById(groupId);
         assertEquals(UserGroupStatus.HIDDEN, group.getStatus());
         // delete vc
-        vcService.deleteQueryByName(username, vcName, username, QueryType.VIRTUAL_CORPUS);
+        vcService.deleteQueryByName(username, vcName, username,
+                QueryType.VIRTUAL_CORPUS);
         // check hidden access
         accesses = vcService.listQueryAccessByUsername("admin");
         assertEquals(size - 1, accesses.size());
         // check hidden group
-        KustvaktException e = assertThrows(KustvaktException.class, () -> groupService.retrieveUserGroupById(groupId));
-        assertEquals("Group with id " + groupId + " is not found", e.getMessage());
+        KustvaktException e = assertThrows(KustvaktException.class,
+                () -> groupService.retrieveUserGroupById(groupId));
+        assertEquals("Group with id " + groupId + " is not found",
+                e.getMessage());
     }
 
     @Test
-    public void testEditPublishVC() throws KustvaktException {
+    public void testEditPublishVC () throws KustvaktException {
         String username = "dory";
         int vcId = 2;
         String vcName = "group-vc";
-        QueryDO existingVC = vcService.searchQueryByName(username, vcName, username, QueryType.VIRTUAL_CORPUS);
+        QueryDO existingVC = vcService.searchQueryByName(username, vcName,
+                username, QueryType.VIRTUAL_CORPUS);
         QueryJson vcJson = new QueryJson();
         vcJson.setType(ResourceType.PUBLISHED);
         vcService.editQuery(existingVC, vcJson, vcName, username);
@@ -89,7 +95,8 @@
         assertEquals(vcName, vcDto.getName());
         assertEquals(ResourceType.PUBLISHED.displayName(), vcDto.getType());
         // check access
-        List<QueryAccessDto> accesses = vcService.listQueryAccessByUsername("admin");
+        List<QueryAccessDto> accesses = vcService
+                .listQueryAccessByUsername("admin");
         int size = accesses.size();
         QueryAccessDto dto = accesses.get(accesses.size() - 1);
         assertEquals(vcName, dto.getQueryName());
@@ -110,7 +117,9 @@
         // check access
         accesses = vcService.listQueryAccessByUsername("admin");
         assertEquals(size - 1, accesses.size());
-        KustvaktException e = assertThrows(KustvaktException.class, () -> groupService.retrieveUserGroupById(groupId));
-        assertEquals("Group with id " + groupId + " is not found", e.getMessage());
+        KustvaktException e = assertThrows(KustvaktException.class,
+                () -> groupService.retrieveUserGroupById(groupId));
+        assertEquals("Group with id " + groupId + " is not found",
+                e.getMessage());
     }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/user/DataFactoryTest.java b/full/src/test/java/de/ids_mannheim/korap/user/DataFactoryTest.java
index 513020e..5584fb7 100644
--- a/full/src/test/java/de/ids_mannheim/korap/user/DataFactoryTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/user/DataFactoryTest.java
@@ -20,7 +20,7 @@
 public class DataFactoryTest {
 
     @Test
-    public void testDataFactoryAdd() throws KustvaktException {
+    public void testDataFactoryAdd () throws KustvaktException {
         String data = "{}";
         Object node = JsonUtils.readTree(data);
         DataFactory factory = DataFactory.getFactory();
@@ -36,7 +36,7 @@
     }
 
     @Test
-    public void testDataFactoryGet() throws KustvaktException {
+    public void testDataFactoryGet () throws KustvaktException {
         String data = "{}";
         Object node = JsonUtils.readTree(data);
         DataFactory factory = DataFactory.getFactory();
@@ -63,7 +63,7 @@
     }
 
     @Test
-    public void testDataFactoryMerge() throws KustvaktException {
+    public void testDataFactoryMerge () throws KustvaktException {
         String data = "{}";
         Object node = JsonUtils.readTree(data);
         DataFactory factory = DataFactory.getFactory();
@@ -85,7 +85,7 @@
     }
 
     @Test
-    public void testDataFactoryKeys() throws KustvaktException {
+    public void testDataFactoryKeys () throws KustvaktException {
         String data = "{}";
         Object node = JsonUtils.readTree(data);
         DataFactory factory = DataFactory.getFactory();
@@ -98,7 +98,7 @@
 
     @Test
     @Disabled
-    public void testDataFactoryRemove() throws KustvaktException {
+    public void testDataFactoryRemove () throws KustvaktException {
         String data = "{}";
         Object node = JsonUtils.readTree(data);
         DataFactory factory = DataFactory.getFactory();
@@ -136,7 +136,7 @@
     }
 
     @Test
-    public void testDataFactoryEmbeddedProperty() throws KustvaktException {
+    public void testDataFactoryEmbeddedProperty () throws KustvaktException {
         String data = "{}";
         JsonNode node = JsonUtils.readTree(data);
         DataFactory factory = DataFactory.getFactory();
diff --git a/full/src/test/java/de/ids_mannheim/korap/user/UserdataTest.java b/full/src/test/java/de/ids_mannheim/korap/user/UserdataTest.java
index 75f3e6b..0e99a7f 100644
--- a/full/src/test/java/de/ids_mannheim/korap/user/UserdataTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/user/UserdataTest.java
@@ -27,7 +27,7 @@
 
     // EM: added
     @Test
-    public void testReadEmptyMap() throws KustvaktException {
+    public void testReadEmptyMap () throws KustvaktException {
         Userdata userData = new UserSettingProcessor();
         userData.read(new HashMap<>(), false);
         String jsonSettings = userData.serialize();
@@ -35,7 +35,7 @@
     }
 
     @Test
-    public void testReadNullMap() throws KustvaktException {
+    public void testReadNullMap () throws KustvaktException {
         Userdata userData = new UserSettingProcessor();
         userData.read(null, false);
         String jsonSettings = userData.serialize();
@@ -53,10 +53,10 @@
     // 
     // At the moment, validation is not needed for default settings.
     @Test
-    public void testValidateMap() throws IOException, KustvaktException {
+    public void testValidateMap () throws IOException, KustvaktException {
         Map<String, Object> map = new HashMap<>();
-        map.put("k1", Arrays.asList(new String[]{"a", "b", "c"}));
-        map.put("k2", Arrays.asList(new Integer[]{1, 2, 3}));
+        map.put("k1", Arrays.asList(new String[] { "a", "b", "c" }));
+        map.put("k2", Arrays.asList(new Integer[] { 1, 2, 3 }));
         Userdata data = new UserSettingProcessor();
         data.read(map, false);
         data.validate(new ApacheValidator());
@@ -64,7 +64,7 @@
 
     // EM: below are tests from MH
     @Test
-    public void testDataValidation() {
+    public void testDataValidation () {
         Userdata data = new UserDetails(1);
         data.setField(Attributes.COUNTRY, "Germany");
         String[] req = data.requiredFields();
@@ -75,7 +75,7 @@
     }
 
     @Test
-    public void testSettingsValidation() {
+    public void testSettingsValidation () {
         Userdata data = new UserSettingProcessor();
         data.setField(Attributes.FILE_FORMAT_FOR_EXPORT, "export");
         String[] req = data.requiredFields();
@@ -86,7 +86,7 @@
     }
 
     @Test
-    public void testUserdataRequiredFields() throws KustvaktException {
+    public void testUserdataRequiredFields () throws KustvaktException {
         UserDetails details = new UserDetails(-1);
         Map<String, Object> m = new HashMap<>();
         m.put(Attributes.FIRSTNAME, "first");
@@ -100,7 +100,7 @@
     }
 
     @Test
-    public void testUserdataDefaultFields() throws KustvaktException {
+    public void testUserdataDefaultFields () throws KustvaktException {
         UserSettingProcessor settings = new UserSettingProcessor();
         Map<String, Object> m = new HashMap<>();
         m.put(Attributes.DEFAULT_FOUNDRY_RELATION, "rel_1");
@@ -113,15 +113,17 @@
         settings.read(m, true);
         assertNotEquals(m.size(), settings.size());
         assertEquals(settings.defaultFields().length, settings.size());
-        assertEquals(settings.get(Attributes.DEFAULT_FOUNDRY_RELATION), "rel_1");
+        assertEquals(settings.get(Attributes.DEFAULT_FOUNDRY_RELATION),
+                "rel_1");
         assertEquals(settings.get(Attributes.DEFAULT_FOUNDRY_POS), "pos_1");
         assertEquals(settings.get(Attributes.DEFAULT_FOUNDRY_LEMMA), "lemma_1");
-        assertEquals(settings.get(Attributes.DEFAULT_FOUNDRY_CONSTITUENT), "const_1");
+        assertEquals(settings.get(Attributes.DEFAULT_FOUNDRY_CONSTITUENT),
+                "const_1");
         assertEquals(10, settings.get(Attributes.PAGE_LENGTH));
     }
 
     @Test
-    public void testUserDataRequiredFieldsException() {
+    public void testUserDataRequiredFieldsException () {
         assertThrows(KustvaktException.class, () -> {
             UserDetails details = new UserDetails(-1);
             Map<String, Object> m = new HashMap<>();
@@ -137,7 +139,7 @@
     }
 
     @Test
-    public void testUserDataPointerFunction() throws KustvaktException {
+    public void testUserDataPointerFunction () throws KustvaktException {
         UserDetails details = new UserDetails(-1);
         Map<String, Object> m = new HashMap<>();
         m.put(Attributes.FIRSTNAME, "first");
@@ -154,7 +156,7 @@
     }
 
     @Test
-    public void testUserDataUpdate() {
+    public void testUserDataUpdate () {
         UserDetails details = new UserDetails(-1);
         details.setField(Attributes.FIRSTNAME, "first");
         details.setField(Attributes.LASTNAME, "last");
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/ApiVersionTest.java b/full/src/test/java/de/ids_mannheim/korap/web/ApiVersionTest.java
index e06fe0d..9e138fa 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/ApiVersionTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/ApiVersionTest.java
@@ -18,16 +18,20 @@
 public class ApiVersionTest extends SpringJerseyTest {
 
     @Test
-    public void testSearchWithoutVersion() throws KustvaktException {
-        Response response = target().path("api").path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").request().accept(MediaType.APPLICATION_JSON).get();
+    public void testSearchWithoutVersion () throws KustvaktException {
+        Response response = target().path("api").path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .request().accept(MediaType.APPLICATION_JSON).get();
         assertEquals(HttpStatus.PERMANENT_REDIRECT_308, response.getStatus());
         URI location = response.getLocation();
         assertEquals("/api/" + API_VERSION + "/search", location.getPath());
     }
 
     @Test
-    public void testSearchWrongVersion() throws KustvaktException {
-        Response response = target().path("api").path("v0.2").path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").request().accept(MediaType.APPLICATION_JSON).get();
+    public void testSearchWrongVersion () throws KustvaktException {
+        Response response = target().path("api").path("v0.2").path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .request().accept(MediaType.APPLICATION_JSON).get();
         assertEquals(HttpStatus.PERMANENT_REDIRECT_308, response.getStatus());
         URI location = response.getLocation();
         assertEquals("/api/" + API_VERSION + "/search", location.getPath());
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/InitialSuperClientTest.java b/full/src/test/java/de/ids_mannheim/korap/web/InitialSuperClientTest.java
index a936e6b..e8c8eef 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/InitialSuperClientTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/InitialSuperClientTest.java
@@ -29,10 +29,12 @@
     @Autowired
     private OAuth2ClientDao clientDao;
 
-    private String path = KustvaktConfiguration.DATA_FOLDER + "/" + OAuth2InitClientService.TEST_OUTPUT_FILENAME;
+    private String path = KustvaktConfiguration.DATA_FOLDER + "/"
+            + OAuth2InitClientService.TEST_OUTPUT_FILENAME;
 
     @Test
-    public void testCreatingInitialSuperClient() throws IOException, KustvaktException {
+    public void testCreatingInitialSuperClient ()
+            throws IOException, KustvaktException {
         assertTrue(config.createInitialSuperClient());
         File f = new File(path);
         assertTrue(f.exists());
@@ -45,8 +47,10 @@
         removeSuperClientFile();
     }
 
-    private void testLogin(String superClientId, String superClientSecret) throws KustvaktException {
-        Response response = requestTokenWithPassword(superClientId, superClientSecret, "username", "password");
+    private void testLogin (String superClientId, String superClientSecret)
+            throws KustvaktException {
+        Response response = requestTokenWithPassword(superClientId,
+                superClientSecret, "username", "password");
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         assertTrue(!node.at("/access_token").isMissingNode());
@@ -56,7 +60,7 @@
         assertEquals(node.at("/token_type").asText(), "Bearer");
     }
 
-    private void removeSuperClientFile() {
+    private void removeSuperClientFile () {
         File f = new File(path);
         if (f.exists()) {
             f.delete();
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/JettyServerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/JettyServerTest.java
index 571c15c..4730f2c 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/JettyServerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/JettyServerTest.java
@@ -18,29 +18,30 @@
 public class JettyServerTest {
 
     static int selectedPort = 0;
-    
+
     @BeforeAll
-    static void testServerStarts() throws Exception {
-        
-        
+    static void testServerStarts () throws Exception {
+
         for (int port = 1000; port <= 2000; port++) {
             try (ServerSocket ignored = new ServerSocket(port)) {
                 selectedPort = port;
                 break;
-            } catch (IOException ignored) {
+            }
+            catch (IOException ignored) {
                 // Port is already in use, try the next one
             }
         }
-        
+
         Server server = new Server(selectedPort);
-        ShutdownHandler shutdownHandler = new ShutdownHandler("secret"); 
+        ShutdownHandler shutdownHandler = new ShutdownHandler("secret");
         server.setHandler(shutdownHandler);
         server.start();
     }
-    
+
     @Test
-    public void testShutdown() throws IOException {
-        URL url = new URL("http://localhost:"+selectedPort+"/shutdown?token=secret");
+    public void testShutdown () throws IOException {
+        URL url = new URL(
+                "http://localhost:" + selectedPort + "/shutdown?token=secret");
         HttpURLConnection connection = (HttpURLConnection) url.openConnection();
         connection.setRequestMethod("POST");
         assertEquals(200, connection.getResponseCode());
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/SearchKrillTest.java b/full/src/test/java/de/ids_mannheim/korap/web/SearchKrillTest.java
index c4476c2..2034592 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/SearchKrillTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/SearchKrillTest.java
@@ -30,31 +30,33 @@
     SearchKrill krill = null;
 
     @PostConstruct
-    private void createKrill() {
+    private void createKrill () {
         krill = new SearchKrill(config.getIndexDir());
         assertNotNull(krill);
     }
 
     @Test
-    public void testIndex() throws KustvaktException {
+    public void testIndex () throws KustvaktException {
         KrillIndex index = krill.getIndex();
         assertNotNull(index);
     }
 
     @Test
-    public void testDocSize() {
+    public void testDocSize () {
         assertNotEquals(0, krill.getIndex().numberOf("documents"));
     }
 
     @Test
-    public void testMatchInfo() throws KustvaktException {
-        String matchinfo = krill.getMatch("WPD/AAA.00002/p169-197", config.getFreeLicensePattern());
+    public void testMatchInfo () throws KustvaktException {
+        String matchinfo = krill.getMatch("WPD/AAA.00002/p169-197",
+                config.getFreeLicensePattern());
         JsonNode node = JsonUtils.readTree(matchinfo);
-        assertEquals(node.at("/errors/0/1").asText(), "Invalid match identifier");
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Invalid match identifier");
     }
 
     @Test
-    public void testSearch() throws KustvaktException {
+    public void testSearch () throws KustvaktException {
         QuerySerializer s = new QuerySerializer();
         s.setQuery("[orth=der]", "poliqarp");
         String result = krill.search(s.toJSON());
@@ -64,7 +66,7 @@
     }
 
     @Test
-    public void testTimeOut() throws KustvaktException {
+    public void testTimeOut () throws KustvaktException {
         QuerySerializer s = new QuerySerializer();
         s.setQuery("[orth=der]", "poliqarp");
         // s.setQuery("node ->malt/d[func=/.*/] node", "annis");
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/AdminLoadVCTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/AdminLoadVCTest.java
index c7bc757..2c359a0 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/AdminLoadVCTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/AdminLoadVCTest.java
@@ -20,11 +20,16 @@
 public class AdminLoadVCTest extends SpringJerseyTest {
 
     @Test
-    public void testLoadCacheVC() throws KustvaktException, InterruptedException {
+    public void testLoadCacheVC ()
+            throws KustvaktException, InterruptedException {
         assertFalse(VirtualCorpusCache.contains("named-vc1"));
         Form f = new Form();
         f.param("token", "secret");
-        Response response = target().path(API_VERSION).path("admin").path("vc").path("load-cache").request().header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED).post(Entity.form(f));
+        Response response = target().path(API_VERSION).path("admin").path("vc")
+                .path("load-cache").request()
+                .header(HttpHeaders.CONTENT_TYPE,
+                        MediaType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(f));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         Thread.sleep(100);
         assertTrue(VirtualCorpusCache.contains("named-vc1"));
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/AnnotationControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/AnnotationControllerTest.java
index 9626114..e6737bb 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/AnnotationControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/AnnotationControllerTest.java
@@ -19,8 +19,9 @@
 public class AnnotationControllerTest extends SpringJerseyTest {
 
     @Test
-    public void testAnnotationLayers() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("annotation").path("layers").request().get();
+    public void testAnnotationLayers () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("annotation")
+                .path("layers").request().get();
         String entity = response.readEntity(String.class);
         JsonNode n = JsonUtils.readTree(entity);
         assertEquals(31, n.size());
@@ -33,9 +34,10 @@
     }
 
     @Test
-    public void testAnnotationFoundry() throws KustvaktException {
+    public void testAnnotationFoundry () throws KustvaktException {
         String json = "{\"codes\":[\"opennlp/*\"], \"language\":\"en\"}";
-        Response response = target().path(API_VERSION).path("annotation").path("description").request().post(Entity.json(json));
+        Response response = target().path(API_VERSION).path("annotation")
+                .path("description").request().post(Entity.json(json));
         String entity = response.readEntity(String.class);
         JsonNode n = JsonUtils.readTree(entity);
         n = n.get(0);
@@ -53,9 +55,10 @@
     }
 
     @Test
-    public void testAnnotationValues() throws KustvaktException {
+    public void testAnnotationValues () throws KustvaktException {
         String json = "{\"codes\":[\"mate/m\"], \"language\":\"en\"}";
-        Response response = target().path(API_VERSION).path("annotation").path("description").request().post(Entity.json(json));
+        Response response = target().path(API_VERSION).path("annotation")
+                .path("description").request().post(Entity.json(json));
         String entity = response.readEntity(String.class);
         JsonNode n = JsonUtils.readTree(entity);
         n = n.get(0);
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/AvailabilityTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/AvailabilityTest.java
index ca4c915..42d7a68 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/AvailabilityTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/AvailabilityTest.java
@@ -19,125 +19,193 @@
 
 public class AvailabilityTest extends SpringJerseyTest {
 
-    private void checkAndFree(String json) throws KustvaktException {
+    private void checkAndFree (String json) throws KustvaktException {
         JsonNode node = JsonUtils.readTree(json);
-        assertEquals(node.at("/collection/operands/0/key").asText(), "availability");
-        assertEquals(node.at("/collection/operands/0/value").asText(), "CC-BY.*");
-        assertEquals(node.at("/collection/rewrites/0/operation").asText(), "operation:insertion");
-        assertEquals(node.at("/collection/rewrites/0/scope").asText(), "availability(FREE)");
+        assertEquals(node.at("/collection/operands/0/key").asText(),
+                "availability");
+        assertEquals(node.at("/collection/operands/0/value").asText(),
+                "CC-BY.*");
+        assertEquals(node.at("/collection/rewrites/0/operation").asText(),
+                "operation:insertion");
+        assertEquals(node.at("/collection/rewrites/0/scope").asText(),
+                "availability(FREE)");
     }
 
-    private void checkAndPublic(String json) throws KustvaktException {
+    private void checkAndPublic (String json) throws KustvaktException {
         JsonNode node = JsonUtils.readTree(json);
         assertNotNull(node);
-        assertEquals(node.at("/collection/operation").asText(), "operation:and");
-        assertEquals(node.at("/collection/operands/0/operands/0/match").asText(), "match:eq");
-        assertEquals(node.at("/collection/operands/0/operands/0/type").asText(), "type:regex");
-        assertEquals(node.at("/collection/operands/0/operands/0/key").asText(), "availability");
-        assertEquals(node.at("/collection/operands/0/operands/0/value").asText(), "CC-BY.*");
-        assertEquals(node.at("/collection/operands/0/operands/1/operands/0/match").asText(), "match:eq");
-        assertEquals(node.at("/collection/operands/0/operands/1/operands/0/value").asText(), "ACA.*");
-        assertEquals(node.at("/collection/operands/0/operands/1/operands/1/match").asText(), "match:eq");
-        assertEquals(node.at("/collection/operands/0/operands/1/operands/1/value").asText(), "QAO-NC");
-        assertEquals(node.at("/collection/rewrites/0/operation").asText(), "operation:insertion");
-        assertEquals(node.at("/collection/rewrites/0/scope").asText(), "availability(PUB)");
+        assertEquals(node.at("/collection/operation").asText(),
+                "operation:and");
+        assertEquals(
+                node.at("/collection/operands/0/operands/0/match").asText(),
+                "match:eq");
+        assertEquals(node.at("/collection/operands/0/operands/0/type").asText(),
+                "type:regex");
+        assertEquals(node.at("/collection/operands/0/operands/0/key").asText(),
+                "availability");
+        assertEquals(
+                node.at("/collection/operands/0/operands/0/value").asText(),
+                "CC-BY.*");
+        assertEquals(
+                node.at("/collection/operands/0/operands/1/operands/0/match")
+                        .asText(),
+                "match:eq");
+        assertEquals(
+                node.at("/collection/operands/0/operands/1/operands/0/value")
+                        .asText(),
+                "ACA.*");
+        assertEquals(
+                node.at("/collection/operands/0/operands/1/operands/1/match")
+                        .asText(),
+                "match:eq");
+        assertEquals(
+                node.at("/collection/operands/0/operands/1/operands/1/value")
+                        .asText(),
+                "QAO-NC");
+        assertEquals(node.at("/collection/rewrites/0/operation").asText(),
+                "operation:insertion");
+        assertEquals(node.at("/collection/rewrites/0/scope").asText(),
+                "availability(PUB)");
     }
 
-    private void checkAndPublicWithACA(String json) throws KustvaktException {
+    private void checkAndPublicWithACA (String json) throws KustvaktException {
         JsonNode node = JsonUtils.readTree(json);
         assertNotNull(node);
-        assertEquals(node.at("/collection/operation").asText(), "operation:and");
-        assertEquals(node.at("/collection/rewrites/0/operation").asText(), "operation:insertion");
-        assertEquals(node.at("/collection/rewrites/0/scope").asText(), "availability(PUB)");
-        assertEquals(node.at("/collection/operands/1/match").asText(), "match:eq");
-        assertEquals(node.at("/collection/operands/1/type").asText(), "type:regex");
-        assertEquals(node.at("/collection/operands/1/key").asText(), "availability");
+        assertEquals(node.at("/collection/operation").asText(),
+                "operation:and");
+        assertEquals(node.at("/collection/rewrites/0/operation").asText(),
+                "operation:insertion");
+        assertEquals(node.at("/collection/rewrites/0/scope").asText(),
+                "availability(PUB)");
+        assertEquals(node.at("/collection/operands/1/match").asText(),
+                "match:eq");
+        assertEquals(node.at("/collection/operands/1/type").asText(),
+                "type:regex");
+        assertEquals(node.at("/collection/operands/1/key").asText(),
+                "availability");
         assertEquals(node.at("/collection/operands/1/value").asText(), "ACA.*");
         node = node.at("/collection/operands/0");
         assertEquals(node.at("/operands/0/match").asText(), "match:eq");
         assertEquals(node.at("/operands/0/type").asText(), "type:regex");
         assertEquals(node.at("/operands/0/key").asText(), "availability");
         assertEquals(node.at("/operands/0/value").asText(), "CC-BY.*");
-        assertEquals(node.at("/operands/1/operands/0/match").asText(), "match:eq");
-        assertEquals(node.at("/operands/1/operands/0/type").asText(), "type:regex");
-        assertEquals(node.at("/operands/1/operands/0/key").asText(), "availability");
+        assertEquals(node.at("/operands/1/operands/0/match").asText(),
+                "match:eq");
+        assertEquals(node.at("/operands/1/operands/0/type").asText(),
+                "type:regex");
+        assertEquals(node.at("/operands/1/operands/0/key").asText(),
+                "availability");
         assertEquals(node.at("/operands/1/operands/0/value").asText(), "ACA.*");
     }
 
-    private void checkAndAllWithACA(String json) throws KustvaktException {
+    private void checkAndAllWithACA (String json) throws KustvaktException {
         JsonNode node = JsonUtils.readTree(json);
         assertNotNull(node);
-        assertEquals(node.at("/collection/operation").asText(), "operation:and");
-        assertEquals(node.at("/collection/rewrites/0/operation").asText(), "operation:insertion");
-        assertEquals(node.at("/collection/rewrites/0/scope").asText(), "availability(ALL)");
-        assertEquals(node.at("/collection/operands/1/match").asText(), "match:eq");
-        assertEquals(node.at("/collection/operands/1/type").asText(), "type:regex");
-        assertEquals(node.at("/collection/operands/1/key").asText(), "availability");
+        assertEquals(node.at("/collection/operation").asText(),
+                "operation:and");
+        assertEquals(node.at("/collection/rewrites/0/operation").asText(),
+                "operation:insertion");
+        assertEquals(node.at("/collection/rewrites/0/scope").asText(),
+                "availability(ALL)");
+        assertEquals(node.at("/collection/operands/1/match").asText(),
+                "match:eq");
+        assertEquals(node.at("/collection/operands/1/type").asText(),
+                "type:regex");
+        assertEquals(node.at("/collection/operands/1/key").asText(),
+                "availability");
         assertEquals(node.at("/collection/operands/1/value").asText(), "ACA.*");
         node = node.at("/collection/operands/0");
         assertEquals(node.at("/operands/0/match").asText(), "match:eq");
         assertEquals(node.at("/operands/0/type").asText(), "type:regex");
         assertEquals(node.at("/operands/0/key").asText(), "availability");
         assertEquals(node.at("/operands/0/value").asText(), "CC-BY.*");
-        assertEquals(node.at("/operands/1/operands/1/operands/0/match").asText(), "match:eq");
-        assertEquals(node.at("/operands/1/operands/1/operands/0/value").asText(), "QAO-NC");
-        assertEquals(node.at("/operands/1/operands/1/operands/1/match").asText(), "match:eq");
-        assertEquals(node.at("/operands/1/operands/1/operands/1/value").asText(), "QAO.*");
+        assertEquals(
+                node.at("/operands/1/operands/1/operands/0/match").asText(),
+                "match:eq");
+        assertEquals(
+                node.at("/operands/1/operands/1/operands/0/value").asText(),
+                "QAO-NC");
+        assertEquals(
+                node.at("/operands/1/operands/1/operands/1/match").asText(),
+                "match:eq");
+        assertEquals(
+                node.at("/operands/1/operands/1/operands/1/value").asText(),
+                "QAO.*");
     }
 
-    private Response searchQuery(String collectionQuery) {
-        return target().path(API_VERSION).path("search").queryParam("q", "[orth=das]").queryParam("ql", "poliqarp").queryParam("cq", collectionQuery).request().get();
+    private Response searchQuery (String collectionQuery) {
+        return target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=das]").queryParam("ql", "poliqarp")
+                .queryParam("cq", collectionQuery).request().get();
     }
 
-    private Response searchQueryWithIP(String collectionQuery, String ip) throws ProcessingException, KustvaktException {
-        return target().path(API_VERSION).path("search").queryParam("q", "[orth=das]").queryParam("ql", "poliqarp").queryParam("cq", collectionQuery).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("kustvakt", "kustvakt2015")).header(HttpHeaders.X_FORWARDED_FOR, ip).get();
+    private Response searchQueryWithIP (String collectionQuery, String ip)
+            throws ProcessingException, KustvaktException {
+        return target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=das]").queryParam("ql", "poliqarp")
+                .queryParam("cq", collectionQuery).request()
+                .header(Attributes.AUTHORIZATION,
+                        HttpAuthorizationHandler
+                                .createBasicAuthorizationHeaderValue("kustvakt",
+                                        "kustvakt2015"))
+                .header(HttpHeaders.X_FORWARDED_FOR, ip).get();
     }
 
     @Test
-    public void testAvailabilityFreeAuthorized() throws KustvaktException {
+    public void testAvailabilityFreeAuthorized () throws KustvaktException {
         Response response = searchQuery("availability = CC-BY-SA");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         checkAndFree(response.readEntity(String.class));
     }
 
     @Test
-    public void testAvailabilityRegexFreeAuthorized() throws KustvaktException {
+    public void testAvailabilityRegexFreeAuthorized ()
+            throws KustvaktException {
         Response response = searchQuery("availability = /.*BY.*/");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         checkAndFree(response.readEntity(String.class));
     }
 
     @Test
-    public void testAvailabilityFreeUnauthorized() throws KustvaktException {
+    public void testAvailabilityFreeUnauthorized () throws KustvaktException {
         Response response = searchQuery("availability = ACA-NC");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         checkAndFree(response.readEntity(String.class));
     }
 
     @Test
-    public void testAvailabilityRegexFreeUnauthorized() throws KustvaktException {
+    public void testAvailabilityRegexFreeUnauthorized ()
+            throws KustvaktException {
         Response response = searchQuery("availability = /ACA.*/");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         checkAndFree(response.readEntity(String.class));
     }
 
     @Test
-    public void testAvailabilityRegexNoRewrite() throws KustvaktException {
-        Response response = searchQuery("availability = /CC-BY.*/ & availability = /ACA.*/");
+    public void testAvailabilityRegexNoRewrite () throws KustvaktException {
+        Response response = searchQuery(
+                "availability = /CC-BY.*/ & availability = /ACA.*/");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String json = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(json);
-        assertEquals(node.at("/collection/operation").asText(), "operation:and");
-        assertEquals(node.at("/collection/operands/0/match").asText(), "match:eq");
-        assertEquals(node.at("/collection/operands/0/type").asText(), "type:regex");
-        assertEquals(node.at("/collection/operands/0/key").asText(), "availability");
-        assertEquals(node.at("/collection/operands/0/value").asText(), "CC-BY.*");
-        assertEquals(node.at("/collection/operands/1/match").asText(), "match:eq");
+        assertEquals(node.at("/collection/operation").asText(),
+                "operation:and");
+        assertEquals(node.at("/collection/operands/0/match").asText(),
+                "match:eq");
+        assertEquals(node.at("/collection/operands/0/type").asText(),
+                "type:regex");
+        assertEquals(node.at("/collection/operands/0/key").asText(),
+                "availability");
+        assertEquals(node.at("/collection/operands/0/value").asText(),
+                "CC-BY.*");
+        assertEquals(node.at("/collection/operands/1/match").asText(),
+                "match:eq");
         assertEquals(node.at("/collection/operands/1/value").asText(), "ACA.*");
     }
 
     @Test
-    public void testAvailabilityRegexFreeUnauthorized3() throws KustvaktException {
+    public void testAvailabilityRegexFreeUnauthorized3 ()
+            throws KustvaktException {
         Response response = searchQuery("availability = /.*NC.*/");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         // System.out.println(response.readEntity(String.class));
@@ -145,113 +213,141 @@
     }
 
     @Test
-    public void testNegationAvailabilityFreeUnauthorized() throws KustvaktException {
+    public void testNegationAvailabilityFreeUnauthorized ()
+            throws KustvaktException {
         Response response = searchQuery("availability != /CC-BY.*/");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         checkAndFree(response.readEntity(String.class));
     }
 
     @Test
-    public void testNegationAvailabilityFreeUnauthorized2() throws KustvaktException {
+    public void testNegationAvailabilityFreeUnauthorized2 ()
+            throws KustvaktException {
         Response response = searchQuery("availability != /.*BY.*/");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         checkAndFree(response.readEntity(String.class));
     }
 
     @Test
-    public void testNegationAvailabilityWithOperationOrUnauthorized() throws KustvaktException {
-        Response response = searchQuery("availability = /CC-BY.*/ | availability != /CC-BY.*/");
+    public void testNegationAvailabilityWithOperationOrUnauthorized ()
+            throws KustvaktException {
+        Response response = searchQuery(
+                "availability = /CC-BY.*/ | availability != /CC-BY.*/");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         checkAndFree(response.readEntity(String.class));
     }
 
     @Test
-    public void testComplexNegationAvailabilityFreeUnauthorized() throws KustvaktException {
-        Response response = searchQuery("textClass=politik & availability != /CC-BY.*/");
+    public void testComplexNegationAvailabilityFreeUnauthorized ()
+            throws KustvaktException {
+        Response response = searchQuery(
+                "textClass=politik & availability != /CC-BY.*/");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         checkAndFree(response.readEntity(String.class));
     }
 
     @Test
-    public void testComplexAvailabilityFreeUnauthorized() throws KustvaktException {
-        Response response = searchQuery("textClass=politik & availability=ACA-NC");
+    public void testComplexAvailabilityFreeUnauthorized ()
+            throws KustvaktException {
+        Response response = searchQuery(
+                "textClass=politik & availability=ACA-NC");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         checkAndFree(response.readEntity(String.class));
     }
 
     @Test
-    public void testComplexAvailabilityFreeUnauthorized3() throws KustvaktException {
-        Response response = searchQuery("textClass=politik & availability=/.*NC.*/");
+    public void testComplexAvailabilityFreeUnauthorized3 ()
+            throws KustvaktException {
+        Response response = searchQuery(
+                "textClass=politik & availability=/.*NC.*/");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         checkAndFree(response.readEntity(String.class));
     }
 
     @Test
-    public void testAvailabilityPublicAuthorized() throws KustvaktException {
-        Response response = searchQueryWithIP("availability=ACA-NC", "149.27.0.32");
+    public void testAvailabilityPublicAuthorized () throws KustvaktException {
+        Response response = searchQueryWithIP("availability=ACA-NC",
+                "149.27.0.32");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         checkAndPublic(response.readEntity(String.class));
     }
 
     @Test
-    public void testAvailabilityPublicUnauthorized() throws KustvaktException {
-        Response response = searchQueryWithIP("availability=QAO-NC-LOC:ids", "149.27.0.32");
+    public void testAvailabilityPublicUnauthorized () throws KustvaktException {
+        Response response = searchQueryWithIP("availability=QAO-NC-LOC:ids",
+                "149.27.0.32");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         checkAndPublic(response.readEntity(String.class));
     }
 
     @Test
-    public void testAvailabilityRegexPublicAuthorized() throws KustvaktException {
-        Response response = searchQueryWithIP("availability= /ACA.*/", "149.27.0.32");
+    public void testAvailabilityRegexPublicAuthorized ()
+            throws KustvaktException {
+        Response response = searchQueryWithIP("availability= /ACA.*/",
+                "149.27.0.32");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         checkAndPublicWithACA(response.readEntity(String.class));
     }
 
     @Test
-    public void testNegationAvailabilityPublicUnauthorized() throws KustvaktException {
-        Response response = searchQueryWithIP("availability != ACA-NC", "149.27.0.32");
+    public void testNegationAvailabilityPublicUnauthorized ()
+            throws KustvaktException {
+        Response response = searchQueryWithIP("availability != ACA-NC",
+                "149.27.0.32");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         checkAndPublic(response.readEntity(String.class));
     }
 
     @Test
-    public void testNegationAvailabilityRegexPublicUnauthorized() throws KustvaktException {
-        Response response = searchQueryWithIP("availability != /ACA.*/", "149.27.0.32");
+    public void testNegationAvailabilityRegexPublicUnauthorized ()
+            throws KustvaktException {
+        Response response = searchQueryWithIP("availability != /ACA.*/",
+                "149.27.0.32");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         checkAndPublic(response.readEntity(String.class));
     }
 
     @Test
-    public void testComplexAvailabilityPublicUnauthorized() throws KustvaktException {
-        Response response = searchQueryWithIP("textClass=politik & availability=QAO-NC-LOC:ids", "149.27.0.32");
+    public void testComplexAvailabilityPublicUnauthorized ()
+            throws KustvaktException {
+        Response response = searchQueryWithIP(
+                "textClass=politik & availability=QAO-NC-LOC:ids",
+                "149.27.0.32");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         checkAndPublic(response.readEntity(String.class));
     }
 
     @Test
-    public void testNegationComplexAvailabilityPublicUnauthorized() throws KustvaktException {
-        Response response = searchQueryWithIP("textClass=politik & availability!=QAO-NC-LOC:ids", "149.27.0.32");
+    public void testNegationComplexAvailabilityPublicUnauthorized ()
+            throws KustvaktException {
+        Response response = searchQueryWithIP(
+                "textClass=politik & availability!=QAO-NC-LOC:ids",
+                "149.27.0.32");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         checkAndPublic(response.readEntity(String.class));
     }
 
     @Test
-    public void testAvailabilityRegexAllAuthorized() throws KustvaktException {
-        Response response = searchQueryWithIP("availability= /ACA.*/", "10.27.0.32");
+    public void testAvailabilityRegexAllAuthorized () throws KustvaktException {
+        Response response = searchQueryWithIP("availability= /ACA.*/",
+                "10.27.0.32");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         checkAndAllWithACA(response.readEntity(String.class));
     }
 
     @Test
-    public void testAvailabilityOr() throws KustvaktException {
-        Response response = searchQuery("availability=/CC-BY.*/ | availability=/ACA.*/");
+    public void testAvailabilityOr () throws KustvaktException {
+        Response response = searchQuery(
+                "availability=/CC-BY.*/ | availability=/ACA.*/");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         checkAndFree(response.readEntity(String.class));
     }
 
     @Test
-    public void testRedundancyOrPub() throws KustvaktException {
-        Response response = searchQueryWithIP("availability=/CC-BY.*/ | availability=/ACA.*/ | availability=/QAO-NC/", "149.27.0.32");
+    public void testRedundancyOrPub () throws KustvaktException {
+        Response response = searchQueryWithIP(
+                "availability=/CC-BY.*/ | availability=/ACA.*/ | availability=/QAO-NC/",
+                "149.27.0.32");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String json = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(json);
@@ -260,21 +356,22 @@
     }
 
     @Test
-    public void testAvailabilityOrCorpusSigle() throws KustvaktException {
-        Response response = searchQuery("availability=/CC-BY.*/ | corpusSigle=GOE");
+    public void testAvailabilityOrCorpusSigle () throws KustvaktException {
+        Response response = searchQuery(
+                "availability=/CC-BY.*/ | corpusSigle=GOE");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         checkAndFree(response.readEntity(String.class));
     }
 
     @Test
-    public void testOrWithoutAvailability() throws KustvaktException {
+    public void testOrWithoutAvailability () throws KustvaktException {
         Response response = searchQuery("corpusSigle=GOE | textClass=politik");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         checkAndFree(response.readEntity(String.class));
     }
 
     @Test
-    public void testWithoutAvailability() throws KustvaktException {
+    public void testWithoutAvailability () throws KustvaktException {
         Response response = searchQuery("corpusSigle=GOE");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         checkAndFree(response.readEntity(String.class));
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/FreeResourceControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/FreeResourceControllerTest.java
index e8a5d79..cf74436 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/FreeResourceControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/FreeResourceControllerTest.java
@@ -15,13 +15,16 @@
 public class FreeResourceControllerTest extends SpringJerseyTest {
 
     @Test
-    public void testResource() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("resource").request().get();
+    public void testResource () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("resource")
+                .request().get();
         String entity = response.readEntity(String.class);
         JsonNode n = JsonUtils.readTree(entity).get(0);
         assertEquals(n.at("/resourceId").asText(), "WPD17");
-        assertEquals(n.at("/titles/de").asText(), "Deutsche Wikipedia Artikel 2017");
-        assertEquals(n.at("/titles/en").asText(), "German Wikipedia Articles 2017");
+        assertEquals(n.at("/titles/de").asText(),
+                "Deutsche Wikipedia Artikel 2017");
+        assertEquals(n.at("/titles/en").asText(),
+                "German Wikipedia Articles 2017");
         assertEquals(1, n.at("/languages").size());
         assertEquals(6, n.at("/layers").size());
     }
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/IndexControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/IndexControllerTest.java
index ef70ac5..3b9dfbc 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/IndexControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/IndexControllerTest.java
@@ -37,8 +37,10 @@
     private SearchKrill searchKrill;
 
     @Test
-    public void testCloseIndex() throws IOException, KustvaktException, URISyntaxException, InterruptedException {
-        URI uri = IndexControllerTest.class.getClassLoader().getResource("vc/named-vc1.jsonld").toURI();
+    public void testCloseIndex () throws IOException, KustvaktException,
+            URISyntaxException, InterruptedException {
+        URI uri = IndexControllerTest.class.getClassLoader()
+                .getResource("vc/named-vc1.jsonld").toURI();
         Path toLink = Paths.get(uri);
         Path symLink = Paths.get("vc/named-vc1.jsonld");
         Path vcPath = Paths.get("vc");
@@ -53,15 +55,22 @@
         assertEquals(true, searchKrill.getIndex().isReaderOpen());
         Form form = new Form();
         form.param("token", "secret");
-        Response response = target().path(API_VERSION).path("index").path("close").request().post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("index")
+                .path("close").request().post(Entity.form(form));
         assertEquals(HttpStatus.SC_OK, response.getStatus());
         assertEquals(false, searchKrill.getIndex().isReaderOpen());
         // Cleaning database and cache
         Thread.sleep(200);
-        response = target().path(API_VERSION).path("vc").path("~system").path("named-vc1").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("admin", "pass")).delete();
-        response = target().path(API_VERSION).path("vc").path("~system").path("named-vc1").request().get();
+        response = target().path(API_VERSION).path("vc").path("~system")
+                .path("named-vc1").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("admin", "pass"))
+                .delete();
+        response = target().path(API_VERSION).path("vc").path("~system")
+                .path("named-vc1").request().get();
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.NO_RESOURCE_FOUND, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.NO_RESOURCE_FOUND,
+                node.at("/errors/0/0").asInt());
     }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/InfoControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/InfoControllerTest.java
index fd12bdb..ab60ba3 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/InfoControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/InfoControllerTest.java
@@ -25,15 +25,20 @@
     private SearchKrill krill;
 
     @Test
-    public void testInfo() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("info").request().get();
+    public void testInfo () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("info").request()
+                .get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(config.getCurrentVersion(), node.at("/latest_api_version").asText());
-        assertEquals(config.getSupportedVersions().size(), node.at("/supported_api_versions").size());
-        assertEquals(ServiceInfo.getInfo().getVersion(), node.at("/kustvakt_version").asText());
-        assertEquals(krill.getIndex().getVersion(), node.at("/krill_version").asText());
+        assertEquals(config.getCurrentVersion(),
+                node.at("/latest_api_version").asText());
+        assertEquals(config.getSupportedVersions().size(),
+                node.at("/supported_api_versions").size());
+        assertEquals(ServiceInfo.getInfo().getVersion(),
+                node.at("/kustvakt_version").asText());
+        assertEquals(krill.getIndex().getVersion(),
+                node.at("/krill_version").asText());
         QuerySerializer s = new QuerySerializer();
         assertEquals(s.getVersion(), node.at("/koral_version").asText());
     }
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/MatchInfoControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/MatchInfoControllerTest.java
index 09a72be..ec282c9 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/MatchInfoControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/MatchInfoControllerTest.java
@@ -20,55 +20,94 @@
 public class MatchInfoControllerTest extends SpringJerseyTest {
 
     @Test
-    public void testGetMatchInfoPublicCorpus() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("corpus").path("GOE").path("AGA").path("01784").path("p36-100").path("matchInfo").queryParam("foundry", "*").request().get();
+    public void testGetMatchInfoPublicCorpus () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("corpus")
+                .path("GOE").path("AGA").path("01784").path("p36-100")
+                .path("matchInfo").queryParam("foundry", "*").request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertNotNull(node);
         assertEquals(node.at("/textSigle").asText(), "GOE/AGA/01784");
         assertEquals(node.at("/title").asText(), "Belagerung von Mainz");
-        assertEquals(node.at("/author").asText(), "Goethe, Johann Wolfgang von");
-        assertTrue(node.at("/snippet").asText().startsWith("<span class=\"context-left\"></span>" + "<span class=\"match\">"));
+        assertEquals(node.at("/author").asText(),
+                "Goethe, Johann Wolfgang von");
+        assertTrue(node.at("/snippet").asText()
+                .startsWith("<span class=\"context-left\"></span>"
+                        + "<span class=\"match\">"));
     }
 
     @Test
-    public void testGetMatchInfoNotAllowed() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("corpus").path("GOE").path("AGI").path("04846").path("p36875-36876").path("matchInfo").queryParam("foundry", "*").request().get();
+    public void testGetMatchInfoNotAllowed () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("corpus")
+                .path("GOE").path("AGI").path("04846").path("p36875-36876")
+                .path("matchInfo").queryParam("foundry", "*").request().get();
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.AUTHORIZATION_FAILED, node.at("/errors/0/0").asInt());
-        assertEquals("Retrieving resource with ID " + "match-GOE/AGI/04846-p36875-36876 is not allowed.", node.at("/errors/0/1").asText());
+        assertEquals(StatusCodes.AUTHORIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
+        assertEquals(
+                "Retrieving resource with ID "
+                        + "match-GOE/AGI/04846-p36875-36876 is not allowed.",
+                node.at("/errors/0/1").asText());
         assertTrue(node.at("/snippet").isMissingNode());
     }
 
     @Test
-    public void testGetMatchInfoWithAuthentication() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("corpus").path("GOE").path("AGI").path("04846").path("p36875-36876").path("matchInfo").queryParam("foundry", "*").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("kustvakt", "kustvakt2015")).header(HttpHeaders.X_FORWARDED_FOR, "172.27.0.32").get();
+    public void testGetMatchInfoWithAuthentication () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("corpus")
+                .path("GOE").path("AGI").path("04846").path("p36875-36876")
+                .path("matchInfo").queryParam("foundry", "*").request()
+                .header(Attributes.AUTHORIZATION,
+                        HttpAuthorizationHandler
+                                .createBasicAuthorizationHeaderValue("kustvakt",
+                                        "kustvakt2015"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "172.27.0.32").get();
         String entity = response.readEntity(String.class);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(entity);
         assertNotNull(node);
         assertEquals(node.at("/textSigle").asText(), "GOE/AGI/04846");
-        assertEquals(node.at("/title").asText(), "Zweiter römischer Aufenthalt");
-        assertEquals(node.at("/subTitle").asText(), "vom Juni 1787 bis April 1788");
-        assertEquals(node.at("/author").asText(), "Goethe, Johann Wolfgang von");
-        assertTrue(node.at("/snippet").asText().startsWith("<span class=\"context-left\"></span>" + "<span class=\"match\">"));
+        assertEquals(node.at("/title").asText(),
+                "Zweiter römischer Aufenthalt");
+        assertEquals(node.at("/subTitle").asText(),
+                "vom Juni 1787 bis April 1788");
+        assertEquals(node.at("/author").asText(),
+                "Goethe, Johann Wolfgang von");
+        assertTrue(node.at("/snippet").asText()
+                .startsWith("<span class=\"context-left\"></span>"
+                        + "<span class=\"match\">"));
         assertEquals(node.at("/availability").asText(), "QAO-NC-LOC:ids");
     }
 
     @Test
-    public void testAvailabilityAll() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("corpus").path("GOE").path("AGD").path("00000").path("p75-76").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("kustvakt", "kustvakt2015")).header(HttpHeaders.X_FORWARDED_FOR, "10.27.0.32").get();
+    public void testAvailabilityAll () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("corpus")
+                .path("GOE").path("AGD").path("00000").path("p75-76").request()
+                .header(Attributes.AUTHORIZATION,
+                        HttpAuthorizationHandler
+                                .createBasicAuthorizationHeaderValue("kustvakt",
+                                        "kustvakt2015"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "10.27.0.32").get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
     }
 
     @Test
-    public void testAvailabilityAllUnauthorized() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("corpus").path("GOE").path("AGD").path("00000").path("p75-76").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("kustvakt", "kustvakt2015")).header(HttpHeaders.X_FORWARDED_FOR, "170.27.0.32").get();
+    public void testAvailabilityAllUnauthorized () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("corpus")
+                .path("GOE").path("AGD").path("00000").path("p75-76").request()
+                .header(Attributes.AUTHORIZATION,
+                        HttpAuthorizationHandler
+                                .createBasicAuthorizationHeaderValue("kustvakt",
+                                        "kustvakt2015"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "170.27.0.32").get();
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
-        assertEquals(StatusCodes.AUTHORIZATION_FAILED, node.at("/errors/0/0").asInt());
-        assertEquals("Retrieving resource with ID " + "match-GOE/AGD/00000-p75-76 is not allowed.", node.at("/errors/0/1").asText());
+        assertEquals(StatusCodes.AUTHORIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
+        assertEquals(
+                "Retrieving resource with ID "
+                        + "match-GOE/AGD/00000-p75-76 is not allowed.",
+                node.at("/errors/0/1").asText());
     }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/MetadataControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/MetadataControllerTest.java
index 147d893..dcc63d7 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/MetadataControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/MetadataControllerTest.java
@@ -20,8 +20,10 @@
 public class MetadataControllerTest extends SpringJerseyTest {
 
     @Test
-    public void testRetrieveMetadataWithField() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("corpus").path("GOE").path("AGA").path("01784").queryParam("fields", "author").request().get();
+    public void testRetrieveMetadataWithField () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("corpus")
+                .path("GOE").path("AGA").path("01784")
+                .queryParam("fields", "author").request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -29,8 +31,11 @@
     }
 
     @Test
-    public void testRetrieveMetadataWithMultipleFields() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("corpus").path("GOE").path("AGA").path("01784").queryParam("fields", "author,title").request().get();
+    public void testRetrieveMetadataWithMultipleFields ()
+            throws KustvaktException {
+        Response response = target().path(API_VERSION).path("corpus")
+                .path("GOE").path("AGA").path("01784")
+                .queryParam("fields", "author,title").request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -39,8 +44,9 @@
     }
 
     @Test
-    public void testFreeMetadata() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("corpus").path("GOE").path("AGA").path("01784").request().get();
+    public void testFreeMetadata () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("corpus")
+                .path("GOE").path("AGA").path("01784").request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -50,34 +56,62 @@
     // EM: currently all metadata are allowed
     @Test
     @Disabled
-    public void testMetadataUnauthorized() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("corpus").path("GOE").path("AGI").path("04846").request().get();
+    public void testMetadataUnauthorized () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("corpus")
+                .path("GOE").path("AGI").path("04846").request().get();
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.AUTHORIZATION_FAILED, node.at("/errors/0/0").asInt());
-        assertEquals("Retrieving resource with ID " + "GOE/AGI/04846 is not allowed.", node.at("/errors/0/1").asText());
+        assertEquals(StatusCodes.AUTHORIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
+        assertEquals(
+                "Retrieving resource with ID "
+                        + "GOE/AGI/04846 is not allowed.",
+                node.at("/errors/0/1").asText());
     }
 
     @Test
-    public void testMetadataWithAuthentication() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("corpus").path("GOE").path("AGI").path("04846").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("kustvakt", "kustvakt2015")).header(HttpHeaders.X_FORWARDED_FOR, "172.27.0.32").get();
+    public void testMetadataWithAuthentication () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("corpus")
+                .path("GOE").path("AGI").path("04846").request()
+                .header(Attributes.AUTHORIZATION,
+                        HttpAuthorizationHandler
+                                .createBasicAuthorizationHeaderValue("kustvakt",
+                                        "kustvakt2015"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "172.27.0.32").get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
     }
 
     @Test
-    public void testMetadataAvailabilityAll() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("corpus").path("GOE").path("AGI").path("00000").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("kustvakt", "kustvakt2015")).header(HttpHeaders.X_FORWARDED_FOR, "10.27.0.32").get();
+    public void testMetadataAvailabilityAll () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("corpus")
+                .path("GOE").path("AGI").path("00000").request()
+                .header(Attributes.AUTHORIZATION,
+                        HttpAuthorizationHandler
+                                .createBasicAuthorizationHeaderValue("kustvakt",
+                                        "kustvakt2015"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "10.27.0.32").get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
     }
 
     // EM: currently all metadata are allowed
     @Test
     @Disabled
-    public void testMetadataAvailabilityAllUnauthorized() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("corpus").path("GOE").path("AGD").path("00000").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("kustvakt", "kustvakt2015")).header(HttpHeaders.X_FORWARDED_FOR, "170.27.0.32").get();
+    public void testMetadataAvailabilityAllUnauthorized ()
+            throws KustvaktException {
+        Response response = target().path(API_VERSION).path("corpus")
+                .path("GOE").path("AGD").path("00000").request()
+                .header(Attributes.AUTHORIZATION,
+                        HttpAuthorizationHandler
+                                .createBasicAuthorizationHeaderValue("kustvakt",
+                                        "kustvakt2015"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "170.27.0.32").get();
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
-        assertEquals(StatusCodes.AUTHORIZATION_FAILED, node.at("/errors/0/0").asInt());
-        assertEquals("Retrieving resource with ID " + "GOE/AGD/00000 is not allowed.", node.at("/errors/0/1").asText());
+        assertEquals(StatusCodes.AUTHORIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
+        assertEquals(
+                "Retrieving resource with ID "
+                        + "GOE/AGD/00000 is not allowed.",
+                node.at("/errors/0/1").asText());
     }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/MultipleCorpusQueryTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/MultipleCorpusQueryTest.java
index 26a121f..775afd8 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/MultipleCorpusQueryTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/MultipleCorpusQueryTest.java
@@ -17,8 +17,12 @@
 public class MultipleCorpusQueryTest extends SpringJerseyTest {
 
     @Test
-    public void testSearchGet() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "das").queryParam("ql", "poliqarp").queryParam("cq", "pubPlace=München").queryParam("cq", "textSigle=\"GOE/AGA/01784\"").request().get();
+    public void testSearchGet () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "das").queryParam("ql", "poliqarp")
+                .queryParam("cq", "pubPlace=München")
+                .queryParam("cq", "textSigle=\"GOE/AGA/01784\"").request()
+                .get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -35,8 +39,11 @@
     }
 
     @Test
-    public void testStatisticsWithMultipleCq() throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("statistics").queryParam("cq", "textType=Abhandlung").queryParam("cq", "corpusSigle=GOE").request().method("GET");
+    public void testStatisticsWithMultipleCq ()
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("statistics")
+                .queryParam("cq", "textType=Abhandlung")
+                .queryParam("cq", "corpusSigle=GOE").request().method("GET");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -48,8 +55,12 @@
     }
 
     @Test
-    public void testStatisticsWithMultipleCorpusQuery() throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("statistics").queryParam("corpusQuery", "textType=Autobiographie").queryParam("corpusQuery", "corpusSigle=GOE").request().method("GET");
+    public void testStatisticsWithMultipleCorpusQuery ()
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("statistics")
+                .queryParam("corpusQuery", "textType=Autobiographie")
+                .queryParam("corpusQuery", "corpusSigle=GOE").request()
+                .method("GET");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -58,6 +69,7 @@
         assertEquals(19387, node.at("/sentences").asInt());
         assertEquals(514, node.at("/paragraphs").asInt());
         assertEquals(StatusCodes.DEPRECATED, node.at("/warnings/0/0").asInt());
-        assertEquals(node.at("/warnings/0/1").asText(), "Parameter corpusQuery is deprecated in favor of cq.");
+        assertEquals(node.at("/warnings/0/1").asText(),
+                "Parameter corpusQuery is deprecated in favor of cq.");
     }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2AccessTokenTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2AccessTokenTest.java
index 315728a..6b5627d 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2AccessTokenTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2AccessTokenTest.java
@@ -31,43 +31,56 @@
 
     private String clientAuthHeader;
 
-    public OAuth2AccessTokenTest() throws KustvaktException {
-        userAuthHeader = HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("dory", "password");
-        clientAuthHeader = HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(confidentialClientId, clientSecret);
+    public OAuth2AccessTokenTest () throws KustvaktException {
+        userAuthHeader = HttpAuthorizationHandler
+                .createBasicAuthorizationHeaderValue("dory", "password");
+        clientAuthHeader = HttpAuthorizationHandler
+                .createBasicAuthorizationHeaderValue(confidentialClientId,
+                        clientSecret);
     }
 
     @Test
-    public void testScopeWithSuperClient() throws KustvaktException {
-        Response response = requestTokenWithDoryPassword(superClientId, clientSecret);
+    public void testScopeWithSuperClient () throws KustvaktException {
+        Response response = requestTokenWithDoryPassword(superClientId,
+                clientSecret);
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
         assertEquals(node.at("/scope").asText(), "all");
         String accessToken = node.at("/access_token").asText();
         // test list user group
-        response = target().path(API_VERSION).path("group").request().header(Attributes.AUTHORIZATION, "Bearer " + accessToken).get();
+        response = target().path(API_VERSION).path("group").request()
+                .header(Attributes.AUTHORIZATION, "Bearer " + accessToken)
+                .get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         node = JsonUtils.readTree(response.readEntity(String.class));
         assertEquals(2, node.size());
     }
 
     @Test
-    public void testCustomScope() throws KustvaktException {
-        Response response = requestAuthorizationCode("code", confidentialClientId, "", OAuth2Scope.VC_INFO.toString(), "", userAuthHeader);
+    public void testCustomScope () throws KustvaktException {
+        Response response = requestAuthorizationCode("code",
+                confidentialClientId, "", OAuth2Scope.VC_INFO.toString(), "",
+                userAuthHeader);
         String code = parseAuthorizationCode(response);
-        response = requestTokenWithAuthorizationCodeAndForm(confidentialClientId, clientSecret, code);
+        response = requestTokenWithAuthorizationCodeAndForm(
+                confidentialClientId, clientSecret, code);
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
         String token = node.at("/access_token").asText();
-        assertTrue(node.at("/scope").asText().contains(OAuth2Scope.VC_INFO.toString()));
+        assertTrue(node.at("/scope").asText()
+                .contains(OAuth2Scope.VC_INFO.toString()));
         // test list vc using the token
-        response = target().path(API_VERSION).path("vc").request().header(Attributes.AUTHORIZATION, "Bearer " + token).get();
+        response = target().path(API_VERSION).path("vc").request()
+                .header(Attributes.AUTHORIZATION, "Bearer " + token).get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         node = JsonUtils.readTree(response.readEntity(String.class));
         assertEquals(4, node.size());
     }
 
     @Test
-    public void testDefaultScope() throws KustvaktException, IOException {
-        String code = requestAuthorizationCode(confidentialClientId, userAuthHeader);
-        Response response = requestTokenWithAuthorizationCodeAndForm(confidentialClientId, clientSecret, code);
+    public void testDefaultScope () throws KustvaktException, IOException {
+        String code = requestAuthorizationCode(confidentialClientId,
+                userAuthHeader);
+        Response response = requestTokenWithAuthorizationCodeAndForm(
+                confidentialClientId, clientSecret, code);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
         String accessToken = node.at("/access_token").asText();
@@ -76,52 +89,76 @@
         testSearchWithOAuth2Token(accessToken);
     }
 
-    private void testScopeNotAuthorized(String accessToken) throws KustvaktException {
-        Response response = target().path(API_VERSION).path("vc").request().header(Attributes.AUTHORIZATION, "Bearer " + accessToken).get();
+    private void testScopeNotAuthorized (String accessToken)
+            throws KustvaktException {
+        Response response = target().path(API_VERSION).path("vc").request()
+                .header(Attributes.AUTHORIZATION, "Bearer " + accessToken)
+                .get();
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.AUTHORIZATION_FAILED, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "Scope vc_info is not authorized");
+        assertEquals(StatusCodes.AUTHORIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Scope vc_info is not authorized");
     }
 
-    private void testScopeNotAuthorize2(String accessToken) throws KustvaktException {
-        Response response = target().path(API_VERSION).path("vc").path("access").request().header(Attributes.AUTHORIZATION, "Bearer " + accessToken).get();
+    private void testScopeNotAuthorize2 (String accessToken)
+            throws KustvaktException {
+        Response response = target().path(API_VERSION).path("vc").path("access")
+                .request()
+                .header(Attributes.AUTHORIZATION, "Bearer " + accessToken)
+                .get();
         String entity = response.readEntity(String.class);
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.AUTHORIZATION_FAILED, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "Scope vc_access_info is not authorized");
+        assertEquals(StatusCodes.AUTHORIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Scope vc_access_info is not authorized");
     }
 
     @Test
-    public void testSearchWithUnknownToken() throws KustvaktException, IOException {
-        Response response = searchWithAccessToken("ljsa8tKNRSczJhk20öhq92zG8z350");
+    public void testSearchWithUnknownToken ()
+            throws KustvaktException, IOException {
+        Response response = searchWithAccessToken(
+                "ljsa8tKNRSczJhk20öhq92zG8z350");
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
-        assertEquals(StatusCodes.INVALID_ACCESS_TOKEN, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "Access token is invalid");
+        assertEquals(StatusCodes.INVALID_ACCESS_TOKEN,
+                node.at("/errors/0/0").asInt());
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Access token is invalid");
     }
 
     @Test
-    public void testRevokeAccessTokenConfidentialClient() throws KustvaktException {
-        String code = requestAuthorizationCode(confidentialClientId, userAuthHeader);
-        JsonNode node = requestTokenWithAuthorizationCodeAndHeader(confidentialClientId, code, clientAuthHeader);
+    public void testRevokeAccessTokenConfidentialClient ()
+            throws KustvaktException {
+        String code = requestAuthorizationCode(confidentialClientId,
+                userAuthHeader);
+        JsonNode node = requestTokenWithAuthorizationCodeAndHeader(
+                confidentialClientId, code, clientAuthHeader);
         String accessToken = node.at("/access_token").asText();
         Form form = new Form();
         form.param("token", accessToken);
         form.param("client_id", confidentialClientId);
         form.param("client_secret", "secret");
-        Response response = target().path(API_VERSION).path("oauth2").path("revoke").request().header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED).post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("oauth2")
+                .path("revoke").request()
+                .header(HttpHeaders.CONTENT_TYPE,
+                        ContentType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(form));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         testSearchWithRevokedAccessToken(accessToken);
     }
 
     @Test
-    public void testRevokeAccessTokenPublicClientViaSuperClient() throws KustvaktException {
+    public void testRevokeAccessTokenPublicClientViaSuperClient ()
+            throws KustvaktException {
         String code = requestAuthorizationCode(publicClientId, userAuthHeader);
-        Response response = requestTokenWithAuthorizationCodeAndForm(publicClientId, "", code);
+        Response response = requestTokenWithAuthorizationCodeAndForm(
+                publicClientId, "", code);
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
         String accessToken = node.at("/access_token").asText();
         testRevokeTokenViaSuperClient(accessToken, userAuthHeader);
@@ -129,9 +166,12 @@
     }
 
     @Test
-    public void testAccessTokenAfterRequestRefreshToken() throws KustvaktException, IOException {
-        String code = requestAuthorizationCode(confidentialClientId, userAuthHeader);
-        JsonNode node = requestTokenWithAuthorizationCodeAndHeader(confidentialClientId, code, clientAuthHeader);
+    public void testAccessTokenAfterRequestRefreshToken ()
+            throws KustvaktException, IOException {
+        String code = requestAuthorizationCode(confidentialClientId,
+                userAuthHeader);
+        JsonNode node = requestTokenWithAuthorizationCodeAndHeader(
+                confidentialClientId, code, clientAuthHeader);
         String accessToken = node.at("/access_token").asText();
         String refreshToken = node.at("/refresh_token").asText();
         Form form = new Form();
@@ -139,7 +179,12 @@
         form.param("client_id", confidentialClientId);
         form.param("client_secret", "secret");
         form.param("refresh_token", refreshToken);
-        Response response = target().path(API_VERSION).path("oauth2").path("token").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED).post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("oauth2")
+                .path("token").request()
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(HttpHeaders.CONTENT_TYPE,
+                        ContentType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(form));
         String entity = response.readEntity(String.class);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         node = JsonUtils.readTree(entity);
@@ -149,27 +194,38 @@
     }
 
     @Test
-    public void testRequestAuthorizationWithBearerTokenUnauthorized() throws KustvaktException {
-        String code = requestAuthorizationCode(confidentialClientId, userAuthHeader);
-        JsonNode node = requestTokenWithAuthorizationCodeAndHeader(confidentialClientId, code, clientAuthHeader);
+    public void testRequestAuthorizationWithBearerTokenUnauthorized ()
+            throws KustvaktException {
+        String code = requestAuthorizationCode(confidentialClientId,
+                userAuthHeader);
+        JsonNode node = requestTokenWithAuthorizationCodeAndHeader(
+                confidentialClientId, code, clientAuthHeader);
         String userAuthToken = node.at("/access_token").asText();
-        Response response = requestAuthorizationCode("code", confidentialClientId, "", "search", "", "Bearer " + userAuthToken);
+        Response response = requestAuthorizationCode("code",
+                confidentialClientId, "", "search", "",
+                "Bearer " + userAuthToken);
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
         node = JsonUtils.readTree(response.readEntity(String.class));
-        assertEquals(StatusCodes.AUTHORIZATION_FAILED, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "Scope authorize is not authorized");
+        assertEquals(StatusCodes.AUTHORIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Scope authorize is not authorized");
     }
 
     @Test
-    public void testRequestAuthorizationWithBearerToken() throws KustvaktException {
-        Response response = requestTokenWithDoryPassword(superClientId, clientSecret);
+    public void testRequestAuthorizationWithBearerToken ()
+            throws KustvaktException {
+        Response response = requestTokenWithDoryPassword(superClientId,
+                clientSecret);
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         String userAuthToken = node.at("/access_token").asText();
         assertNotNull(userAuthToken);
-        assertEquals(TokenType.BEARER.displayName(), node.at("/token_type").asText());
+        assertEquals(TokenType.BEARER.displayName(),
+                node.at("/token_type").asText());
         assertNotNull(node.at("/expires_in").asText());
-        String code = requestAuthorizationCode(superClientId, "Bearer " + userAuthToken);
+        String code = requestAuthorizationCode(superClientId,
+                "Bearer " + userAuthToken);
         assertNotNull(code);
     }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2AdminControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2AdminControllerTest.java
index 2a143cb..fabc267 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2AdminControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2AdminControllerTest.java
@@ -40,47 +40,65 @@
     @Autowired
     private AccessTokenDao accessDao;
 
-    public OAuth2AdminControllerTest() throws KustvaktException {
-        adminAuthHeader = HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("admin", "password");
-        userAuthHeader = HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("dory", "password");
+    public OAuth2AdminControllerTest () throws KustvaktException {
+        adminAuthHeader = HttpAuthorizationHandler
+                .createBasicAuthorizationHeaderValue("admin", "password");
+        userAuthHeader = HttpAuthorizationHandler
+                .createBasicAuthorizationHeaderValue("dory", "password");
     }
 
-    private Response updateClientPrivilege(String username, Form form) throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("admin").path("oauth2").path("client").path("privilege").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED).post(Entity.form(form));
+    private Response updateClientPrivilege (String username, Form form)
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("admin")
+                .path("oauth2").path("client").path("privilege").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .header(HttpHeaders.CONTENT_TYPE,
+                        ContentType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(form));
         return response;
     }
 
-    private Response updateClientPrivilegeWithAdminToken(String clientId) throws ProcessingException, KustvaktException {
+    private Response updateClientPrivilegeWithAdminToken (String clientId)
+            throws ProcessingException, KustvaktException {
         Form form = new Form();
         form.param("client_id", clientId);
         form.param("super", Boolean.toString(false));
         // adminToken
         form.param("token", "secret");
-        Response response = target().path(API_VERSION).path("admin").path("oauth2").path("client").path("privilege").request().header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED).post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("admin")
+                .path("oauth2").path("client").path("privilege").request()
+                .header(HttpHeaders.CONTENT_TYPE,
+                        ContentType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(form));
         return response;
     }
 
-    private void testUpdateClientPriviledgeUnauthorized(Form form) throws ProcessingException, KustvaktException {
+    private void testUpdateClientPriviledgeUnauthorized (Form form)
+            throws ProcessingException, KustvaktException {
         Response response = updateClientPrivilege(username, form);
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
-        assertEquals(StatusCodes.AUTHORIZATION_FAILED, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.AUTHORIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
     }
 
     @Test
     @Order(1)
-    public void testCleanExpiredTokensUsingAdminToken() throws KustvaktException {
+    public void testCleanExpiredTokensUsingAdminToken ()
+            throws KustvaktException {
         createExpiredAccessToken();
-        
-        int refreshTokensBefore =
-                refreshDao.retrieveInvalidRefreshTokens().size();
+
+        int refreshTokensBefore = refreshDao.retrieveInvalidRefreshTokens()
+                .size();
 
         assertTrue(refreshTokensBefore > 0);
         int accessTokensBefore = accessDao.retrieveInvalidAccessTokens().size();
         assertTrue(accessTokensBefore > 0);
         Form form = new Form();
         form.param("token", "secret");
-        target().path(API_VERSION).path("admin").path("oauth2").path("token").path("clean").request().post(Entity.form(form));
+        target().path(API_VERSION).path("admin").path("oauth2").path("token")
+                .path("clean").request().post(Entity.form(form));
         assertEquals(0, refreshDao.retrieveInvalidRefreshTokens().size());
         assertEquals(0, accessDao.retrieveInvalidAccessTokens().size());
     }
@@ -91,28 +109,33 @@
 
         int accessTokensBefore = accessDao.retrieveInvalidAccessTokens().size();
         String code = requestAuthorizationCode(publicClientId, userAuthHeader);
-        Response response = requestTokenWithAuthorizationCodeAndForm(publicClientId, clientSecret, code);
+        Response response = requestTokenWithAuthorizationCodeAndForm(
+                publicClientId, clientSecret, code);
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         String accessToken = node.at("/access_token").asText();
         testRevokeToken(accessToken, publicClientId, null, ACCESS_TOKEN_TYPE);
         int accessTokensAfter = accessDao.retrieveInvalidAccessTokens().size();
         assertEquals(accessTokensAfter, accessTokensBefore + 1);
-        target().path(API_VERSION).path("admin").path("oauth2").path("token").path("clean").request().header(Attributes.AUTHORIZATION, adminAuthHeader).post(null);
+        target().path(API_VERSION).path("admin").path("oauth2").path("token")
+                .path("clean").request()
+                .header(Attributes.AUTHORIZATION, adminAuthHeader).post(null);
         assertEquals(0, accessDao.retrieveInvalidAccessTokens().size());
     }
 
     @Test
-    public void testUpdateClientPrivilege() throws KustvaktException {
+    public void testUpdateClientPrivilege () throws KustvaktException {
         // register a client
         Response response = registerConfidentialClient(username);
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
         String clientId = node.at("/client_id").asText();
         String clientSecret = node.at("/client_secret").asText();
         // request an access token
-        String clientAuthHeader = HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(clientId, clientSecret);
+        String clientAuthHeader = HttpAuthorizationHandler
+                .createBasicAuthorizationHeaderValue(clientId, clientSecret);
         String code = requestAuthorizationCode(clientId, userAuthHeader);
-        node = requestTokenWithAuthorizationCodeAndHeader(clientId, code, clientAuthHeader);
+        node = requestTokenWithAuthorizationCodeAndHeader(clientId, code,
+                clientAuthHeader);
         String accessToken = node.at("/access_token").asText();
         // update client priviledge to super client
         Form form = new Form();
@@ -129,29 +152,37 @@
     }
 
     // old access tokens retain their scopes
-    private void testAccessTokenAfterUpgradingClient(String clientId, String accessToken) throws KustvaktException {
+    private void testAccessTokenAfterUpgradingClient (String clientId,
+            String accessToken) throws KustvaktException {
         JsonNode node = retrieveClientInfo(clientId, "admin");
         assertTrue(node.at("/super").asBoolean());
         // list vc
-        Response response = target().path(API_VERSION).path("vc").request().header(Attributes.AUTHORIZATION, "Bearer " + accessToken).get();
+        Response response = target().path(API_VERSION).path("vc").request()
+                .header(Attributes.AUTHORIZATION, "Bearer " + accessToken)
+                .get();
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.AUTHORIZATION_FAILED, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "Scope vc_info is not authorized");
+        assertEquals(StatusCodes.AUTHORIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Scope vc_info is not authorized");
         // search
         response = searchWithAccessToken(accessToken);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
     }
 
-    private void testAccessTokenAfterDegradingSuperClient(String clientId, String accessToken) throws KustvaktException {
+    private void testAccessTokenAfterDegradingSuperClient (String clientId,
+            String accessToken) throws KustvaktException {
         JsonNode node = retrieveClientInfo(clientId, username);
         assertTrue(node.at("/isSuper").isMissingNode());
         Response response = searchWithAccessToken(accessToken);
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.INVALID_ACCESS_TOKEN, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "Access token is invalid");
+        assertEquals(StatusCodes.INVALID_ACCESS_TOKEN,
+                node.at("/errors/0/0").asInt());
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Access token is invalid");
     }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2AuthorizationPostTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2AuthorizationPostTest.java
index a2e7090..8372acc 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2AuthorizationPostTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2AuthorizationPostTest.java
@@ -28,31 +28,41 @@
 
     public String userAuthHeader;
 
-    public OAuth2AuthorizationPostTest() throws KustvaktException {
-        userAuthHeader = HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("dory", "password");
+    public OAuth2AuthorizationPostTest () throws KustvaktException {
+        userAuthHeader = HttpAuthorizationHandler
+                .createBasicAuthorizationHeaderValue("dory", "password");
     }
 
-    private Response requestAuthorizationCode(Form form, String authHeader) throws KustvaktException {
-        return target().path(API_VERSION).path("oauth2").path("authorize").request().header(Attributes.AUTHORIZATION, authHeader).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED).post(Entity.form(form));
+    private Response requestAuthorizationCode (Form form, String authHeader)
+            throws KustvaktException {
+        return target().path(API_VERSION).path("oauth2").path("authorize")
+                .request().header(Attributes.AUTHORIZATION, authHeader)
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(HttpHeaders.CONTENT_TYPE,
+                        ContentType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(form));
     }
 
     @Test
-    public void testAuthorizeConfidentialClient() throws KustvaktException {
+    public void testAuthorizeConfidentialClient () throws KustvaktException {
         Form form = new Form();
         form.param("response_type", "code");
         form.param("client_id", confidentialClientId);
         form.param("state", "thisIsMyState");
         form.param("scope", "search");
         Response response = requestAuthorizationCode(form, userAuthHeader);
-        assertEquals(Status.TEMPORARY_REDIRECT.getStatusCode(), response.getStatus());
+        assertEquals(Status.TEMPORARY_REDIRECT.getStatusCode(),
+                response.getStatus());
         URI redirectUri = response.getLocation();
-        MultiValueMap<String, String> params = UriComponentsBuilder.fromUri(redirectUri).build().getQueryParams();
+        MultiValueMap<String, String> params = UriComponentsBuilder
+                .fromUri(redirectUri).build().getQueryParams();
         assertNotNull(params.getFirst("code"));
         assertEquals(params.getFirst("state"), "thisIsMyState");
     }
 
     @Test
-    public void testRequestTokenAuthorizationConfidential() throws KustvaktException {
+    public void testRequestTokenAuthorizationConfidential ()
+            throws KustvaktException {
         Form authForm = new Form();
         authForm.param("response_type", "code");
         authForm.param("client_id", confidentialClientId);
@@ -60,11 +70,10 @@
         Response response = requestAuthorizationCode(authForm, userAuthHeader);
         URI redirectUri = response.getLocation();
 
-        MultivaluedMap<String, String> params =
-                UriComponent.decodeQuery(redirectUri, true);
+        MultivaluedMap<String, String> params = UriComponent
+                .decodeQuery(redirectUri, true);
         String code = params.get("code").get(0);
 
-
         response = requestTokenWithAuthorizationCodeAndForm(
                 confidentialClientId, clientSecret, code);
         String entity = response.readEntity(String.class);
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2AuthorizationTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2AuthorizationTest.java
index a91b119..27903e7 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2AuthorizationTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2AuthorizationTest.java
@@ -19,14 +19,14 @@
 import jakarta.ws.rs.core.Response.Status;
 
 public class OAuth2AuthorizationTest extends OAuth2TestBase {
-    
+
     private String userAuthHeader;
 
     public OAuth2AuthorizationTest () throws KustvaktException {
         userAuthHeader = HttpAuthorizationHandler
                 .createBasicAuthorizationHeaderValue("dory", "password");
     }
-    
+
     @Test
     public void testAuthorizeUnauthenticated () throws KustvaktException {
 
@@ -40,18 +40,19 @@
         assertEquals("Unauthorized operation for user: guest",
                 node.at("/errors/0/1").asText());
     }
+
     @Test
     public void testAuthorizeConfidentialClient () throws KustvaktException {
         // with registered redirect URI
-        Response response =
-                requestAuthorizationCode("code", confidentialClientId, "",
-                        "match_info search client_info", state, userAuthHeader);
+        Response response = requestAuthorizationCode("code",
+                confidentialClientId, "", "match_info search client_info",
+                state, userAuthHeader);
 
         assertEquals(Status.TEMPORARY_REDIRECT.getStatusCode(),
                 response.getStatus());
         URI redirectUri = response.getLocation();
-        MultivaluedMap<String, String> params =
-                getQueryParamsFromURI(redirectUri);
+        MultivaluedMap<String, String> params = getQueryParamsFromURI(
+                redirectUri);
         assertNotNull(params.getFirst("code"));
         assertEquals(state, params.getFirst("state"));
     }
@@ -65,10 +66,9 @@
 
     @Test
     public void testAuthorizeWithRedirectUri () throws KustvaktException {
-        Response response =
-                requestAuthorizationCode("code", publicClientId2,
-                        "https://public.com/redirect", "search match_info", 
-                        "", userAuthHeader);
+        Response response = requestAuthorizationCode("code", publicClientId2,
+                "https://public.com/redirect", "search match_info", "",
+                userAuthHeader);
         assertEquals(Status.TEMPORARY_REDIRECT.getStatusCode(),
                 response.getStatus());
 
@@ -93,8 +93,7 @@
         assertEquals(redirectUri.getPath(), "/confidential/redirect");
 
         String[] queryParts = redirectUri.getQuery().split("&");
-        assertEquals("error_description=scope+is+required",
-                queryParts[1]);
+        assertEquals("error_description=scope+is+required", queryParts[1]);
         assertEquals("error=invalid_scope", queryParts[0]);
     }
 
@@ -111,44 +110,43 @@
 
     @Test
     public void testAuthorizeMissingRedirectUri () throws KustvaktException {
-        Response response = requestAuthorizationCode("code",
-                publicClientId2, "", "search", state, userAuthHeader);
+        Response response = requestAuthorizationCode("code", publicClientId2,
+                "", "search", state, userAuthHeader);
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
 
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(OAuth2Error.INVALID_REQUEST,
-                node.at("/error").asText());
+        assertEquals(OAuth2Error.INVALID_REQUEST, node.at("/error").asText());
         assertEquals("Missing parameter: redirect URI",
                 node.at("/error_description").asText());
         assertEquals(state, node.at("/state").asText());
     }
 
     @Test
-    public void testAuthorizeMissingResponseType() throws KustvaktException {
-        Response response = requestAuthorizationCode("",
-                confidentialClientId, "", "search", "", userAuthHeader);
+    public void testAuthorizeMissingResponseType () throws KustvaktException {
+        Response response = requestAuthorizationCode("", confidentialClientId,
+                "", "search", "", userAuthHeader);
         assertEquals(Status.TEMPORARY_REDIRECT.getStatusCode(),
                 response.getStatus());
 
-        assertEquals("https://third.party.com/confidential/redirect?"
-                + "error=invalid_request_uri&"
-                + "error_description=Missing+response_type+parameter"
-                , response.getLocation().toString());
+        assertEquals(
+                "https://third.party.com/confidential/redirect?"
+                        + "error=invalid_request_uri&"
+                        + "error_description=Missing+response_type+parameter",
+                response.getLocation().toString());
     }
-    
+
     @Test
-    public void testAuthorizeMissingResponseTypeWithoutClientId () throws KustvaktException {
-        Response response = requestAuthorizationCode("",
-                "", "", "search", "", userAuthHeader);
-        
-        assertEquals(Status.BAD_REQUEST.getStatusCode(),
-                response.getStatus());
+    public void testAuthorizeMissingResponseTypeWithoutClientId ()
+            throws KustvaktException {
+        Response response = requestAuthorizationCode("", "", "", "search", "",
+                userAuthHeader);
+
+        assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        
-        assertEquals(OAuth2Error.INVALID_REQUEST,
-                node.at("/error").asText());
+
+        assertEquals(OAuth2Error.INVALID_REQUEST, node.at("/error").asText());
         assertEquals("Missing parameter: client_id",
                 node.at("/error_description").asText());
     }
@@ -170,9 +168,9 @@
         String redirectUri = "https://different.uri/redirect";
         Response response = requestAuthorizationCode("code",
                 confidentialClientId, redirectUri, "", state, userAuthHeader);
-        
-        testInvalidRedirectUri(response.readEntity(String.class), 
-                response.getHeaderString("Content-Type"),true,
+
+        testInvalidRedirectUri(response.readEntity(String.class),
+                response.getHeaderString("Content-Type"), true,
                 response.getStatus());
     }
 
@@ -185,8 +183,8 @@
                 response.getStatus());
 
         URI redirectUri = response.getLocation();
-        MultivaluedMap<String, String> params =
-                getQueryParamsFromURI(redirectUri);
+        MultivaluedMap<String, String> params = getQueryParamsFromURI(
+                redirectUri);
         assertNotNull(params.getFirst("code"));
         assertEquals(state, params.getFirst("state"));
     }
@@ -194,11 +192,11 @@
     @Test
     public void testAuthorizeWithRedirectUriFragment ()
             throws KustvaktException {
-        Response response = requestAuthorizationCode("code",
-                publicClientId2, "http://public.com/index.html#redirect", "search",
-                state, userAuthHeader);
-        testInvalidRedirectUri(response.readEntity(String.class), 
-                response.getHeaderString("Content-Type"),true,
+        Response response = requestAuthorizationCode("code", publicClientId2,
+                "http://public.com/index.html#redirect", "search", state,
+                userAuthHeader);
+        testInvalidRedirectUri(response.readEntity(String.class),
+                response.getHeaderString("Content-Type"), true,
                 response.getStatus());
     }
 
@@ -206,10 +204,10 @@
     public void testAuthorizeInvalidRedirectUri () throws KustvaktException {
         // host not allowed by Apache URI Validator
         String redirectUri = "https://public.uri/redirect";
-        Response response = requestAuthorizationCode("code",
-                publicClientId2, redirectUri, "", state, userAuthHeader);
-        testInvalidRedirectUri(response.readEntity(String.class), 
-                response.getHeaderString("Content-Type"),true,
+        Response response = requestAuthorizationCode("code", publicClientId2,
+                redirectUri, "", state, userAuthHeader);
+        testInvalidRedirectUri(response.readEntity(String.class),
+                response.getHeaderString("Content-Type"), true,
                 response.getStatus());
     }
 
@@ -224,8 +222,7 @@
         assertEquals("https://third.party.com/confidential/redirect?"
                 + "error=unsupported_response_type"
                 + "&error_description=Unsupported+response+type.+Only+code+is+supported."
-                + "&state=thisIsMyState" ,
-                response.getLocation().toString());
+                + "&state=thisIsMyState", response.getLocation().toString());
 
         // with redirect URI, and no registered redirect URI
         response = requestAuthorizationCode("string", publicClientId2,
@@ -237,8 +234,7 @@
         assertEquals("https://public.client.com/redirect?"
                 + "error=unsupported_response_type"
                 + "&error_description=Unsupported+response+type.+Only+code+is+supported."
-                + "&state=thisIsMyState", 
-                response.getLocation().toString());
+                + "&state=thisIsMyState", response.getLocation().toString());
 
         // with different redirect URI
         String redirectUri = "https://different.uri/redirect";
@@ -247,8 +243,7 @@
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
 
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
-        assertEquals(OAuth2Error.INVALID_REQUEST,
-                node.at("/error").asText());
+        assertEquals(OAuth2Error.INVALID_REQUEST, node.at("/error").asText());
         assertEquals("Invalid redirect URI",
                 node.at("/error_description").asText());
         assertEquals(state, node.at("/state").asText());
@@ -260,8 +255,7 @@
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
 
         node = JsonUtils.readTree(response.readEntity(String.class));
-        assertEquals(OAuth2Error.INVALID_REQUEST,
-                node.at("/error").asText());
+        assertEquals(OAuth2Error.INVALID_REQUEST, node.at("/error").asText());
         assertEquals("Missing parameter: redirect URI",
                 node.at("/error_description").asText());
         assertEquals(state, node.at("/state").asText());
@@ -277,8 +271,8 @@
 
         assertEquals(
                 "https://third.party.com/confidential/redirect?"
-                + "error=invalid_scope&error_description=Invalid+"
-                +"scope&state=thisIsMyState",
+                        + "error=invalid_scope&error_description=Invalid+"
+                        + "scope&state=thisIsMyState",
                 response.getLocation().toString());
     }
 
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2ClientControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2ClientControllerTest.java
index 25127d5..5f24cd6 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2ClientControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2ClientControllerTest.java
@@ -43,11 +43,13 @@
 
     private String userAuthHeader;
 
-    public OAuth2ClientControllerTest() throws KustvaktException {
-        userAuthHeader = HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("dory", "password");
+    public OAuth2ClientControllerTest () throws KustvaktException {
+        userAuthHeader = HttpAuthorizationHandler
+                .createBasicAuthorizationHeaderValue("dory", "password");
     }
 
-    private OAuth2ClientJson createOAuth2ClientJson(String name, OAuth2ClientType type, String description) {
+    private OAuth2ClientJson createOAuth2ClientJson (String name,
+            OAuth2ClientType type, String description) {
         OAuth2ClientJson client = new OAuth2ClientJson();
         if (name != null) {
             client.setName(name);
@@ -60,19 +62,22 @@
     }
 
     @Test
-    public void testRetrieveClientInfo() throws KustvaktException {
+    public void testRetrieveClientInfo () throws KustvaktException {
         // public client
         JsonNode clientInfo = retrieveClientInfo(publicClientId, "system");
         assertEquals(publicClientId, clientInfo.at("/client_id").asText());
-        assertEquals(clientInfo.at("/client_name").asText(), "public client plugin with redirect uri");
+        assertEquals(clientInfo.at("/client_name").asText(),
+                "public client plugin with redirect uri");
         assertNotNull(clientInfo.at("/client_description"));
         assertNotNull(clientInfo.at("/client_url"));
         assertEquals(clientInfo.at("/client_type").asText(), "PUBLIC");
         assertEquals(clientInfo.at("/registered_by").asText(), "system");
         // confidential client
         clientInfo = retrieveClientInfo(confidentialClientId, "system");
-        assertEquals(confidentialClientId, clientInfo.at("/client_id").asText());
-        assertEquals(clientInfo.at("/client_name").asText(), "non super confidential client");
+        assertEquals(confidentialClientId,
+                clientInfo.at("/client_id").asText());
+        assertEquals(clientInfo.at("/client_name").asText(),
+                "non super confidential client");
         assertNotNull(clientInfo.at("/client_url"));
         assertNotNull(clientInfo.at("/redirect_uri"));
         assertEquals(false, clientInfo.at("/super").asBoolean());
@@ -80,7 +85,8 @@
         // super client
         clientInfo = retrieveClientInfo(superClientId, "system");
         assertEquals(superClientId, clientInfo.at("/client_id").asText());
-        assertEquals(clientInfo.at("/client_name").asText(), "super confidential client");
+        assertEquals(clientInfo.at("/client_name").asText(),
+                "super confidential client");
         assertNotNull(clientInfo.at("/client_url"));
         assertNotNull(clientInfo.at("/redirect_uri"));
         assertEquals(clientInfo.at("/client_type").asText(), "CONFIDENTIAL");
@@ -88,7 +94,7 @@
     }
 
     @Test
-    public void testRegisterConfidentialClient() throws KustvaktException {
+    public void testRegisterConfidentialClient () throws KustvaktException {
         Response response = registerConfidentialClient(username);
         String entity = response.readEntity(String.class);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
@@ -105,68 +111,88 @@
     }
 
     @Test
-    public void testRegisterClientNameTooShort() throws ProcessingException, KustvaktException {
-        OAuth2ClientJson clientJson = createOAuth2ClientJson("R", OAuth2ClientType.PUBLIC, null);
+    public void testRegisterClientNameTooShort ()
+            throws ProcessingException, KustvaktException {
+        OAuth2ClientJson clientJson = createOAuth2ClientJson("R",
+                OAuth2ClientType.PUBLIC, null);
         Response response = registerClient(username, clientJson);
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(node.at("/error_description").asText(), "client_name must contain at least 3 characters");
+        assertEquals(node.at("/error_description").asText(),
+                "client_name must contain at least 3 characters");
         assertEquals(node.at("/error").asText(), "invalid_request");
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
     }
 
     @Test
-    public void testRegisterClientEmptyName() throws ProcessingException, KustvaktException {
-        OAuth2ClientJson clientJson = createOAuth2ClientJson("", OAuth2ClientType.PUBLIC, null);
+    public void testRegisterClientEmptyName ()
+            throws ProcessingException, KustvaktException {
+        OAuth2ClientJson clientJson = createOAuth2ClientJson("",
+                OAuth2ClientType.PUBLIC, null);
         Response response = registerClient(username, clientJson);
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(node.at("/error_description").asText(), "client_name must contain at least 3 characters");
+        assertEquals(node.at("/error_description").asText(),
+                "client_name must contain at least 3 characters");
         assertEquals(node.at("/error").asText(), "invalid_request");
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
     }
 
     @Test
-    public void testRegisterClientMissingName() throws ProcessingException, KustvaktException {
-        OAuth2ClientJson clientJson = createOAuth2ClientJson(null, OAuth2ClientType.PUBLIC, null);
+    public void testRegisterClientMissingName ()
+            throws ProcessingException, KustvaktException {
+        OAuth2ClientJson clientJson = createOAuth2ClientJson(null,
+                OAuth2ClientType.PUBLIC, null);
         Response response = registerClient(username, clientJson);
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(node.at("/error_description").asText(), "client_name is null");
+        assertEquals(node.at("/error_description").asText(),
+                "client_name is null");
         assertEquals(node.at("/error").asText(), "invalid_request");
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
     }
 
     @Test
-    public void testRegisterClientMissingDescription() throws ProcessingException, KustvaktException {
-        OAuth2ClientJson clientJson = createOAuth2ClientJson("R client", OAuth2ClientType.PUBLIC, null);
+    public void testRegisterClientMissingDescription ()
+            throws ProcessingException, KustvaktException {
+        OAuth2ClientJson clientJson = createOAuth2ClientJson("R client",
+                OAuth2ClientType.PUBLIC, null);
         Response response = registerClient(username, clientJson);
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(node.at("/error_description").asText(), "client_description is null");
+        assertEquals(node.at("/error_description").asText(),
+                "client_description is null");
         assertEquals(node.at("/error").asText(), "invalid_request");
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
     }
 
     @Test
-    public void testRegisterClientMissingType() throws ProcessingException, KustvaktException {
-        OAuth2ClientJson clientJson = createOAuth2ClientJson("R client", null, null);
+    public void testRegisterClientMissingType ()
+            throws ProcessingException, KustvaktException {
+        OAuth2ClientJson clientJson = createOAuth2ClientJson("R client", null,
+                null);
         Response response = registerClient(username, clientJson);
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(node.at("/error_description").asText(), "client_type is null");
+        assertEquals(node.at("/error_description").asText(),
+                "client_type is null");
         assertEquals(node.at("/error").asText(), "invalid_request");
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
     }
 
     @Test
-    public void testRegisterClientInvalidRedirectURI() throws ProcessingException, KustvaktException {
+    public void testRegisterClientInvalidRedirectURI ()
+            throws ProcessingException, KustvaktException {
         // invalid hostname
         String redirectUri = "https://test.public.client/redirect";
-        OAuth2ClientJson clientJson = createOAuth2ClientJson("OAuth2PublicClient", OAuth2ClientType.PUBLIC, "A public test client.");
+        OAuth2ClientJson clientJson = createOAuth2ClientJson(
+                "OAuth2PublicClient", OAuth2ClientType.PUBLIC,
+                "A public test client.");
         clientJson.setRedirectURI(redirectUri);
         Response response = registerClient(username, clientJson);
-        testInvalidRedirectUri(response.readEntity(String.class), response.getHeaderString("Content-Type"), false, response.getStatus());
+        testInvalidRedirectUri(response.readEntity(String.class),
+                response.getHeaderString("Content-Type"), false,
+                response.getStatus());
         // localhost is not allowed
         // redirectUri = "http://localhost:1410";
         // clientJson.setRedirectURI(redirectUri);
@@ -177,12 +203,17 @@
         redirectUri = "https://public.client.com/redirect.html#bar";
         clientJson.setRedirectURI(redirectUri);
         response = registerClient(username, clientJson);
-        testInvalidRedirectUri(response.readEntity(String.class), response.getHeaderString("Content-Type"), false, response.getStatus());
+        testInvalidRedirectUri(response.readEntity(String.class),
+                response.getHeaderString("Content-Type"), false,
+                response.getStatus());
     }
 
     @Test
-    public void testRegisterPublicClientWithRefreshTokenExpiry() throws ProcessingException, KustvaktException {
-        OAuth2ClientJson clientJson = createOAuth2ClientJson("OAuth2PublicClient", OAuth2ClientType.PUBLIC, "A public test client.");
+    public void testRegisterPublicClientWithRefreshTokenExpiry ()
+            throws ProcessingException, KustvaktException {
+        OAuth2ClientJson clientJson = createOAuth2ClientJson(
+                "OAuth2PublicClient", OAuth2ClientType.PUBLIC,
+                "A public test client.");
         clientJson.setRefreshTokenExpiry(31535000);
         Response response = registerClient(username, clientJson);
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
@@ -191,9 +222,12 @@
     }
 
     @Test
-    public void testRegisterConfidentialClientWithRefreshTokenExpiry() throws ProcessingException, KustvaktException {
+    public void testRegisterConfidentialClientWithRefreshTokenExpiry ()
+            throws ProcessingException, KustvaktException {
         int expiry = 31535000;
-        OAuth2ClientJson clientJson = createOAuth2ClientJson("OAuth2 Confidential Client", OAuth2ClientType.CONFIDENTIAL, "A confidential client.");
+        OAuth2ClientJson clientJson = createOAuth2ClientJson(
+                "OAuth2 Confidential Client", OAuth2ClientType.CONFIDENTIAL,
+                "A confidential client.");
         clientJson.setRefreshTokenExpiry(expiry);
         Response response = registerClient(username, clientJson);
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
@@ -204,21 +238,28 @@
     }
 
     @Test
-    public void testRegisterConfidentialClientWithInvalidRefreshTokenExpiry() throws ProcessingException, KustvaktException {
-        OAuth2ClientJson clientJson = createOAuth2ClientJson("OAuth2 Confidential Client", OAuth2ClientType.CONFIDENTIAL, "A confidential client.");
+    public void testRegisterConfidentialClientWithInvalidRefreshTokenExpiry ()
+            throws ProcessingException, KustvaktException {
+        OAuth2ClientJson clientJson = createOAuth2ClientJson(
+                "OAuth2 Confidential Client", OAuth2ClientType.CONFIDENTIAL,
+                "A confidential client.");
         clientJson.setRefreshTokenExpiry(31537000);
         Response response = registerClient(username, clientJson);
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
-        assertEquals(node.at("/error_description").asText(), "Maximum refresh token expiry is 31536000 seconds (1 year)");
+        assertEquals(node.at("/error_description").asText(),
+                "Maximum refresh token expiry is 31536000 seconds (1 year)");
         assertEquals(node.at("/error").asText(), "invalid_request");
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
     }
 
     @Test
-    public void testRegisterClientInvalidURL() throws ProcessingException, KustvaktException {
+    public void testRegisterClientInvalidURL ()
+            throws ProcessingException, KustvaktException {
         // invalid hostname
         String url = "https://test.public.client";
-        OAuth2ClientJson clientJson = createOAuth2ClientJson("OAuth2PublicClient", OAuth2ClientType.PUBLIC, "A public test client.");
+        OAuth2ClientJson clientJson = createOAuth2ClientJson(
+                "OAuth2PublicClient", OAuth2ClientType.PUBLIC,
+                "A public test client.");
         clientJson.setUrl(url);
         Response response = registerClient(username, clientJson);
         testInvalidUrl(response.readEntity(String.class), response.getStatus());
@@ -229,7 +270,8 @@
         testInvalidUrl(response.readEntity(String.class), response.getStatus());
     }
 
-    private void testInvalidUrl(String entity, int status) throws KustvaktException {
+    private void testInvalidUrl (String entity, int status)
+            throws KustvaktException {
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(OAuth2Error.INVALID_REQUEST, node.at("/error").asText());
         assertEquals(node.at("/error_description").asText(), "Invalid URL");
@@ -237,9 +279,12 @@
     }
 
     @Test
-    public void testRegisterPublicClient() throws ProcessingException, KustvaktException {
+    public void testRegisterPublicClient ()
+            throws ProcessingException, KustvaktException {
         String redirectUri = "https://public.client.com/redirect";
-        OAuth2ClientJson clientJson = createOAuth2ClientJson("OAuth2PublicClient", OAuth2ClientType.PUBLIC, "A public test client.");
+        OAuth2ClientJson clientJson = createOAuth2ClientJson(
+                "OAuth2PublicClient", OAuth2ClientType.PUBLIC,
+                "A public test client.");
         // http and fragment are allowed
         clientJson.setUrl("http://public.client.com/index.html#bar");
         clientJson.setRedirectURI(redirectUri);
@@ -255,27 +300,46 @@
         testAccessTokenAfterDeregistration(clientId, null, "");
     }
 
-    private void testRegisterClientUnauthorizedScope(String clientId) throws ProcessingException, KustvaktException {
-        String userAuthHeader = HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("dory", "password");
+    private void testRegisterClientUnauthorizedScope (String clientId)
+            throws ProcessingException, KustvaktException {
+        String userAuthHeader = HttpAuthorizationHandler
+                .createBasicAuthorizationHeaderValue("dory", "password");
         String code = requestAuthorizationCode(clientId, userAuthHeader);
-        Response response = requestTokenWithAuthorizationCodeAndForm(clientId, clientSecret, code);
+        Response response = requestTokenWithAuthorizationCodeAndForm(clientId,
+                clientSecret, code);
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
         assertEquals(node.at("/scope").asText(), "match_info search");
         String accessToken = node.at("/access_token").asText();
-        OAuth2ClientJson clientJson = createOAuth2ClientJson("R client", OAuth2ClientType.PUBLIC, null);
-        response = target().path(API_VERSION).path("oauth2").path("client").path("register").request().header(Attributes.AUTHORIZATION, "Bearer " + accessToken).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).post(Entity.json(clientJson));
+        OAuth2ClientJson clientJson = createOAuth2ClientJson("R client",
+                OAuth2ClientType.PUBLIC, null);
+        response = target().path(API_VERSION).path("oauth2").path("client")
+                .path("register").request()
+                .header(Attributes.AUTHORIZATION, "Bearer " + accessToken)
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .post(Entity.json(clientJson));
         String entity = response.readEntity(String.class);
         node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.AUTHORIZATION_FAILED, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "Scope register_client is not authorized");
+        assertEquals(StatusCodes.AUTHORIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Scope register_client is not authorized");
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
     }
 
     @Test
-    public void testRegisterClientUsingPlainJson() throws ProcessingException, KustvaktException, IOException {
-        InputStream is = getClass().getClassLoader().getResourceAsStream("json/oauth2_public_client.json");
+    public void testRegisterClientUsingPlainJson ()
+            throws ProcessingException, KustvaktException, IOException {
+        InputStream is = getClass().getClassLoader()
+                .getResourceAsStream("json/oauth2_public_client.json");
         String json = IOUtils.toString(is, Charset.defaultCharset());
-        Response response = target().path(API_VERSION).path("oauth2").path("client").path("register").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "password")).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).post(Entity.json(json));
+        Response response = target().path(API_VERSION).path("oauth2")
+                .path("client").path("register").request()
+                .header(Attributes.AUTHORIZATION,
+                        HttpAuthorizationHandler
+                                .createBasicAuthorizationHeaderValue(username,
+                                        "password"))
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .post(Entity.json(json));
         String entity = response.readEntity(String.class);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(entity);
@@ -287,8 +351,11 @@
     }
 
     @Test
-    public void testRegisterDesktopApp() throws ProcessingException, KustvaktException {
-        OAuth2ClientJson clientJson = createOAuth2ClientJson("OAuth2DesktopClient", OAuth2ClientType.PUBLIC, "This is a desktop test client.");
+    public void testRegisterDesktopApp ()
+            throws ProcessingException, KustvaktException {
+        OAuth2ClientJson clientJson = createOAuth2ClientJson(
+                "OAuth2DesktopClient", OAuth2ClientType.PUBLIC,
+                "This is a desktop test client.");
         Response response = registerClient(username, clientJson);
         String entity = response.readEntity(String.class);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
@@ -302,9 +369,12 @@
     }
 
     @Test
-    public void testRegisterMultipleDesktopApps() throws ProcessingException, KustvaktException {
+    public void testRegisterMultipleDesktopApps ()
+            throws ProcessingException, KustvaktException {
         // First client
-        OAuth2ClientJson clientJson = createOAuth2ClientJson("OAuth2DesktopClient1", OAuth2ClientType.PUBLIC, "A desktop test client.");
+        OAuth2ClientJson clientJson = createOAuth2ClientJson(
+                "OAuth2DesktopClient1", OAuth2ClientType.PUBLIC,
+                "A desktop test client.");
         Response response = registerClient(username, clientJson);
         String entity = response.readEntity(String.class);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
@@ -313,7 +383,8 @@
         assertNotNull(clientId1);
         assertTrue(node.at("/client_secret").isMissingNode());
         // Second client
-        clientJson = createOAuth2ClientJson("OAuth2DesktopClient2", OAuth2ClientType.PUBLIC, "Another desktop test client.");
+        clientJson = createOAuth2ClientJson("OAuth2DesktopClient2",
+                OAuth2ClientType.PUBLIC, "Another desktop test client.");
         response = registerClient(username, clientJson);
         entity = response.readEntity(String.class);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
@@ -322,66 +393,106 @@
         assertNotNull(clientId2);
         assertTrue(node.at("/client_secret").isMissingNode());
         testResetPublicClientSecret(clientId1);
-        testAccessTokenAfterDeregistration(clientId1, null, "https://OAuth2DesktopClient1.com");
+        testAccessTokenAfterDeregistration(clientId1, null,
+                "https://OAuth2DesktopClient1.com");
         testResetPublicClientSecret(clientId2);
-        testAccessTokenAfterDeregistration(clientId2, null, "https://OAuth2DesktopClient2.com");
+        testAccessTokenAfterDeregistration(clientId2, null,
+                "https://OAuth2DesktopClient2.com");
     }
 
-    private void testAccessTokenAfterDeregistration(String clientId, String clientSecret, String redirectUri) throws KustvaktException {
-        String userAuthHeader = HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("dory", "password");
-        String code = requestAuthorizationCode(clientId, redirectUri, userAuthHeader);
-        Response response = requestTokenWithAuthorizationCodeAndForm(clientId, clientSecret, code, redirectUri);
+    private void testAccessTokenAfterDeregistration (String clientId,
+            String clientSecret, String redirectUri) throws KustvaktException {
+        String userAuthHeader = HttpAuthorizationHandler
+                .createBasicAuthorizationHeaderValue("dory", "password");
+        String code = requestAuthorizationCode(clientId, redirectUri,
+                userAuthHeader);
+        Response response = requestTokenWithAuthorizationCodeAndForm(clientId,
+                clientSecret, code, redirectUri);
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
         String accessToken = node.at("/access_token").asText();
         response = searchWithAccessToken(accessToken);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         code = requestAuthorizationCode(clientId, redirectUri, userAuthHeader);
         testDeregisterPublicClient(clientId, username);
-        response = requestTokenWithAuthorizationCodeAndForm(clientId, clientSecret, code, redirectUri);
+        response = requestTokenWithAuthorizationCodeAndForm(clientId,
+                clientSecret, code, redirectUri);
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
         node = JsonUtils.readTree(response.readEntity(String.class));
-        assertEquals(OAuth2Error.INVALID_CLIENT.toString(), node.at("/error").asText());
+        assertEquals(OAuth2Error.INVALID_CLIENT.toString(),
+                node.at("/error").asText());
         response = searchWithAccessToken(accessToken);
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
         node = JsonUtils.readTree(response.readEntity(String.class));
-        assertEquals(StatusCodes.INVALID_ACCESS_TOKEN, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "Access token is invalid");
+        assertEquals(StatusCodes.INVALID_ACCESS_TOKEN,
+                node.at("/errors/0/0").asInt());
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Access token is invalid");
     }
 
-    private void testDeregisterPublicClientMissingUserAuthentication(String clientId) throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("oauth2").path("client").path("deregister").path(clientId).request().delete();
+    private void testDeregisterPublicClientMissingUserAuthentication (
+            String clientId) throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("oauth2")
+                .path("client").path("deregister").path(clientId).request()
+                .delete();
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.AUTHORIZATION_FAILED, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.AUTHORIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
     }
 
-    private void testDeregisterPublicClientMissingId() throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("oauth2").path("client").path("deregister").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).delete();
-        assertEquals(Status.METHOD_NOT_ALLOWED.getStatusCode(), response.getStatus());
+    private void testDeregisterPublicClientMissingId ()
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("oauth2")
+                .path("client").path("deregister").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .delete();
+        assertEquals(Status.METHOD_NOT_ALLOWED.getStatusCode(),
+                response.getStatus());
     }
 
-    private void testDeregisterPublicClient(String clientId, String username) throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("oauth2").path("client").path("deregister").path(clientId).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).delete();
+    private void testDeregisterPublicClient (String clientId, String username)
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("oauth2")
+                .path("client").path("deregister").path(clientId).request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .delete();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
     }
 
-    private void testResetPublicClientSecret(String clientId) throws ProcessingException, KustvaktException {
+    private void testResetPublicClientSecret (String clientId)
+            throws ProcessingException, KustvaktException {
         Form form = new Form();
         form.param("client_id", clientId);
-        Response response = target().path(API_VERSION).path("oauth2").path("client").path("reset").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED).post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("oauth2")
+                .path("client").path("reset").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .header(HttpHeaders.CONTENT_TYPE,
+                        ContentType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(form));
         String entity = response.readEntity(String.class);
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(OAuth2Error.INVALID_REQUEST, node.at("/error").asText());
-        assertEquals(node.at("/error_description").asText(), "Operation is not allowed for public clients");
+        assertEquals(node.at("/error_description").asText(),
+                "Operation is not allowed for public clients");
     }
 
-    private String testResetConfidentialClientSecret(String clientId, String clientSecret) throws ProcessingException, KustvaktException {
+    private String testResetConfidentialClientSecret (String clientId,
+            String clientSecret) throws ProcessingException, KustvaktException {
         Form form = new Form();
         form.param("client_id", clientId);
         form.param("client_secret", clientSecret);
-        Response response = target().path(API_VERSION).path("oauth2").path("client").path("reset").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED).post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("oauth2")
+                .path("client").path("reset").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .header(HttpHeaders.CONTENT_TYPE,
+                        ContentType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(form));
         String entity = response.readEntity(String.class);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(entity);
@@ -391,10 +502,16 @@
         return newClientSecret;
     }
 
-    private void requestAuthorizedClientList(String userAuthHeader) throws KustvaktException {
+    private void requestAuthorizedClientList (String userAuthHeader)
+            throws KustvaktException {
         Form form = getSuperClientForm();
         form.param("authorized_only", "true");
-        Response response = target().path(API_VERSION).path("oauth2").path("client").path("list").request().header(Attributes.AUTHORIZATION, userAuthHeader).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED).post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("oauth2")
+                .path("client").path("list").request()
+                .header(Attributes.AUTHORIZATION, userAuthHeader)
+                .header(HttpHeaders.CONTENT_TYPE,
+                        ContentType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(form));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         // System.out.println(entity);
@@ -402,21 +519,24 @@
         assertEquals(2, node.size());
         assertEquals(confidentialClientId, node.at("/0/client_id").asText());
         assertEquals(publicClientId, node.at("/1/client_id").asText());
-        assertEquals(node.at("/0/client_name").asText(), "non super confidential client");
+        assertEquals(node.at("/0/client_name").asText(),
+                "non super confidential client");
         assertEquals(node.at("/0/client_type").asText(), "CONFIDENTIAL");
         assertFalse(node.at("/0/client_url").isMissingNode());
         assertFalse(node.at("/0/client_description").isMissingNode());
     }
 
     @Test
-    public void testListPublicClient() throws KustvaktException {
+    public void testListPublicClient () throws KustvaktException {
         String clientName = "OAuth2DoryClient";
-        OAuth2ClientJson json = createOAuth2ClientJson(clientName, OAuth2ClientType.PUBLIC, "Dory's client.");
+        OAuth2ClientJson json = createOAuth2ClientJson(clientName,
+                OAuth2ClientType.PUBLIC, "Dory's client.");
         registerClient("dory", json);
         JsonNode node = listUserRegisteredClients("dory");
         assertEquals(1, node.size());
         assertEquals(clientName, node.at("/0/client_name").asText());
-        assertEquals(OAuth2ClientType.PUBLIC.name(), node.at("/0/client_type").asText());
+        assertEquals(OAuth2ClientType.PUBLIC.name(),
+                node.at("/0/client_type").asText());
         assertTrue(node.at("/0/permitted").asBoolean());
         assertFalse(node.at("/0/registration_date").isMissingNode());
         assertTrue(node.at("/refresh_token_expiry").isMissingNode());
@@ -424,38 +544,46 @@
         testDeregisterPublicClient(clientId, "dory");
     }
 
-    private void testListConfidentialClient(String username, String clientId) throws ProcessingException, KustvaktException {
+    private void testListConfidentialClient (String username, String clientId)
+            throws ProcessingException, KustvaktException {
         JsonNode node = listUserRegisteredClients(username);
         assertEquals(1, node.size());
         assertEquals(clientId, node.at("/0/client_id").asText());
         assertEquals(node.at("/0/client_name").asText(), "OAuth2ClientTest");
-        assertEquals(OAuth2ClientType.CONFIDENTIAL.name(), node.at("/0/client_type").asText());
+        assertEquals(OAuth2ClientType.CONFIDENTIAL.name(),
+                node.at("/0/client_type").asText());
         assertNotNull(node.at("/0/client_description"));
         assertEquals(clientURL, node.at("/0/client_url").asText());
-        assertEquals(clientRedirectUri, node.at("/0/client_redirect_uri").asText());
+        assertEquals(clientRedirectUri,
+                node.at("/0/client_redirect_uri").asText());
         assertNotNull(node.at("/0/registration_date"));
-        assertEquals(defaultRefreshTokenExpiry, node.at("/0/refresh_token_expiry").asInt());
+        assertEquals(defaultRefreshTokenExpiry,
+                node.at("/0/refresh_token_expiry").asInt());
         assertTrue(node.at("/0/permitted").asBoolean());
         assertTrue(node.at("/0/source").isMissingNode());
     }
 
     @Test
-    public void testListUserClients() throws KustvaktException {
+    public void testListUserClients () throws KustvaktException {
         String username = "pearl";
         String password = "pwd";
-        userAuthHeader = HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, password);
+        userAuthHeader = HttpAuthorizationHandler
+                .createBasicAuthorizationHeaderValue(username, password);
         // super client
-        Response response = requestTokenWithPassword(superClientId, clientSecret, username, password);
+        Response response = requestTokenWithPassword(superClientId,
+                clientSecret, username, password);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         // client 1
         String code = requestAuthorizationCode(publicClientId, userAuthHeader);
-        response = requestTokenWithAuthorizationCodeAndForm(publicClientId, "", code);
+        response = requestTokenWithAuthorizationCodeAndForm(publicClientId, "",
+                code);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
         String accessToken = node.at("/access_token").asText();
         // client 2
         code = requestAuthorizationCode(confidentialClientId, userAuthHeader);
-        response = requestTokenWithAuthorizationCodeAndForm(confidentialClientId, clientSecret, code);
+        response = requestTokenWithAuthorizationCodeAndForm(
+                confidentialClientId, clientSecret, code);
         String refreshToken = node.at("/refresh_token").asText();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         requestAuthorizedClientList(userAuthHeader);
@@ -463,64 +591,88 @@
         testListAuthorizedClientWithMultipleAccessTokens(userAuthHeader);
         testListWithClientsFromAnotherUser(userAuthHeader);
         // revoke client 1
-        testRevokeAllTokenViaSuperClient(publicClientId, userAuthHeader, accessToken);
+        testRevokeAllTokenViaSuperClient(publicClientId, userAuthHeader,
+                accessToken);
         // revoke client 2
         node = JsonUtils.readTree(response.readEntity(String.class));
         accessToken = node.at("/access_token").asText();
         refreshToken = node.at("/refresh_token").asText();
-        testRevokeAllTokenViaSuperClient(confidentialClientId, userAuthHeader, accessToken);
-        testRequestTokenWithRevokedRefreshToken(confidentialClientId, clientSecret, refreshToken);
+        testRevokeAllTokenViaSuperClient(confidentialClientId, userAuthHeader,
+                accessToken);
+        testRequestTokenWithRevokedRefreshToken(confidentialClientId,
+                clientSecret, refreshToken);
     }
 
-    private void testListAuthorizedClientWithMultipleRefreshTokens(String userAuthHeader) throws KustvaktException {
+    private void testListAuthorizedClientWithMultipleRefreshTokens (
+            String userAuthHeader) throws KustvaktException {
         // client 2
-        String code = requestAuthorizationCode(confidentialClientId, userAuthHeader);
-        Response response = requestTokenWithAuthorizationCodeAndForm(confidentialClientId, clientSecret, code);
+        String code = requestAuthorizationCode(confidentialClientId,
+                userAuthHeader);
+        Response response = requestTokenWithAuthorizationCodeAndForm(
+                confidentialClientId, clientSecret, code);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         requestAuthorizedClientList(userAuthHeader);
     }
 
-    private void testListAuthorizedClientWithMultipleAccessTokens(String userAuthHeader) throws KustvaktException {
+    private void testListAuthorizedClientWithMultipleAccessTokens (
+            String userAuthHeader) throws KustvaktException {
         // client 1
         String code = requestAuthorizationCode(publicClientId, userAuthHeader);
-        Response response = requestTokenWithAuthorizationCodeAndForm(publicClientId, "", code);
+        Response response = requestTokenWithAuthorizationCodeAndForm(
+                publicClientId, "", code);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         requestAuthorizedClientList(userAuthHeader);
     }
 
-    private void testListWithClientsFromAnotherUser(String userAuthHeader) throws KustvaktException {
-        String aaaAuthHeader = HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("aaa", "pwd");
+    private void testListWithClientsFromAnotherUser (String userAuthHeader)
+            throws KustvaktException {
+        String aaaAuthHeader = HttpAuthorizationHandler
+                .createBasicAuthorizationHeaderValue("aaa", "pwd");
         // client 1
         String code = requestAuthorizationCode(publicClientId, aaaAuthHeader);
-        Response response = requestTokenWithAuthorizationCodeAndForm(publicClientId, "", code);
+        Response response = requestTokenWithAuthorizationCodeAndForm(
+                publicClientId, "", code);
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
         String accessToken1 = node.at("/access_token").asText();
         // client 2
         code = requestAuthorizationCode(confidentialClientId, aaaAuthHeader);
-        response = requestTokenWithAuthorizationCodeAndForm(confidentialClientId, clientSecret, code);
+        response = requestTokenWithAuthorizationCodeAndForm(
+                confidentialClientId, clientSecret, code);
         node = JsonUtils.readTree(response.readEntity(String.class));
         String accessToken2 = node.at("/access_token").asText();
         String refreshToken = node.at("/refresh_token").asText();
         requestAuthorizedClientList(aaaAuthHeader);
         requestAuthorizedClientList(userAuthHeader);
-        testRevokeAllTokenViaSuperClient(publicClientId, aaaAuthHeader, accessToken1);
-        testRevokeAllTokenViaSuperClient(confidentialClientId, aaaAuthHeader, accessToken2);
-        testRequestTokenWithRevokedRefreshToken(confidentialClientId, clientSecret, refreshToken);
+        testRevokeAllTokenViaSuperClient(publicClientId, aaaAuthHeader,
+                accessToken1);
+        testRevokeAllTokenViaSuperClient(confidentialClientId, aaaAuthHeader,
+                accessToken2);
+        testRequestTokenWithRevokedRefreshToken(confidentialClientId,
+                clientSecret, refreshToken);
     }
 
-    private void testRevokeAllTokenViaSuperClient(String clientId, String userAuthHeader, String accessToken) throws KustvaktException {
+    private void testRevokeAllTokenViaSuperClient (String clientId,
+            String userAuthHeader, String accessToken)
+            throws KustvaktException {
         // check token before revoking
         Response response = searchWithAccessToken(accessToken);
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
         assertTrue(node.at("/matches").size() > 0);
         Form form = getSuperClientForm();
         form.param("client_id", clientId);
-        response = target().path(API_VERSION).path("oauth2").path("revoke").path("super").path("all").request().header(Attributes.AUTHORIZATION, userAuthHeader).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED).post(Entity.form(form));
+        response = target().path(API_VERSION).path("oauth2").path("revoke")
+                .path("super").path("all").request()
+                .header(Attributes.AUTHORIZATION, userAuthHeader)
+                .header(HttpHeaders.CONTENT_TYPE,
+                        ContentType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(form));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         assertEquals(response.readEntity(String.class), "SUCCESS");
         response = searchWithAccessToken(accessToken);
         node = JsonUtils.readTree(response.readEntity(String.class));
-        assertEquals(StatusCodes.INVALID_ACCESS_TOKEN, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "Access token is invalid");
+        assertEquals(StatusCodes.INVALID_ACCESS_TOKEN,
+                node.at("/errors/0/0").asInt());
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Access token is invalid");
     }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2ControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2ControllerTest.java
index af00355..ab2eb27 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2ControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2ControllerTest.java
@@ -40,29 +40,35 @@
 
     public String userAuthHeader;
 
-    public OAuth2ControllerTest() throws KustvaktException {
-        userAuthHeader = HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("dory", "password");
+    public OAuth2ControllerTest () throws KustvaktException {
+        userAuthHeader = HttpAuthorizationHandler
+                .createBasicAuthorizationHeaderValue("dory", "password");
     }
 
     @Test
     public void testRequestTokenAuthorizationPublic ()
             throws KustvaktException {
         String code = requestAuthorizationCode(publicClientId, userAuthHeader);
-        Response response = requestTokenWithAuthorizationCodeAndForm(publicClientId, clientSecret, code);
+        Response response = requestTokenWithAuthorizationCodeAndForm(
+                publicClientId, clientSecret, code);
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         String accessToken = node.at("/access_token").asText();
-        assertEquals(TokenType.BEARER.displayName(), node.at("/token_type").asText());
+        assertEquals(TokenType.BEARER.displayName(),
+                node.at("/token_type").asText());
         assertEquals(31536000, node.at("/expires_in").asInt());
         testRevokeToken(accessToken, publicClientId, null, ACCESS_TOKEN_TYPE);
         assertTrue(node.at("/refresh_token").isMissingNode());
     }
 
     @Test
-    public void testRequestTokenAuthorizationConfidential() throws KustvaktException {
+    public void testRequestTokenAuthorizationConfidential ()
+            throws KustvaktException {
         String scope = "search";
-        Response response = requestAuthorizationCode("code", confidentialClientId, "", scope, state, userAuthHeader);
-        MultivaluedMap<String, String> params = getQueryParamsFromURI(response.getLocation());
+        Response response = requestAuthorizationCode("code",
+                confidentialClientId, "", scope, state, userAuthHeader);
+        MultivaluedMap<String, String> params = getQueryParamsFromURI(
+                response.getLocation());
         String code = params.get("code").get(0);
 
         response = requestTokenWithAuthorizationCodeAndForm(
@@ -71,7 +77,8 @@
         JsonNode node = JsonUtils.readTree(entity);
         assertNotNull(node.at("/access_token").asText());
         assertNotNull(node.at("/refresh_token").asText());
-        assertEquals(TokenType.BEARER.displayName(), node.at("/token_type").asText());
+        assertEquals(TokenType.BEARER.displayName(),
+                node.at("/token_type").asText());
         assertNotNull(node.at("/expires_in").asText());
         testRequestTokenWithUsedAuthorization(code);
         String refreshToken = node.at("/refresh_token").asText();
@@ -79,21 +86,27 @@
         testRequestRefreshTokenInvalidScope(confidentialClientId, refreshToken);
         testRequestRefreshTokenInvalidClient(refreshToken);
         testRequestRefreshTokenInvalidRefreshToken(confidentialClientId);
-        testRequestRefreshToken(confidentialClientId, clientSecret, refreshToken);
+        testRequestRefreshToken(confidentialClientId, clientSecret,
+                refreshToken);
     }
 
-    private void testRequestTokenWithUsedAuthorization(String code) throws KustvaktException {
-        Response response = requestTokenWithAuthorizationCodeAndForm(confidentialClientId, clientSecret, code);
+    private void testRequestTokenWithUsedAuthorization (String code)
+            throws KustvaktException {
+        Response response = requestTokenWithAuthorizationCodeAndForm(
+                confidentialClientId, clientSecret, code);
         String entity = response.readEntity(String.class);
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(OAuth2Error.INVALID_GRANT, node.at("/error").asText());
-        assertEquals(node.at("/error_description").asText(), "Invalid authorization");
+        assertEquals(node.at("/error_description").asText(),
+                "Invalid authorization");
     }
 
     @Test
-    public void testRequestTokenInvalidAuthorizationCode() throws KustvaktException {
-        Response response = requestTokenWithAuthorizationCodeAndForm(confidentialClientId, clientSecret, "blahblah");
+    public void testRequestTokenInvalidAuthorizationCode ()
+            throws KustvaktException {
+        Response response = requestTokenWithAuthorizationCodeAndForm(
+                confidentialClientId, clientSecret, "blahblah");
         String entity = response.readEntity(String.class);
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(entity);
@@ -101,10 +114,13 @@
     }
 
     @Test
-    public void testRequestTokenAuthorizationReplyAttack() throws KustvaktException {
+    public void testRequestTokenAuthorizationReplyAttack ()
+            throws KustvaktException {
         String redirect_uri = "https://third.party.com/confidential/redirect";
         String scope = "search";
-        Response response = requestAuthorizationCode("code", confidentialClientId, redirect_uri, scope, state, userAuthHeader);
+        Response response = requestAuthorizationCode("code",
+                confidentialClientId, redirect_uri, scope, state,
+                userAuthHeader);
         String code = parseAuthorizationCode(response);
         testRequestTokenAuthorizationInvalidClient(code);
         testRequestTokenAuthorizationMissingRedirectUri(code);
@@ -112,22 +128,28 @@
         testRequestTokenAuthorizationRevoked(code, redirect_uri);
     }
 
-    private void testRequestTokenAuthorizationInvalidClient(String code) throws KustvaktException {
-        Response response = requestTokenWithAuthorizationCodeAndForm(confidentialClientId, "wrong_secret", code);
+    private void testRequestTokenAuthorizationInvalidClient (String code)
+            throws KustvaktException {
+        Response response = requestTokenWithAuthorizationCodeAndForm(
+                confidentialClientId, "wrong_secret", code);
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(OAuth2Error.INVALID_CLIENT, node.at("/error").asText());
     }
 
-    private void testRequestTokenAuthorizationMissingRedirectUri(String code) throws KustvaktException {
-        Response response = requestTokenWithAuthorizationCodeAndForm(confidentialClientId, "secret", code);
+    private void testRequestTokenAuthorizationMissingRedirectUri (String code)
+            throws KustvaktException {
+        Response response = requestTokenWithAuthorizationCodeAndForm(
+                confidentialClientId, "secret", code);
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(OAuth2Error.INVALID_GRANT, node.at("/error").asText());
-        assertEquals(node.at("/error_description").asText(), "Missing redirect URI");
+        assertEquals(node.at("/error_description").asText(),
+                "Missing redirect URI");
     }
 
-    private void testRequestTokenAuthorizationInvalidRedirectUri(String code) throws KustvaktException {
+    private void testRequestTokenAuthorizationInvalidRedirectUri (String code)
+            throws KustvaktException {
         Form tokenForm = new Form();
         tokenForm.param("grant_type", "authorization_code");
         tokenForm.param("client_id", confidentialClientId);
@@ -140,7 +162,8 @@
         assertEquals(OAuth2Error.INVALID_GRANT, node.at("/error").asText());
     }
 
-    private void testRequestTokenAuthorizationRevoked(String code, String uri) throws KustvaktException {
+    private void testRequestTokenAuthorizationRevoked (String code, String uri)
+            throws KustvaktException {
         Form tokenForm = new Form();
         tokenForm.param("grant_type", "authorization_code");
         tokenForm.param("client_id", confidentialClientId);
@@ -151,21 +174,26 @@
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(OAuth2Error.INVALID_GRANT, node.at("/error").asText());
-        assertEquals(node.at("/error_description").asText(), "Invalid authorization");
+        assertEquals(node.at("/error_description").asText(),
+                "Invalid authorization");
     }
 
     @Test
-    public void testRequestTokenPasswordGrantConfidentialSuper() throws KustvaktException {
-        Response response = requestTokenWithDoryPassword(superClientId, clientSecret);
+    public void testRequestTokenPasswordGrantConfidentialSuper ()
+            throws KustvaktException {
+        Response response = requestTokenWithDoryPassword(superClientId,
+                clientSecret);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertNotNull(node.at("/access_token").asText());
-        assertEquals(TokenType.BEARER.displayName(), node.at("/token_type").asText());
+        assertEquals(TokenType.BEARER.displayName(),
+                node.at("/token_type").asText());
         assertNotNull(node.at("/expires_in").asText());
         assertEquals(node.at("/scope").asText(), "all");
         String refresh = node.at("/refresh_token").asText();
-        RefreshToken refreshToken = refreshTokenDao.retrieveRefreshToken(refresh);
+        RefreshToken refreshToken = refreshTokenDao
+                .retrieveRefreshToken(refresh);
         Set<AccessScope> scopes = refreshToken.getScopes();
         assertEquals(1, scopes.size());
         assertEquals(scopes.toString(), "[all]");
@@ -173,7 +201,8 @@
     }
 
     @Test
-    public void testRequestTokenPasswordGrantWithScope() throws KustvaktException {
+    public void testRequestTokenPasswordGrantWithScope ()
+            throws KustvaktException {
         String scope = "match_info search";
         Form form = new Form();
         form.param("grant_type", "password");
@@ -187,47 +216,65 @@
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertNotNull(node.at("/access_token").asText());
-        assertEquals(TokenType.BEARER.displayName(), node.at("/token_type").asText());
+        assertEquals(TokenType.BEARER.displayName(),
+                node.at("/token_type").asText());
         assertNotNull(node.at("/expires_in").asText());
         assertEquals(scope, node.at("/scope").asText());
         String refreshToken = node.at("/refresh_token").asText();
-        testRequestRefreshTokenWithUnauthorizedScope(superClientId, clientSecret, refreshToken, "all");
-        testRequestRefreshTokenWithScope(superClientId, clientSecret, refreshToken, "search");
+        testRequestRefreshTokenWithUnauthorizedScope(superClientId,
+                clientSecret, refreshToken, "all");
+        testRequestRefreshTokenWithScope(superClientId, clientSecret,
+                refreshToken, "search");
     }
 
     @Test
-    public void testRequestTokenPasswordGrantConfidentialNonSuper() throws KustvaktException {
-        Response response = requestTokenWithDoryPassword(confidentialClientId, clientSecret);
+    public void testRequestTokenPasswordGrantConfidentialNonSuper ()
+            throws KustvaktException {
+        Response response = requestTokenWithDoryPassword(confidentialClientId,
+                clientSecret);
         String entity = response.readEntity(String.class);
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(OAuth2Error.UNAUTHORIZED_CLIENT, node.at("/error").asText());
-        assertEquals(node.at("/error_description").asText(), "Password grant is not allowed for third party clients");
+        assertEquals(OAuth2Error.UNAUTHORIZED_CLIENT,
+                node.at("/error").asText());
+        assertEquals(node.at("/error_description").asText(),
+                "Password grant is not allowed for third party clients");
     }
 
     @Test
-    public void testRequestTokenPasswordGrantPublic() throws KustvaktException {
+    public void testRequestTokenPasswordGrantPublic ()
+            throws KustvaktException {
         Response response = requestTokenWithDoryPassword(publicClientId, "");
         String entity = response.readEntity(String.class);
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(OAuth2Error.UNAUTHORIZED_CLIENT, node.at("/error").asText());
-        assertEquals(node.at("/error_description").asText(), "Password grant is not allowed for third party clients");
+        assertEquals(OAuth2Error.UNAUTHORIZED_CLIENT,
+                node.at("/error").asText());
+        assertEquals(node.at("/error_description").asText(),
+                "Password grant is not allowed for third party clients");
     }
 
     @Test
-    public void testRequestTokenPasswordGrantAuthorizationHeader() throws KustvaktException {
+    public void testRequestTokenPasswordGrantAuthorizationHeader ()
+            throws KustvaktException {
         Form form = new Form();
         form.param("grant_type", "password");
         form.param("client_id", superClientId);
         form.param("username", "dory");
         form.param("password", "password");
-        Response response = target().path(API_VERSION).path("oauth2").path("token").request().header(HttpHeaders.AUTHORIZATION, "Basic ZkNCYlFrQXlZekk0TnpVeE1nOnNlY3JldA==").header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED).post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("oauth2")
+                .path("token").request()
+                .header(HttpHeaders.AUTHORIZATION,
+                        "Basic ZkNCYlFrQXlZekk0TnpVeE1nOnNlY3JldA==")
+                .header(HttpHeaders.CONTENT_TYPE,
+                        ContentType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(form));
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertNotNull(node.at("/access_token").asText());
         assertNotNull(node.at("/refresh_token").asText());
-        assertEquals(TokenType.BEARER.displayName(), node.at("/token_type").asText());
+        assertEquals(TokenType.BEARER.displayName(),
+                node.at("/token_type").asText());
         assertNotNull(node.at("/expires_in").asText());
     }
 
@@ -238,74 +285,81 @@
      * @throws KustvaktException
      */
     @Test
-    public void testRequestTokenPasswordGrantDifferentClientIds() throws KustvaktException {
+    public void testRequestTokenPasswordGrantDifferentClientIds ()
+            throws KustvaktException {
         Form form = new Form();
         form.param("grant_type", "password");
         form.param("client_id", "9aHsGW6QflV13ixNpez");
         form.param("username", "dory");
         form.param("password", "password");
-        Response response = target().path(API_VERSION).path("oauth2").path("token").request().header(HttpHeaders.AUTHORIZATION, "Basic ZkNCYlFrQXlZekk0TnpVeE1nOnNlY3JldA==").header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED).post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("oauth2")
+                .path("token").request()
+                .header(HttpHeaders.AUTHORIZATION,
+                        "Basic ZkNCYlFrQXlZekk0TnpVeE1nOnNlY3JldA==")
+                .header(HttpHeaders.CONTENT_TYPE,
+                        ContentType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(form));
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertNotNull(node.at("/access_token").asText());
         assertNotNull(node.at("/refresh_token").asText());
-        assertEquals(TokenType.BEARER.displayName(), node.at("/token_type").asText());
+        assertEquals(TokenType.BEARER.displayName(),
+                node.at("/token_type").asText());
         assertNotNull(node.at("/expires_in").asText());
     }
 
     @Test
     public void testRequestTokenPasswordGrantMissingClientSecret ()
             throws KustvaktException {
-        Response response =
-                requestTokenWithDoryPassword(confidentialClientId, "");
+        Response response = requestTokenWithDoryPassword(confidentialClientId,
+                "");
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
 
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(OAuth2Error.INVALID_REQUEST,
-                node.at("/error").asText());
+        assertEquals(OAuth2Error.INVALID_REQUEST, node.at("/error").asText());
         assertNotNull(node.at("/error_description").asText());
     }
-    
+
     @Test
     public void testRequestTokenPasswordGrantEmptyClientSecret ()
             throws KustvaktException {
-        Response response =
-                requestTokenWithDoryPassword(confidentialClientId, "");
+        Response response = requestTokenWithDoryPassword(confidentialClientId,
+                "");
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(OAuth2Error.INVALID_REQUEST, node.at("/error").asText());
-        assertEquals(node.at("/error_description").asText(), "Missing parameter: client_secret");
+        assertEquals(node.at("/error_description").asText(),
+                "Missing parameter: client_secret");
     }
 
     @Test
-    public void testRequestTokenPasswordGrantMissingClientId() throws KustvaktException {
+    public void testRequestTokenPasswordGrantMissingClientId ()
+            throws KustvaktException {
         Response response = requestTokenWithDoryPassword(null, clientSecret);
         String entity = response.readEntity(String.class);
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(OAuth2Error.INVALID_REQUEST,
-                node.at("/error").asText());
+        assertEquals(OAuth2Error.INVALID_REQUEST, node.at("/error").asText());
         assertNotNull(node.at("/error_description").asText());
     }
-    
+
     @Test
     public void testRequestTokenPasswordGrantEmptyClientId ()
             throws KustvaktException {
-        Response response =
-                requestTokenWithDoryPassword("", clientSecret);
+        Response response = requestTokenWithDoryPassword("", clientSecret);
         String entity = response.readEntity(String.class);
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
 
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(OAuth2Error.INVALID_REQUEST,
-                node.at("/error").asText());
+        assertEquals(OAuth2Error.INVALID_REQUEST, node.at("/error").asText());
         assertNotNull(node.at("/error_description").asText());
     }
 
     @Test
-    public void testRequestTokenClientCredentialsGrant() throws KustvaktException {
+    public void testRequestTokenClientCredentialsGrant ()
+            throws KustvaktException {
         Form form = new Form();
         form.param("grant_type", "client_credentials");
         form.param("client_id", confidentialClientId);
@@ -317,7 +371,8 @@
         // length?
         assertNotNull(node.at("/access_token").asText());
         assertNotNull(node.at("/refresh_token").asText());
-        assertEquals(TokenType.BEARER.displayName(), node.at("/token_type").asText());
+        assertEquals(TokenType.BEARER.displayName(),
+                node.at("/token_type").asText());
         assertNotNull(node.at("/expires_in").asText());
     }
 
@@ -326,7 +381,8 @@
      * clients.
      */
     @Test
-    public void testRequestTokenClientCredentialsGrantPublic() throws KustvaktException {
+    public void testRequestTokenClientCredentialsGrantPublic ()
+            throws KustvaktException {
         Form form = new Form();
         form.param("grant_type", "client_credentials");
         form.param("client_id", publicClientId);
@@ -335,13 +391,13 @@
         String entity = response.readEntity(String.class);
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(OAuth2Error.INVALID_REQUEST,
-                node.at("/error").asText());
+        assertEquals(OAuth2Error.INVALID_REQUEST, node.at("/error").asText());
         assertNotNull(node.at("/error_description").asText());
     }
 
     @Test
-    public void testRequestTokenClientCredentialsGrantReducedScope() throws KustvaktException {
+    public void testRequestTokenClientCredentialsGrantReducedScope ()
+            throws KustvaktException {
         Form form = new Form();
         form.param("grant_type", "client_credentials");
         form.param("client_id", confidentialClientId);
@@ -354,13 +410,14 @@
         // length?
         assertNotNull(node.at("/access_token").asText());
         assertNotNull(node.at("/refresh_token").asText());
-        assertEquals(TokenType.BEARER.displayName(), node.at("/token_type").asText());
+        assertEquals(TokenType.BEARER.displayName(),
+                node.at("/token_type").asText());
         assertNotNull(node.at("/expires_in").asText());
         assertEquals(node.at("/scope").asText(), "client_info");
     }
 
     @Test
-    public void testRequestTokenMissingGrantType() throws KustvaktException {
+    public void testRequestTokenMissingGrantType () throws KustvaktException {
         Form form = new Form();
         Response response = requestToken(form);
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
@@ -370,109 +427,155 @@
     }
 
     @Test
-    public void testRequestTokenUnsupportedGrant() throws KustvaktException {
+    public void testRequestTokenUnsupportedGrant () throws KustvaktException {
         Form form = new Form();
         form.param("grant_type", "blahblah");
-        Response response = target().path(API_VERSION).path("oauth2").path("token").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED).post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("oauth2")
+                .path("token").request()
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(HttpHeaders.CONTENT_TYPE,
+                        ContentType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(form));
         String entity = response.readEntity(String.class);
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(entity);
         assertNotNull(node.get("error_description").asText());
-        assertEquals(OAuth2Error.INVALID_REQUEST,
-                node.get("error").asText());
+        assertEquals(OAuth2Error.INVALID_REQUEST, node.get("error").asText());
     }
 
-    private void testRequestRefreshTokenInvalidScope(String clientId, String refreshToken) throws KustvaktException {
+    private void testRequestRefreshTokenInvalidScope (String clientId,
+            String refreshToken) throws KustvaktException {
         Form form = new Form();
         form.param("grant_type", GrantType.REFRESH_TOKEN.toString());
         form.param("client_id", clientId);
         form.param("client_secret", clientSecret);
         form.param("refresh_token", refreshToken);
         form.param("scope", "search serialize_query");
-        Response response = target().path(API_VERSION).path("oauth2").path("token").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED).post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("oauth2")
+                .path("token").request()
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(HttpHeaders.CONTENT_TYPE,
+                        ContentType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(form));
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(OAuth2Error.INVALID_SCOPE, node.at("/error").asText());
     }
 
-    private void testRequestRefreshToken(String clientId, String clientSecret, String refreshToken) throws KustvaktException {
+    private void testRequestRefreshToken (String clientId, String clientSecret,
+            String refreshToken) throws KustvaktException {
         Form form = new Form();
         form.param("grant_type", GrantType.REFRESH_TOKEN.toString());
         form.param("client_id", clientId);
         form.param("client_secret", clientSecret);
         form.param("refresh_token", refreshToken);
-        Response response = target().path(API_VERSION).path("oauth2").path("token").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED).post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("oauth2")
+                .path("token").request()
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(HttpHeaders.CONTENT_TYPE,
+                        ContentType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(form));
         String entity = response.readEntity(String.class);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(entity);
         assertNotNull(node.at("/access_token").asText());
         String newRefreshToken = node.at("/refresh_token").asText();
         assertNotNull(newRefreshToken);
-        assertEquals(TokenType.BEARER.displayName(), node.at("/token_type").asText());
+        assertEquals(TokenType.BEARER.displayName(),
+                node.at("/token_type").asText());
         assertNotNull(node.at("/expires_in").asText());
         assertTrue(!newRefreshToken.equals(refreshToken));
-        testRequestTokenWithRevokedRefreshToken(clientId, clientSecret, refreshToken);
-        testRevokeToken(newRefreshToken, clientId, clientSecret, REFRESH_TOKEN_TYPE);
-        testRequestTokenWithRevokedRefreshToken(clientId, clientSecret, newRefreshToken);
+        testRequestTokenWithRevokedRefreshToken(clientId, clientSecret,
+                refreshToken);
+        testRevokeToken(newRefreshToken, clientId, clientSecret,
+                REFRESH_TOKEN_TYPE);
+        testRequestTokenWithRevokedRefreshToken(clientId, clientSecret,
+                newRefreshToken);
     }
 
-    private void testRequestRefreshTokenWithUnauthorizedScope(String clientId, String clientSecret, String refreshToken, String scope) throws KustvaktException {
+    private void testRequestRefreshTokenWithUnauthorizedScope (String clientId,
+            String clientSecret, String refreshToken, String scope)
+            throws KustvaktException {
         Form form = new Form();
         form.param("grant_type", GrantType.REFRESH_TOKEN.toString());
         form.param("client_id", clientId);
         form.param("client_secret", clientSecret);
         form.param("refresh_token", refreshToken);
         form.param("scope", scope);
-        Response response = target().path(API_VERSION).path("oauth2").path("token").request().header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED).post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("oauth2")
+                .path("token").request()
+                .header(HttpHeaders.CONTENT_TYPE,
+                        ContentType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(form));
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(OAuth2Error.INVALID_SCOPE, node.at("/error").asText());
     }
 
-    private void testRequestRefreshTokenWithScope(String clientId, String clientSecret, String refreshToken, String scope) throws KustvaktException {
+    private void testRequestRefreshTokenWithScope (String clientId,
+            String clientSecret, String refreshToken, String scope)
+            throws KustvaktException {
         Form form = new Form();
         form.param("grant_type", GrantType.REFRESH_TOKEN.toString());
         form.param("client_id", clientId);
         form.param("client_secret", clientSecret);
         form.param("refresh_token", refreshToken);
         form.param("scope", scope);
-        Response response = target().path(API_VERSION).path("oauth2").path("token").request().header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED).post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("oauth2")
+                .path("token").request()
+                .header(HttpHeaders.CONTENT_TYPE,
+                        ContentType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(form));
         String entity = response.readEntity(String.class);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(entity);
         assertNotNull(node.at("/access_token").asText());
         String newRefreshToken = node.at("/refresh_token").asText();
         assertNotNull(newRefreshToken);
-        assertEquals(TokenType.BEARER.displayName(), node.at("/token_type").asText());
+        assertEquals(TokenType.BEARER.displayName(),
+                node.at("/token_type").asText());
         assertNotNull(node.at("/expires_in").asText());
         assertTrue(!newRefreshToken.equals(refreshToken));
         assertEquals(scope, node.at("/scope").asText());
     }
 
-    private void testRequestRefreshTokenInvalidClient(String refreshToken) throws KustvaktException {
+    private void testRequestRefreshTokenInvalidClient (String refreshToken)
+            throws KustvaktException {
         Form form = new Form();
         form.param("grant_type", GrantType.REFRESH_TOKEN.toString());
         form.param("client_id", "iBr3LsTCxOj7D2o0A5m");
         form.param("refresh_token", refreshToken);
-        Response response = target().path(API_VERSION).path("oauth2").path("token").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED).post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("oauth2")
+                .path("token").request()
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(HttpHeaders.CONTENT_TYPE,
+                        ContentType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(form));
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(OAuth2Error.INVALID_CLIENT, node.at("/error").asText());
     }
 
-    private void testRequestRefreshTokenInvalidRefreshToken(String clientId) throws KustvaktException {
+    private void testRequestRefreshTokenInvalidRefreshToken (String clientId)
+            throws KustvaktException {
         Form form = new Form();
         form.param("grant_type", GrantType.REFRESH_TOKEN.toString());
         form.param("client_id", clientId);
         form.param("client_secret", clientSecret);
         form.param("refresh_token", "Lia8s8w8tJeZSBlaQDrYV8ion3l");
-        Response response = target().path(API_VERSION).path("oauth2").path("token").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED).post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("oauth2")
+                .path("token").request()
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(HttpHeaders.CONTENT_TYPE,
+                        ContentType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(form));
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(OAuth2Error.INVALID_GRANT, node.at("/error").asText());
     }
 
-    private JsonNode requestTokenList(String userAuthHeader, String tokenType, String clientId) throws KustvaktException {
+    private JsonNode requestTokenList (String userAuthHeader, String tokenType,
+            String clientId) throws KustvaktException {
         Form form = new Form();
         form.param("super_client_id", superClientId);
         form.param("super_client_secret", clientSecret);
@@ -480,33 +583,46 @@
         if (clientId != null && !clientId.isEmpty()) {
             form.param("client_id", clientId);
         }
-        Response response = target().path(API_VERSION).path("oauth2").path("token").path("list").request().header(Attributes.AUTHORIZATION, userAuthHeader).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED).post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("oauth2")
+                .path("token").path("list").request()
+                .header(Attributes.AUTHORIZATION, userAuthHeader)
+                .header(HttpHeaders.CONTENT_TYPE,
+                        ContentType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(form));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         return JsonUtils.readTree(entity);
     }
 
-    private JsonNode requestTokenList(String userAuthHeader, String tokenType) throws KustvaktException {
+    private JsonNode requestTokenList (String userAuthHeader, String tokenType)
+            throws KustvaktException {
         return requestTokenList(userAuthHeader, tokenType, null);
     }
 
     @Test
-    public void testListRefreshTokenConfidentialClient() throws KustvaktException {
+    public void testListRefreshTokenConfidentialClient ()
+            throws KustvaktException {
         String username = "gurgle";
         String password = "pwd";
-        userAuthHeader = HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, password);
+        userAuthHeader = HttpAuthorizationHandler
+                .createBasicAuthorizationHeaderValue(username, password);
         // super client
-        Response response = requestTokenWithPassword(superClientId, clientSecret, username, password);
+        Response response = requestTokenWithPassword(superClientId,
+                clientSecret, username, password);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
         String refreshToken1 = node.at("/refresh_token").asText();
         // client 1
-        String code = requestAuthorizationCode(confidentialClientId, userAuthHeader);
-        response = requestTokenWithAuthorizationCodeAndForm(confidentialClientId, clientSecret, code);
+        String code = requestAuthorizationCode(confidentialClientId,
+                userAuthHeader);
+        response = requestTokenWithAuthorizationCodeAndForm(
+                confidentialClientId, clientSecret, code);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         // client 2
-        code = requestAuthorizationCode(confidentialClientId2, clientRedirectUri, userAuthHeader);
-        response = requestTokenWithAuthorizationCodeAndForm(confidentialClientId2, clientSecret, code, clientRedirectUri);
+        code = requestAuthorizationCode(confidentialClientId2,
+                clientRedirectUri, userAuthHeader);
+        response = requestTokenWithAuthorizationCodeAndForm(
+                confidentialClientId2, clientSecret, code, clientRedirectUri);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         // list
         node = requestTokenList(userAuthHeader, REFRESH_TOKEN_TYPE);
@@ -515,31 +631,39 @@
         assertEquals(confidentialClientId2, node.at("/1/client_id").asText());
         // client 1
         code = requestAuthorizationCode(confidentialClientId, userAuthHeader);
-        response = requestTokenWithAuthorizationCodeAndForm(confidentialClientId, clientSecret, code);
+        response = requestTokenWithAuthorizationCodeAndForm(
+                confidentialClientId, clientSecret, code);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         // another user
-        String darlaAuthHeader = HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("darla", "pwd");
+        String darlaAuthHeader = HttpAuthorizationHandler
+                .createBasicAuthorizationHeaderValue("darla", "pwd");
         // test listing clients
         node = requestTokenList(darlaAuthHeader, REFRESH_TOKEN_TYPE);
         assertEquals(0, node.size());
         // client 1
         code = requestAuthorizationCode(confidentialClientId, darlaAuthHeader);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
-        response = requestTokenWithAuthorizationCodeAndForm(confidentialClientId, clientSecret, code);
+        response = requestTokenWithAuthorizationCodeAndForm(
+                confidentialClientId, clientSecret, code);
         node = JsonUtils.readTree(response.readEntity(String.class));
         String refreshToken5 = node.at("/refresh_token").asText();
         // list all refresh tokens
         node = requestTokenList(userAuthHeader, REFRESH_TOKEN_TYPE);
         assertEquals(3, node.size());
         // list refresh tokens from client 1
-        node = requestTokenList(userAuthHeader, REFRESH_TOKEN_TYPE, confidentialClientId);
+        node = requestTokenList(userAuthHeader, REFRESH_TOKEN_TYPE,
+                confidentialClientId);
         assertEquals(2, node.size());
-        testRevokeToken(refreshToken1, superClientId, clientSecret, REFRESH_TOKEN_TYPE);
-        testRevokeToken(node.at("/0/token").asText(), confidentialClientId, clientSecret, REFRESH_TOKEN_TYPE);
-        testRevokeToken(node.at("/1/token").asText(), confidentialClientId2, clientSecret, REFRESH_TOKEN_TYPE);
+        testRevokeToken(refreshToken1, superClientId, clientSecret,
+                REFRESH_TOKEN_TYPE);
+        testRevokeToken(node.at("/0/token").asText(), confidentialClientId,
+                clientSecret, REFRESH_TOKEN_TYPE);
+        testRevokeToken(node.at("/1/token").asText(), confidentialClientId2,
+                clientSecret, REFRESH_TOKEN_TYPE);
         node = requestTokenList(userAuthHeader, REFRESH_TOKEN_TYPE);
         assertEquals(1, node.size());
-        testRevokeTokenViaSuperClient(node.at("/0/token").asText(), userAuthHeader);
+        testRevokeTokenViaSuperClient(node.at("/0/token").asText(),
+                userAuthHeader);
         node = requestTokenList(userAuthHeader, REFRESH_TOKEN_TYPE);
         assertEquals(0, node.size());
         // try revoking a token belonging to another user
@@ -553,19 +677,22 @@
     }
 
     @Test
-    public void testListTokenPublicClient() throws KustvaktException {
+    public void testListTokenPublicClient () throws KustvaktException {
         String username = "nemo";
         String password = "pwd";
-        userAuthHeader = HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, password);
+        userAuthHeader = HttpAuthorizationHandler
+                .createBasicAuthorizationHeaderValue(username, password);
         // access token 1
         String code = requestAuthorizationCode(publicClientId, userAuthHeader);
-        Response response = requestTokenWithAuthorizationCodeAndForm(publicClientId, "", code);
+        Response response = requestTokenWithAuthorizationCodeAndForm(
+                publicClientId, "", code);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
         String accessToken1 = node.at("/access_token").asText();
         // access token 2
         code = requestAuthorizationCode(publicClientId, userAuthHeader);
-        response = requestTokenWithAuthorizationCodeAndForm(publicClientId, "", code);
+        response = requestTokenWithAuthorizationCodeAndForm(publicClientId, "",
+                code);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         node = JsonUtils.readTree(response.readEntity(String.class));
         String accessToken2 = node.at("/access_token").asText();
@@ -593,9 +720,11 @@
         assertEquals(0, node.size());
     }
 
-    private void testRefreshTokenExpiry(String refreshToken) throws KustvaktException {
+    private void testRefreshTokenExpiry (String refreshToken)
+            throws KustvaktException {
         RefreshToken token = refreshTokenDao.retrieveRefreshToken(refreshToken);
-        ZonedDateTime expiry = token.getCreatedDate().plusSeconds(config.getRefreshTokenLongExpiry());
+        ZonedDateTime expiry = token.getCreatedDate()
+                .plusSeconds(config.getRefreshTokenLongExpiry());
         assertTrue(expiry.equals(token.getExpiryDate()));
     }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2PluginTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2PluginTest.java
index 62b96f7..90597e2 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2PluginTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2PluginTest.java
@@ -45,9 +45,10 @@
 
     @Autowired
     private InstalledPluginDao pluginDao;
-    
+
     @Test
-    public void testRegisterPlugin() throws ProcessingException, KustvaktException {
+    public void testRegisterPlugin ()
+            throws ProcessingException, KustvaktException {
         JsonNode source = JsonUtils.readTree("{ \"plugin\" : \"source\"}");
         int refreshTokenExpiry = TimeUtils.convertTimeToSeconds("90D");
         String clientName = "Plugin";
@@ -71,12 +72,13 @@
         // permitted only
         node = listPlugins(true);
         assertEquals(2, node.size());
-        testListUserRegisteredPlugins(username, clientId, clientName, refreshTokenExpiry);
+        testListUserRegisteredPlugins(username, clientId, clientName,
+                refreshTokenExpiry);
         deregisterClient(username, clientId);
     }
 
     @Test
-    public void testRegisterPublicPlugin() throws KustvaktException {
+    public void testRegisterPublicPlugin () throws KustvaktException {
         JsonNode source = JsonUtils.readTree("{ \"plugin\" : \"source\"}");
         String clientName = "Public Plugin";
         OAuth2ClientJson json = new OAuth2ClientJson();
@@ -96,40 +98,50 @@
         // deregisterClient(username, clientId);
     }
 
-    private void testRetrievePluginInfo(String clientId, int refreshTokenExpiry) throws ProcessingException, KustvaktException {
+    private void testRetrievePluginInfo (String clientId,
+            int refreshTokenExpiry)
+            throws ProcessingException, KustvaktException {
         JsonNode clientInfo = retrieveClientInfo(clientId, username);
         assertEquals(clientId, clientInfo.at("/client_id").asText());
         assertEquals(clientInfo.at("/client_name").asText(), "Plugin");
-        assertEquals(OAuth2ClientType.CONFIDENTIAL.name(), clientInfo.at("/client_type").asText());
+        assertEquals(OAuth2ClientType.CONFIDENTIAL.name(),
+                clientInfo.at("/client_type").asText());
         assertNotNull(clientInfo.at("/client_description").asText());
         assertNotNull(clientInfo.at("/source").asText());
         assertFalse(clientInfo.at("/permitted").asBoolean());
         assertEquals(username, clientInfo.at("/registered_by").asText());
         assertNotNull(clientInfo.at("/registration_date"));
-        assertEquals(refreshTokenExpiry, clientInfo.at("/refresh_token_expiry").asInt());
+        assertEquals(refreshTokenExpiry,
+                clientInfo.at("/refresh_token_expiry").asInt());
     }
 
-    private void testListUserRegisteredPlugins(String username, String clientId, String clientName, int refreshTokenExpiry) throws ProcessingException, KustvaktException {
+    private void testListUserRegisteredPlugins (String username,
+            String clientId, String clientName, int refreshTokenExpiry)
+            throws ProcessingException, KustvaktException {
         JsonNode node = listUserRegisteredClients(username);
         assertEquals(1, node.size());
         assertEquals(clientId, node.at("/0/client_id").asText());
         assertEquals(clientName, node.at("/0/client_name").asText());
-        assertEquals(OAuth2ClientType.CONFIDENTIAL.name(), node.at("/0/client_type").asText());
+        assertEquals(OAuth2ClientType.CONFIDENTIAL.name(),
+                node.at("/0/client_type").asText());
         assertFalse(node.at("/0/permitted").asBoolean());
         assertFalse(node.at("/0/registration_date").isMissingNode());
         assertFalse(node.at("/0/source").isMissingNode());
-        assertEquals(refreshTokenExpiry, node.at("/0/refresh_token_expiry").asInt());
+        assertEquals(refreshTokenExpiry,
+                node.at("/0/refresh_token_expiry").asInt());
     }
 
     @Test
-    public void testListPluginsUnauthorizedPublic() throws ProcessingException, KustvaktException {
+    public void testListPluginsUnauthorizedPublic ()
+            throws ProcessingException, KustvaktException {
         Form form = new Form();
         form.param("super_client_id", publicClientId);
         testListPluginsClientUnauthorized(form);
     }
 
     @Test
-    public void testListPluginsUnauthorizedConfidential() throws ProcessingException, KustvaktException {
+    public void testListPluginsUnauthorizedConfidential ()
+            throws ProcessingException, KustvaktException {
         Form form = new Form();
         form.param("super_client_id", confidentialClientId2);
         form.param("super_client_secret", clientSecret);
@@ -137,10 +149,16 @@
     }
 
     @Test
-    public void testListPluginsMissingClientSecret() throws ProcessingException, KustvaktException {
+    public void testListPluginsMissingClientSecret ()
+            throws ProcessingException, KustvaktException {
         Form form = new Form();
         form.param("super_client_id", confidentialClientId);
-        Response response = target().path(API_VERSION).path("plugins").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED).post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("plugins").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .header(HttpHeaders.CONTENT_TYPE,
+                        ContentType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(form));
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
@@ -148,31 +166,45 @@
         assertFalse(node.at("/error_description").isMissingNode());
     }
 
-    private void testListPluginsClientUnauthorized(Form form) throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("plugins").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED).post(Entity.form(form));
+    private void testListPluginsClientUnauthorized (Form form)
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("plugins").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .header(HttpHeaders.CONTENT_TYPE,
+                        ContentType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(form));
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
-        assertEquals(OAuth2Error.UNAUTHORIZED_CLIENT, node.at("/error").asText());
+        assertEquals(OAuth2Error.UNAUTHORIZED_CLIENT,
+                node.at("/error").asText());
         assertFalse(node.at("/error_description").isMissingNode());
     }
 
     @Test
-    public void testListPluginsUserUnauthorized() throws ProcessingException, KustvaktException {
+    public void testListPluginsUserUnauthorized ()
+            throws ProcessingException, KustvaktException {
         Form form = getSuperClientForm();
-        Response response = target().path(API_VERSION).path("plugins").request().header(Attributes.AUTHORIZATION, "Bearer blahblah").header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED).post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("plugins").request()
+                .header(Attributes.AUTHORIZATION, "Bearer blahblah")
+                .header(HttpHeaders.CONTENT_TYPE,
+                        ContentType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(form));
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
-        assertEquals(StatusCodes.INVALID_ACCESS_TOKEN, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.INVALID_ACCESS_TOKEN,
+                node.at("/errors/0/0").asInt());
     }
 
     @Test
-    public void testListPluginsConcurrent() throws InterruptedException {
+    public void testListPluginsConcurrent () throws InterruptedException {
         ExecutorService executorService = Executors.newFixedThreadPool(3);
         List<Future<Void>> futures = new ArrayList<>();
         for (int i = 0; i < 3; i++) {
-            futures.add(executorService.submit(new PluginListCallable("Thread " + (i + 1))));
+            futures.add(executorService
+                    .submit(new PluginListCallable("Thread " + (i + 1))));
         }
         executorService.shutdown();
         executorService.awaitTermination(2, TimeUnit.SECONDS);
@@ -181,7 +213,8 @@
                 // This will re-throw any exceptions
                 future.get();
                 // that occurred in threads
-            } catch (ExecutionException e) {
+            }
+            catch (ExecutionException e) {
                 fail("Test failed: " + e.getCause().getMessage());
             }
         }
@@ -191,20 +224,29 @@
 
         private final String name;
 
-        public PluginListCallable(String name) {
+        public PluginListCallable (String name) {
             this.name = name;
         }
 
         @Override
-        public Void call() {
+        public Void call () {
             Form form = getSuperClientForm();
             try {
-                Response response = target().path(API_VERSION).path("plugins").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED).post(Entity.form(form));
+                Response response = target().path(API_VERSION).path("plugins")
+                        .request()
+                        .header(Attributes.AUTHORIZATION,
+                                HttpAuthorizationHandler
+                                        .createBasicAuthorizationHeaderValue(
+                                                username, "pass"))
+                        .header(HttpHeaders.CONTENT_TYPE,
+                                ContentType.APPLICATION_FORM_URLENCODED)
+                        .post(Entity.form(form));
                 assertEquals(Status.OK.getStatusCode(), response.getStatus());
                 String entity = response.readEntity(String.class);
                 JsonNode node = JsonUtils.readTree(entity);
                 assertEquals(2, node.size());
-            } catch (KustvaktException e) {
+            }
+            catch (KustvaktException e) {
                 e.printStackTrace();
                 throw new RuntimeException(name, e);
             }
@@ -213,7 +255,8 @@
     }
 
     @Test
-    public void testListAllPlugins() throws ProcessingException, KustvaktException {
+    public void testListAllPlugins ()
+            throws ProcessingException, KustvaktException {
         JsonNode node = listPlugins(false);
         assertEquals(2, node.size());
         assertFalse(node.at("/0/client_id").isMissingNode());
@@ -227,18 +270,26 @@
         // assertTrue(node.at("/1/refresh_token_expiry").isMissingNode());
     }
 
-    private JsonNode listPlugins(boolean permitted_only) throws ProcessingException, KustvaktException {
+    private JsonNode listPlugins (boolean permitted_only)
+            throws ProcessingException, KustvaktException {
         Form form = getSuperClientForm();
         if (permitted_only) {
             form.param("permitted_only", Boolean.toString(permitted_only));
         }
-        Response response = target().path(API_VERSION).path("plugins").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED).post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("plugins").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .header(HttpHeaders.CONTENT_TYPE,
+                        ContentType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(form));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         return JsonUtils.readTree(entity);
     }
 
-    private void testInstallConfidentialPlugin(String superClientId, String clientId, String username) throws ProcessingException, KustvaktException {
+    private void testInstallConfidentialPlugin (String superClientId,
+            String clientId, String username)
+            throws ProcessingException, KustvaktException {
         Form form = getSuperClientForm();
         form.param("client_id", clientId);
         Response response = installPlugin(form);
@@ -255,7 +306,8 @@
     }
 
     @Test
-    public void testInstallPublicPlugin() throws ProcessingException, KustvaktException {
+    public void testInstallPublicPlugin ()
+            throws ProcessingException, KustvaktException {
         Form form = getSuperClientForm();
         form.param("client_id", publicClientId2);
         Response response = installPlugin(form);
@@ -276,71 +328,84 @@
         assertTrue(node.isEmpty());
     }
 
-    private void testInstallPluginRedundant(Form form) throws ProcessingException, KustvaktException {
+    private void testInstallPluginRedundant (Form form)
+            throws ProcessingException, KustvaktException {
         Response response = installPlugin(form);
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.PLUGIN_HAS_BEEN_INSTALLED, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.PLUGIN_HAS_BEEN_INSTALLED,
+                node.at("/errors/0/0").asInt());
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
     }
 
-    private void testInstallPluginNotPermitted(String clientId) throws ProcessingException, KustvaktException {
+    private void testInstallPluginNotPermitted (String clientId)
+            throws ProcessingException, KustvaktException {
         Form form = getSuperClientForm();
         form.param("client_id", clientId);
         Response response = installPlugin(form);
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.PLUGIN_NOT_PERMITTED, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.PLUGIN_NOT_PERMITTED,
+                node.at("/errors/0/0").asInt());
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
     }
 
     @Test
-    public void testInstallPluginMissingClientId() throws ProcessingException, KustvaktException {
+    public void testInstallPluginMissingClientId ()
+            throws ProcessingException, KustvaktException {
         Form form = getSuperClientForm();
         Response response = installPlugin(form);
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.INVALID_ARGUMENT, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.INVALID_ARGUMENT,
+                node.at("/errors/0/0").asInt());
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
     }
 
     @Test
-    public void testInstallPluginInvalidClientId() throws ProcessingException, KustvaktException {
+    public void testInstallPluginInvalidClientId ()
+            throws ProcessingException, KustvaktException {
         Form form = getSuperClientForm();
         form.param("client_id", "unknown");
         Response response = installPlugin(form);
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(node.at("/error_description").asText(), "Unknown client: unknown");
+        assertEquals(node.at("/error_description").asText(),
+                "Unknown client: unknown");
         assertEquals(node.at("/error").asText(), "invalid_client");
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
     }
 
     @Test
-    public void testInstallPluginMissingSuperClientSecret() throws ProcessingException, KustvaktException {
+    public void testInstallPluginMissingSuperClientSecret ()
+            throws ProcessingException, KustvaktException {
         Form form = new Form();
         form.param("super_client_id", superClientId);
         Response response = installPlugin(form);
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(node.at("/error_description").asText(), "Missing parameter: super_client_secret");
+        assertEquals(node.at("/error_description").asText(),
+                "Missing parameter: super_client_secret");
         assertEquals(node.at("/error").asText(), "invalid_request");
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
     }
 
     @Test
-    public void testInstallPluginMissingSuperClientId() throws ProcessingException, KustvaktException {
+    public void testInstallPluginMissingSuperClientId ()
+            throws ProcessingException, KustvaktException {
         Form form = new Form();
         Response response = installPlugin(form);
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(node.at("/error_description").asText(), "Missing parameter: super_client_id");
+        assertEquals(node.at("/error_description").asText(),
+                "Missing parameter: super_client_id");
         assertEquals(node.at("/error").asText(), "invalid_request");
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
     }
 
     @Test
-    public void testInstallPluginUnauthorizedClient() throws ProcessingException, KustvaktException {
+    public void testInstallPluginUnauthorizedClient ()
+            throws ProcessingException, KustvaktException {
         Form form = new Form();
         form.param("super_client_id", confidentialClientId);
         form.param("super_client_secret", clientSecret);
@@ -351,18 +416,34 @@
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
     }
 
-    private Response installPlugin(Form form) throws ProcessingException, KustvaktException {
-        return target().path(API_VERSION).path("plugins").path("install").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED).post(Entity.form(form));
+    private Response installPlugin (Form form)
+            throws ProcessingException, KustvaktException {
+        return target().path(API_VERSION).path("plugins").path("install")
+                .request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .header(HttpHeaders.CONTENT_TYPE,
+                        ContentType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(form));
     }
 
-    private Response uninstallPlugin(String clientId, String username) throws ProcessingException, KustvaktException {
+    private Response uninstallPlugin (String clientId, String username)
+            throws ProcessingException, KustvaktException {
         Form form = getSuperClientForm();
         form.param("client_id", clientId);
-        return target().path(API_VERSION).path("plugins").path("uninstall").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED).post(Entity.form(form));
+        return target().path(API_VERSION).path("plugins").path("uninstall")
+                .request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .header(HttpHeaders.CONTENT_TYPE,
+                        ContentType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(form));
     }
 
-    private void testRetrieveInstalledPlugin(String superClientId, String clientId, String installedBy) throws KustvaktException {
-        InstalledPlugin plugin = pluginDao.retrieveInstalledPlugin(superClientId, clientId, installedBy);
+    private void testRetrieveInstalledPlugin (String superClientId,
+            String clientId, String installedBy) throws KustvaktException {
+        InstalledPlugin plugin = pluginDao
+                .retrieveInstalledPlugin(superClientId, clientId, installedBy);
         assertEquals(clientId, plugin.getClient().getId());
         assertEquals(superClientId, plugin.getSuperClient().getId());
         assertEquals(installedBy, plugin.getInstalledBy());
@@ -371,20 +452,24 @@
     }
 
     @Test
-    public void testListUserInstalledPlugins() throws ProcessingException, KustvaktException, IOException {
-        testInstallConfidentialPlugin(superClientId, confidentialClientId, username);
+    public void testListUserInstalledPlugins ()
+            throws ProcessingException, KustvaktException, IOException {
+        testInstallConfidentialPlugin(superClientId, confidentialClientId,
+                username);
         JsonNode node = testRequestAccessToken(confidentialClientId);
         String accessToken = node.at("/access_token").asText();
         String refreshToken = node.at("/refresh_token").asText();
         testSearchWithOAuth2Token(accessToken);
-        testInstallConfidentialPlugin(superClientId, confidentialClientId2, username);
+        testInstallConfidentialPlugin(superClientId, confidentialClientId2,
+                username);
         node = retrieveUserInstalledPlugin(getSuperClientForm());
         assertEquals(2, node.size());
         Response response = uninstallPlugin(confidentialClientId, username);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         node = retrieveUserInstalledPlugin(getSuperClientForm());
         assertEquals(1, node.size());
-        testRequestTokenWithRevokedRefreshToken(confidentialClientId, clientSecret, refreshToken);
+        testRequestTokenWithRevokedRefreshToken(confidentialClientId,
+                clientSecret, refreshToken);
         testSearchWithRevokedAccessToken(accessToken);
         response = uninstallPlugin(confidentialClientId2, username);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
@@ -394,8 +479,10 @@
         testUninstallNotInstalledPlugin();
     }
 
-    private void testReinstallUninstalledPlugin() throws ProcessingException, KustvaktException {
-        testInstallConfidentialPlugin(superClientId, confidentialClientId2, username);
+    private void testReinstallUninstalledPlugin ()
+            throws ProcessingException, KustvaktException {
+        testInstallConfidentialPlugin(superClientId, confidentialClientId2,
+                username);
         JsonNode node = retrieveUserInstalledPlugin(getSuperClientForm());
         assertEquals(1, node.size());
         Response response = uninstallPlugin(confidentialClientId2, username);
@@ -404,24 +491,36 @@
         assertEquals(0, node.size());
     }
 
-    private JsonNode testRequestAccessToken(String clientId) throws KustvaktException {
-        String userAuthHeader = HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "password");
+    private JsonNode testRequestAccessToken (String clientId)
+            throws KustvaktException {
+        String userAuthHeader = HttpAuthorizationHandler
+                .createBasicAuthorizationHeaderValue(username, "password");
         String code = requestAuthorizationCode(clientId, userAuthHeader);
-        Response response = requestTokenWithAuthorizationCodeAndForm(clientId, clientSecret, code);
+        Response response = requestTokenWithAuthorizationCodeAndForm(clientId,
+                clientSecret, code);
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         return node;
     }
 
-    private void testUninstallNotInstalledPlugin() throws ProcessingException, KustvaktException {
+    private void testUninstallNotInstalledPlugin ()
+            throws ProcessingException, KustvaktException {
         Response response = uninstallPlugin(confidentialClientId2, username);
         assertEquals(Status.NOT_FOUND.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
-        assertEquals(StatusCodes.NO_RESOURCE_FOUND, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.NO_RESOURCE_FOUND,
+                node.at("/errors/0/0").asInt());
     }
 
-    private JsonNode retrieveUserInstalledPlugin(Form form) throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("plugins").path("installed").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED).post(Entity.form(form));
+    private JsonNode retrieveUserInstalledPlugin (Form form)
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("plugins")
+                .path("installed").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .header(HttpHeaders.CONTENT_TYPE,
+                        ContentType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(form));
         String entity = response.readEntity(String.class);
         return JsonUtils.readTree(entity);
     }
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2RClientTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2RClientTest.java
index 30bb832..d0eab61 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2RClientTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2RClientTest.java
@@ -26,11 +26,12 @@
 
     private String userAuthHeader;
 
-    public OAuth2RClientTest() throws KustvaktException {
-        userAuthHeader = HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("R-user", "password");
+    public OAuth2RClientTest () throws KustvaktException {
+        userAuthHeader = HttpAuthorizationHandler
+                .createBasicAuthorizationHeaderValue("R-user", "password");
     }
 
-    public OAuth2ClientJson createOAuth2RClient() {
+    public OAuth2ClientJson createOAuth2RClient () {
         OAuth2ClientJson client = new OAuth2ClientJson();
         client.setName("R client");
         client.setType(OAuth2ClientType.PUBLIC);
@@ -40,7 +41,8 @@
     }
 
     @Test
-    public void testRClientWithLocalhost() throws ProcessingException, KustvaktException, IOException {
+    public void testRClientWithLocalhost ()
+            throws ProcessingException, KustvaktException, IOException {
         // Register client
         OAuth2ClientJson clientJson = createOAuth2RClient();
         Response response = registerClient(username, clientJson);
@@ -50,7 +52,8 @@
         // send authorization
         String code = testAuthorize(clientId);
         // send token request
-        response = requestTokenWithAuthorizationCodeAndForm(clientId, null, code);
+        response = requestTokenWithAuthorizationCodeAndForm(clientId, null,
+                code);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         node = JsonUtils.readTree(entity);
@@ -62,14 +65,17 @@
         testSearchWithRevokedAccessToken(accessToken);
     }
 
-    private String testAuthorize(String clientId) throws KustvaktException {
-        Response response = requestAuthorizationCode("code", clientId, "", "search", "", userAuthHeader);
-        assertEquals(Status.TEMPORARY_REDIRECT.getStatusCode(), response.getStatus());
+    private String testAuthorize (String clientId) throws KustvaktException {
+        Response response = requestAuthorizationCode("code", clientId, "",
+                "search", "", userAuthHeader);
+        assertEquals(Status.TEMPORARY_REDIRECT.getStatusCode(),
+                response.getStatus());
         URI redirectUri = response.getLocation();
         assertEquals(redirectUri.getScheme(), "http");
         assertEquals(redirectUri.getHost(), "localhost");
         assertEquals(1410, redirectUri.getPort());
-        MultiValueMap<String, String> params = UriComponentsBuilder.fromUri(redirectUri).build().getQueryParams();
+        MultiValueMap<String, String> params = UriComponentsBuilder
+                .fromUri(redirectUri).build().getQueryParams();
         String code = params.getFirst("code");
         assertNotNull(code);
         return code;
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2TestBase.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2TestBase.java
index 0b94e02..b27fd0f 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2TestBase.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2TestBase.java
@@ -80,8 +80,9 @@
     public static String ACCESS_TOKEN_TYPE = "access_token";
     public static String REFRESH_TOKEN_TYPE = "refresh_token";
 
-    protected int defaultRefreshTokenExpiry = TimeUtils.convertTimeToSeconds("365D");
-    
+    protected int defaultRefreshTokenExpiry = TimeUtils
+            .convertTimeToSeconds("365D");
+
     protected String clientURL = "http://example.client.com";
     protected String clientRedirectUri = "https://example.client.com/redirect";
 
@@ -97,7 +98,7 @@
     }
 
     protected String parseAuthorizationCode (Response response) {
-        
+
         assertEquals(Status.TEMPORARY_REDIRECT.getStatusCode(),
                 response.getStatus());
 
@@ -106,7 +107,7 @@
                 .fromUri(redirectUri).build().getQueryParams();
         return params.getFirst("code");
     }
-    
+
     protected Response requestAuthorizationCode (String responseType,
             String clientId, String redirectUri, String scope, String state,
             String authHeader) throws KustvaktException {
@@ -114,7 +115,7 @@
         ClientConfig clientConfig = new ClientConfig();
         clientConfig.property(ClientProperties.FOLLOW_REDIRECTS, false);
         Client client = ClientBuilder.newClient(clientConfig);
-        
+
         WebTarget request = client.target(getBaseUri()).path(API_VERSION)
                 .path("oauth2").path("authorize");
 
@@ -133,9 +134,10 @@
         if (!state.isEmpty()) {
             request = request.queryParam("state", state);
         }
-        
-        Builder builder = request.request().header(Attributes.AUTHORIZATION, authHeader);
-        
+
+        Builder builder = request.request().header(Attributes.AUTHORIZATION,
+                authHeader);
+
         return builder.get();
     }
 
@@ -166,14 +168,12 @@
         return params.getFirst("code");
     }
 
-    protected Response requestToken (Form form)
-            throws KustvaktException {
-        return target().path(API_VERSION).path("oauth2").path("token")
-                .request()
+    protected Response requestToken (Form form) throws KustvaktException {
+        return target().path(API_VERSION).path("oauth2").path("token").request()
                 .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
                 .header(HttpHeaders.CONTENT_TYPE,
                         ContentType.APPLICATION_FORM_URLENCODED)
-               .post(Entity.form(form));
+                .post(Entity.form(form));
     }
 
     // client credentials as form params
@@ -187,8 +187,7 @@
         form.param("client_secret", clientSecret);
         form.param("code", code);
 
-        return target().path(API_VERSION).path("oauth2").path("token")
-                .request()
+        return target().path(API_VERSION).path("oauth2").path("token").request()
                 .header(HttpHeaders.CONTENT_TYPE,
                         ContentType.APPLICATION_FORM_URLENCODED)
                 .post(Entity.form(form));
@@ -207,8 +206,7 @@
             form.param("redirect_uri", redirectUri);
         }
 
-        return target().path(API_VERSION).path("oauth2").path("token")
-                .request()
+        return target().path(API_VERSION).path("oauth2").path("token").request()
                 .header(HttpHeaders.CONTENT_TYPE,
                         ContentType.APPLICATION_FORM_URLENCODED)
                 .post(Entity.form(form));
@@ -224,15 +222,14 @@
         form.param("code", code);
 
         Response response = target().path(API_VERSION).path("oauth2")
-                .path("token")
-                .request()
+                .path("token").request()
                 .header(Attributes.AUTHORIZATION, authHeader)
                 .header(HttpHeaders.CONTENT_TYPE,
                         ContentType.APPLICATION_FORM_URLENCODED)
                 .post(Entity.form(form));
 
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
-        
+
         String entity = response.readEntity(String.class);
         return JsonUtils.readTree(entity);
     }
@@ -249,7 +246,7 @@
         Form form = new Form();
         form.param("grant_type", "password");
         form.param("client_id", clientId);
-        if (clientSecret !=null && !clientSecret.isEmpty()) {
+        if (clientSecret != null && !clientSecret.isEmpty()) {
             form.param("client_secret", clientSecret);
         }
         form.param("username", username);
@@ -269,27 +266,25 @@
             form.param("client_secret", clientSecret);
         }
 
-        Response response =
-                target().path(API_VERSION).path("oauth2").path("token")
-                        .request()
-                        .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
-                        .header(HttpHeaders.CONTENT_TYPE,
-                                ContentType.APPLICATION_FORM_URLENCODED)
-                        .post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("oauth2")
+                .path("token").request()
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(HttpHeaders.CONTENT_TYPE,
+                        ContentType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(form));
 
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(OAuth2Error.INVALID_GRANT.getCode(), node.at("/error").asText());
+        assertEquals(OAuth2Error.INVALID_GRANT.getCode(),
+                node.at("/error").asText());
         assertEquals("Refresh token has been revoked",
                 node.at("/error_description").asText());
     }
 
-    protected Response registerClient (String username,
-            OAuth2ClientJson json) throws
-            ProcessingException, KustvaktException {
+    protected Response registerClient (String username, OAuth2ClientJson json)
+            throws ProcessingException, KustvaktException {
         return target().path(API_VERSION).path("oauth2").path("client")
-                .path("register")
-                .request()
+                .path("register").request()
                 .header(Attributes.AUTHORIZATION,
                         HttpAuthorizationHandler
                                 .createBasicAuthorizationHeaderValue(username,
@@ -313,11 +308,11 @@
     }
 
     protected void testConfidentialClientInfo (String clientId, String username)
-            throws ProcessingException,
-            KustvaktException {
+            throws ProcessingException, KustvaktException {
         JsonNode clientInfo = retrieveClientInfo(clientId, username);
         assertEquals(clientId, clientInfo.at("/client_id").asText());
-        assertEquals("OAuth2ClientTest", clientInfo.at("/client_name").asText());
+        assertEquals("OAuth2ClientTest",
+                clientInfo.at("/client_name").asText());
         assertEquals(OAuth2ClientType.CONFIDENTIAL.name(),
                 clientInfo.at("/client_type").asText());
         assertEquals(username, clientInfo.at("/registered_by").asText());
@@ -334,13 +329,11 @@
 
     }
 
-    protected void deregisterClient (String username,
-            String clientId) throws
-            ProcessingException, KustvaktException {
+    protected void deregisterClient (String username, String clientId)
+            throws ProcessingException, KustvaktException {
 
         Response response = target().path(API_VERSION).path("oauth2")
-                .path("client").path("deregister").path(clientId)
-                .request()
+                .path("client").path("deregister").path(clientId).request()
                 .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
                         .createBasicAuthorizationHeaderValue(username, "pass"))
                 .delete();
@@ -349,17 +342,15 @@
     }
 
     protected JsonNode retrieveClientInfo (String clientId, String username)
-            throws ProcessingException,
-            KustvaktException {
+            throws ProcessingException, KustvaktException {
         Form form = new Form();
         form.param("super_client_id", superClientId);
         form.param("super_client_secret", clientSecret);
-        
+
         Response response = target().path(API_VERSION).path("oauth2")
-                .path("client").path(clientId)
-                .request()
-//                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
-//                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .path("client").path(clientId).request()
+                //                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                //                        .createBasicAuthorizationHeaderValue(username, "pass"))
                 .header(HttpHeaders.CONTENT_TYPE,
                         ContentType.APPLICATION_FORM_URLENCODED)
                 .post(Entity.form(form));
@@ -375,27 +366,24 @@
                 .queryParam("q", "Wasser").queryParam("ql", "poliqarp")
                 .request()
                 .header(Attributes.AUTHORIZATION, "Bearer " + accessToken)
-                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
-                .get();
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
     }
-    
+
     protected void testSearchWithOAuth2Token (String accessToken)
             throws KustvaktException, IOException {
         Response response = searchWithAccessToken(accessToken);
         String entity = response.readEntity(String.class);
-        assertEquals(Status.OK.getStatusCode(),
-                response.getStatus());
+        assertEquals(Status.OK.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(entity);
         assertNotNull(node);
         assertEquals(25, node.at("/matches").size());
     }
-    
+
     protected void testSearchWithRevokedAccessToken (String accessToken)
             throws KustvaktException {
         Response response = searchWithAccessToken(accessToken);
         String entity = response.readEntity(String.class);
-        assertEquals(Status.UNAUTHORIZED.getStatusCode(),
-                response.getStatus());
+        assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
 
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(StatusCodes.INVALID_ACCESS_TOKEN,
@@ -404,7 +392,6 @@
                 node.at("/errors/0/1").asText());
     }
 
-
     protected void testRevokeTokenViaSuperClient (String token,
             String userAuthHeader) {
         Form form = new Form();
@@ -413,8 +400,7 @@
         form.param("super_client_secret", clientSecret);
 
         Response response = target().path(API_VERSION).path("oauth2")
-                .path("revoke").path("super")
-                .request()
+                .path("revoke").path("super").request()
                 .header(HttpHeaders.CONTENT_TYPE,
                         ContentType.APPLICATION_FORM_URLENCODED)
                 .header(Attributes.AUTHORIZATION, userAuthHeader)
@@ -434,24 +420,21 @@
             form.param("client_secret", clientSecret);
         }
 
-        Response response =
-                target().path(API_VERSION).path("oauth2").path("revoke")
-                        .request()
-                        .header(HttpHeaders.CONTENT_TYPE,
-                                ContentType.APPLICATION_FORM_URLENCODED)
-                        .post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("oauth2")
+                .path("revoke").request()
+                .header(HttpHeaders.CONTENT_TYPE,
+                        ContentType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(form));
 
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         assertEquals("SUCCESS", response.readEntity(String.class));
     }
 
     protected JsonNode listUserRegisteredClients (String username)
-            throws ProcessingException,
-            KustvaktException {
+            throws ProcessingException, KustvaktException {
         Form form = getSuperClientForm();
         Response response = target().path(API_VERSION).path("oauth2")
-                .path("client").path("list")
-                .request()
+                .path("client").path("list").request()
                 .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
                         .createBasicAuthorizationHeaderValue(username, "pwd"))
                 .header(HttpHeaders.CONTENT_TYPE,
@@ -463,7 +446,7 @@
         String entity = response.readEntity(String.class);
         return JsonUtils.readTree(entity);
     }
-    
+
     protected void testInvalidRedirectUri (String entity, String contentType,
             boolean includeState, int status) throws KustvaktException {
         JsonNode node = JsonUtils.readTree(entity);
@@ -478,18 +461,18 @@
         assertEquals("application/json;charset=utf-8", contentType);
         assertEquals(Status.BAD_REQUEST.getStatusCode(), status);
     }
-    
+
     protected String createExpiredAccessToken () throws KustvaktException {
         String authToken = codeGenerator.createRandomCode();
-        
+
         // create new access token
         OAuth2Client client = clientDao.retrieveClientById(publicClientId);
 
-        ZonedDateTime now =
-                ZonedDateTime.now(ZoneId.of(Attributes.DEFAULT_TIME_ZONE));
+        ZonedDateTime now = ZonedDateTime
+                .now(ZoneId.of(Attributes.DEFAULT_TIME_ZONE));
         Set<AccessScope> scopes = new HashSet<>();
         scopes.add(new AccessScope(OAuth2Scope.EDIT_VC));
-        
+
         AccessToken accessToken = new AccessToken();
         accessToken.setCreatedDate(now.minusSeconds(5));
         accessToken.setExpiryDate(now.minusSeconds(3));
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/QueryReferenceControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/QueryReferenceControllerTest.java
index 89e2cb5..57dc847 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/QueryReferenceControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/QueryReferenceControllerTest.java
@@ -28,8 +28,14 @@
 
     private String system = "system";
 
-    private void testRetrieveQueryByName(String qName, String query, String queryCreator, String username, ResourceType resourceType, CorpusAccess access) throws KustvaktException {
-        Response response = target().path(API_VERSION).path("query").path("~" + queryCreator).path(qName).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).get();
+    private void testRetrieveQueryByName (String qName, String query,
+            String queryCreator, String username, ResourceType resourceType,
+            CorpusAccess access) throws KustvaktException {
+        Response response = target().path(API_VERSION).path("query")
+                .path("~" + queryCreator).path(qName).request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .get();
         String entity = response.readEntity(String.class);
         // System.out.println(entity);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
@@ -42,173 +48,283 @@
         assertEquals(access.name(), node.at("/requiredAccess").asText());
     }
 
-    private void testUpdateQuery(String qName, String qCreator, String username, ResourceType type) throws ProcessingException, KustvaktException {
-        String json = "{\"query\": \"Sonne\"" + ",\"queryLanguage\": \"poliqarp\"}";
-        Response response = target().path(API_VERSION).path("query").path("~" + qCreator).path(qName).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).put(Entity.json(json));
+    private void testUpdateQuery (String qName, String qCreator,
+            String username, ResourceType type)
+            throws ProcessingException, KustvaktException {
+        String json = "{\"query\": \"Sonne\""
+                + ",\"queryLanguage\": \"poliqarp\"}";
+        Response response = target().path(API_VERSION).path("query")
+                .path("~" + qCreator).path(qName).request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .put(Entity.json(json));
         assertEquals(Status.NO_CONTENT.getStatusCode(), response.getStatus());
-        testRetrieveQueryByName(qName, "Sonne", qCreator, username, type, CorpusAccess.PUB);
+        testRetrieveQueryByName(qName, "Sonne", qCreator, username, type,
+                CorpusAccess.PUB);
     }
 
     @Test
-    public void testCreatePrivateQuery() throws KustvaktException {
-        String json = "{\"type\": \"PRIVATE\"" + ",\"queryType\": \"QUERY\"" + ",\"queryLanguage\": \"poliqarp\"" + ",\"query\": \"der\"}";
+    public void testCreatePrivateQuery () throws KustvaktException {
+        String json = "{\"type\": \"PRIVATE\"" + ",\"queryType\": \"QUERY\""
+                + ",\"queryLanguage\": \"poliqarp\"" + ",\"query\": \"der\"}";
         String qName = "new_query";
-        Response response = target().path(API_VERSION).path("query").path("~" + testUser).path(qName).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(testUser, "pass")).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).put(Entity.json(json));
+        Response response = target().path(API_VERSION).path("query")
+                .path("~" + testUser).path(qName).request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(testUser, "pass"))
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .put(Entity.json(json));
         assertEquals(Status.CREATED.getStatusCode(), response.getStatus());
-        testRetrieveQueryByName(qName, "der", testUser, testUser, ResourceType.PRIVATE, CorpusAccess.PUB);
+        testRetrieveQueryByName(qName, "der", testUser, testUser,
+                ResourceType.PRIVATE, CorpusAccess.PUB);
         testUpdateQuery(qName, testUser, testUser, ResourceType.PRIVATE);
         testDeleteQueryByName(qName, testUser, testUser);
     }
 
     @Test
-    public void testCreatePublishQuery() throws KustvaktException {
-        String json = "{\"type\": \"PUBLISHED\"" + ",\"queryType\": \"QUERY\"" + ",\"queryLanguage\": \"poliqarp\"" + ",\"query\": \"Regen\"}";
+    public void testCreatePublishQuery () throws KustvaktException {
+        String json = "{\"type\": \"PUBLISHED\"" + ",\"queryType\": \"QUERY\""
+                + ",\"queryLanguage\": \"poliqarp\"" + ",\"query\": \"Regen\"}";
         String qName = "publish_query";
-        Response response = target().path(API_VERSION).path("query").path("~" + testUser).path(qName).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(testUser, "pass")).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).put(Entity.json(json));
+        Response response = target().path(API_VERSION).path("query")
+                .path("~" + testUser).path(qName).request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(testUser, "pass"))
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .put(Entity.json(json));
         assertEquals(Status.CREATED.getStatusCode(), response.getStatus());
-        testRetrieveQueryByName(qName, "Regen", testUser, testUser, ResourceType.PUBLISHED, CorpusAccess.PUB);
+        testRetrieveQueryByName(qName, "Regen", testUser, testUser,
+                ResourceType.PUBLISHED, CorpusAccess.PUB);
         testDeleteQueryByName(qName, testUser, testUser);
         // check if hidden group has been created
     }
 
     @Test
-    public void testCreateUserQueryByAdmin() throws KustvaktException {
-        String json = "{\"type\": \"PRIVATE\"" + ",\"queryType\": \"QUERY\"" + ",\"queryLanguage\": \"poliqarp\"" + ",\"query\": \"Sommer\"}";
+    public void testCreateUserQueryByAdmin () throws KustvaktException {
+        String json = "{\"type\": \"PRIVATE\"" + ",\"queryType\": \"QUERY\""
+                + ",\"queryLanguage\": \"poliqarp\""
+                + ",\"query\": \"Sommer\"}";
         String qName = "marlin-query";
-        Response response = target().path(API_VERSION).path("query").path("~marlin").path(qName).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(adminUser, "pass")).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).put(Entity.json(json));
+        Response response = target().path(API_VERSION).path("query")
+                .path("~marlin").path(qName).request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(adminUser, "pass"))
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .put(Entity.json(json));
         assertEquals(Status.CREATED.getStatusCode(), response.getStatus());
-        testRetrieveQueryByName(qName, "Sommer", "marlin", adminUser, ResourceType.PRIVATE, CorpusAccess.PUB);
+        testRetrieveQueryByName(qName, "Sommer", "marlin", adminUser,
+                ResourceType.PRIVATE, CorpusAccess.PUB);
         testUpdateQuery(qName, "marlin", adminUser, ResourceType.PRIVATE);
         testDeleteQueryByName(qName, "marlin", adminUser);
     }
 
     @Test
-    public void testCreateSystemQuery() throws KustvaktException {
-        String json = "{\"type\": \"SYSTEM\"" + ",\"queryType\": \"QUERY\"" + ",\"queryLanguage\": \"poliqarp\"" + ",\"query\": \"Sommer\"}";
+    public void testCreateSystemQuery () throws KustvaktException {
+        String json = "{\"type\": \"SYSTEM\"" + ",\"queryType\": \"QUERY\""
+                + ",\"queryLanguage\": \"poliqarp\""
+                + ",\"query\": \"Sommer\"}";
         String qName = "system-query";
-        Response response = target().path(API_VERSION).path("query").path("~system").path(qName).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(adminUser, "pass")).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).put(Entity.json(json));
+        Response response = target().path(API_VERSION).path("query")
+                .path("~system").path(qName).request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(adminUser, "pass"))
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .put(Entity.json(json));
         assertEquals(Status.CREATED.getStatusCode(), response.getStatus());
-        testRetrieveQueryByName(qName, "Sommer", system, adminUser, ResourceType.SYSTEM, CorpusAccess.PUB);
+        testRetrieveQueryByName(qName, "Sommer", system, adminUser,
+                ResourceType.SYSTEM, CorpusAccess.PUB);
         testUpdateQuery(qName, system, adminUser, ResourceType.SYSTEM);
         testDeleteSystemQueryUnauthorized(qName);
         testDeleteQueryByName(qName, system, adminUser);
     }
 
     @Test
-    public void testCreateSystemQueryUnauthorized() throws KustvaktException {
-        String json = "{\"type\": \"SYSTEM\"" + ",\"queryType\": \"QUERY\"" + ",\"queryLanguage\": \"poliqarp\"" + ",\"query\": \"Sommer\"}";
-        Response response = target().path(API_VERSION).path("query").path("~" + testUser).path("system-query").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(testUser, "pass")).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).put(Entity.json(json));
+    public void testCreateSystemQueryUnauthorized () throws KustvaktException {
+        String json = "{\"type\": \"SYSTEM\"" + ",\"queryType\": \"QUERY\""
+                + ",\"queryLanguage\": \"poliqarp\""
+                + ",\"query\": \"Sommer\"}";
+        Response response = target().path(API_VERSION).path("query")
+                .path("~" + testUser).path("system-query").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(testUser, "pass"))
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .put(Entity.json(json));
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.AUTHORIZATION_FAILED, node.at("/errors/0/0").asInt());
-        assertEquals("Unauthorized operation for user: " + testUser, node.at("/errors/0/1").asText());
+        assertEquals(StatusCodes.AUTHORIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
+        assertEquals("Unauthorized operation for user: " + testUser,
+                node.at("/errors/0/1").asText());
     }
 
     @Test
-    public void testCreateQueryMissingQueryType() throws KustvaktException {
-        String json = "{\"type\": \"PRIVATE\"" + ",\"queryLanguage\": \"poliqarp\"" + ",\"query\": \"Sohn\"}";
+    public void testCreateQueryMissingQueryType () throws KustvaktException {
+        String json = "{\"type\": \"PRIVATE\""
+                + ",\"queryLanguage\": \"poliqarp\"" + ",\"query\": \"Sohn\"}";
         String qName = "new_query";
-        Response response = target().path(API_VERSION).path("query").path("~" + testUser).path(qName).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(testUser, "pass")).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).put(Entity.json(json));
+        Response response = target().path(API_VERSION).path("query")
+                .path("~" + testUser).path(qName).request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(testUser, "pass"))
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .put(Entity.json(json));
         assertEquals(Status.CREATED.getStatusCode(), response.getStatus());
-        testRetrieveQueryByName(qName, "Sohn", testUser, testUser, ResourceType.PRIVATE, CorpusAccess.PUB);
+        testRetrieveQueryByName(qName, "Sohn", testUser, testUser,
+                ResourceType.PRIVATE, CorpusAccess.PUB);
         testDeleteQueryByName(qName, testUser, testUser);
     }
 
     @Test
-    public void testCreateQueryMissingQueryLanguage() throws KustvaktException {
-        String json = "{\"type\": \"PRIVATE\"" + ",\"queryType\": \"QUERY\"" + ",\"query\": \"Sohn\"}";
+    public void testCreateQueryMissingQueryLanguage ()
+            throws KustvaktException {
+        String json = "{\"type\": \"PRIVATE\"" + ",\"queryType\": \"QUERY\""
+                + ",\"query\": \"Sohn\"}";
         String qName = "new_query";
-        Response response = target().path(API_VERSION).path("query").path("~" + testUser).path(qName).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(testUser, "pass")).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).put(Entity.json(json));
+        Response response = target().path(API_VERSION).path("query")
+                .path("~" + testUser).path(qName).request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(testUser, "pass"))
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .put(Entity.json(json));
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.INVALID_ARGUMENT, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.INVALID_ARGUMENT,
+                node.at("/errors/0/0").asInt());
         assertEquals(node.at("/errors/0/1").asText(), "queryLanguage is null");
         assertEquals(node.at("/errors/0/2").asText(), "queryLanguage");
     }
 
     @Test
-    public void testCreateQueryMissingQuery() throws KustvaktException {
-        String json = "{\"type\": \"PRIVATE\"" + ",\"queryType\": \"QUERY\"" + ",\"queryLanguage\": \"poliqarp\"}";
+    public void testCreateQueryMissingQuery () throws KustvaktException {
+        String json = "{\"type\": \"PRIVATE\"" + ",\"queryType\": \"QUERY\""
+                + ",\"queryLanguage\": \"poliqarp\"}";
         String qName = "new_query";
-        Response response = target().path(API_VERSION).path("query").path("~" + testUser).path(qName).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(testUser, "pass")).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).put(Entity.json(json));
+        Response response = target().path(API_VERSION).path("query")
+                .path("~" + testUser).path(qName).request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(testUser, "pass"))
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .put(Entity.json(json));
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.INVALID_ARGUMENT, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.INVALID_ARGUMENT,
+                node.at("/errors/0/0").asInt());
         assertEquals(node.at("/errors/0/1").asText(), "query is null");
         assertEquals(node.at("/errors/0/2").asText(), "query");
     }
 
     @Test
-    public void testCreateQueryMissingResourceType() throws KustvaktException {
-        String json = "{\"query\": \"Wind\"" + ",\"queryLanguage\": \"poliqarp\"}";
+    public void testCreateQueryMissingResourceType () throws KustvaktException {
+        String json = "{\"query\": \"Wind\""
+                + ",\"queryLanguage\": \"poliqarp\"}";
         String qName = "new_query";
-        Response response = target().path(API_VERSION).path("query").path("~" + testUser).path(qName).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(testUser, "pass")).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).put(Entity.json(json));
+        Response response = target().path(API_VERSION).path("query")
+                .path("~" + testUser).path(qName).request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(testUser, "pass"))
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .put(Entity.json(json));
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.INVALID_ARGUMENT, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.INVALID_ARGUMENT,
+                node.at("/errors/0/0").asInt());
         assertEquals(node.at("/errors/0/1").asText(), "type is null");
         assertEquals(node.at("/errors/0/2").asText(), "type");
     }
 
-    private void testDeleteQueryByName(String qName, String qCreator, String username) throws KustvaktException {
-        Response response = target().path(API_VERSION).path("query").path("~" + qCreator).path(qName).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).delete();
+    private void testDeleteQueryByName (String qName, String qCreator,
+            String username) throws KustvaktException {
+        Response response = target().path(API_VERSION).path("query")
+                .path("~" + qCreator).path(qName).request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .delete();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
     }
 
     @Test
-    public void testDeleteQueryUnauthorized() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("query").path("~dory").path("dory-q").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(testUser, "pass")).delete();
+    public void testDeleteQueryUnauthorized () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("query")
+                .path("~dory").path("dory-q").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(testUser, "pass"))
+                .delete();
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
-        assertEquals(StatusCodes.AUTHORIZATION_FAILED, node.at("/errors/0/0").asInt());
-        assertEquals("Unauthorized operation for user: " + testUser, node.at("/errors/0/1").asText());
+        assertEquals(StatusCodes.AUTHORIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
+        assertEquals("Unauthorized operation for user: " + testUser,
+                node.at("/errors/0/1").asText());
     }
 
-    private void testDeleteSystemQueryUnauthorized(String qName) throws KustvaktException {
-        Response response = target().path(API_VERSION).path("query").path("~system").path(qName).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(testUser, "pass")).delete();
+    private void testDeleteSystemQueryUnauthorized (String qName)
+            throws KustvaktException {
+        Response response = target().path(API_VERSION).path("query")
+                .path("~system").path(qName).request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(testUser, "pass"))
+                .delete();
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
-        assertEquals(StatusCodes.AUTHORIZATION_FAILED, node.at("/errors/0/0").asInt());
-        assertEquals("Unauthorized operation for user: " + testUser, node.at("/errors/0/1").asText());
+        assertEquals(StatusCodes.AUTHORIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
+        assertEquals("Unauthorized operation for user: " + testUser,
+                node.at("/errors/0/1").asText());
     }
 
     @Test
-    public void testDeleteNonExistingQuery() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("query").path("~dory").path("non-existing-query").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("dory", "pass")).delete();
+    public void testDeleteNonExistingQuery () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("query")
+                .path("~dory").path("non-existing-query").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("dory", "pass"))
+                .delete();
         assertEquals(Status.NOT_FOUND.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.NO_RESOURCE_FOUND, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "Query dory/non-existing-query is not found.");
-        assertEquals(node.at("/errors/0/2").asText(), "dory/non-existing-query");
+        assertEquals(StatusCodes.NO_RESOURCE_FOUND,
+                node.at("/errors/0/0").asInt());
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Query dory/non-existing-query is not found.");
+        assertEquals(node.at("/errors/0/2").asText(),
+                "dory/non-existing-query");
     }
 
     @Test
-    public void testListAvailableQueryForDory() throws ProcessingException, KustvaktException {
+    public void testListAvailableQueryForDory ()
+            throws ProcessingException, KustvaktException {
         JsonNode node = testListAvailableQuery("dory");
         assertEquals(2, node.size());
     }
 
     @Test
-    public void testListAvailableQueryForPearl() throws ProcessingException, KustvaktException {
+    public void testListAvailableQueryForPearl ()
+            throws ProcessingException, KustvaktException {
         JsonNode node = testListAvailableQuery("pearl");
         assertEquals(1, node.size());
         assertEquals(node.at("/0/name").asText(), "system-q");
-        assertEquals(ResourceType.SYSTEM.displayName(), node.at("/0/type").asText());
+        assertEquals(ResourceType.SYSTEM.displayName(),
+                node.at("/0/type").asText());
         assertEquals(node.at("/0/description").asText(), "\"system\" query");
         assertEquals(node.at("/0/query").asText(), "[]");
-        assertEquals(CorpusAccess.FREE.name(), node.at("/0/requiredAccess").asText());
+        assertEquals(CorpusAccess.FREE.name(),
+                node.at("/0/requiredAccess").asText());
         // assertEquals("koral:token", node.at("/0/koralQuery/@type").asText());
     }
 
-    private JsonNode testListAvailableQuery(String username) throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("query").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
+    private JsonNode testListAvailableQuery (String username)
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("query").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         // System.out.println(entity);
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/QueryReferenceSearchTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/QueryReferenceSearchTest.java
index e709d1b..27f3567 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/QueryReferenceSearchTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/QueryReferenceSearchTest.java
@@ -28,10 +28,10 @@
                 .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
                 .queryParam("cq", "referTo \"dory/dory-q\"")
                 .get();
-
+    
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         assertTrue(node.at("/matches").size() > 0);
     }
-*/
+    */
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/QuerySerializationControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/QuerySerializationControllerTest.java
index b1d8add..5c70f57 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/QuerySerializationControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/QuerySerializationControllerTest.java
@@ -25,8 +25,12 @@
 public class QuerySerializationControllerTest extends SpringJerseyTest {
 
     @Test
-    public void testQuerySerializationFilteredPublic() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("corpus/WPD13/query").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("context", "base/s:s").request().method("GET");
+    public void testQuerySerializationFilteredPublic ()
+            throws KustvaktException {
+        Response response = target().path(API_VERSION)
+                .path("corpus/WPD13/query").queryParam("q", "[orth=der]")
+                .queryParam("ql", "poliqarp").queryParam("context", "base/s:s")
+                .request().method("GET");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
@@ -36,28 +40,46 @@
     }
 
     @Test
-    public void testQuerySerializationUnexistingResource() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("corpus/ZUW19/query").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("context", "base/s:s").request().method("GET");
+    public void testQuerySerializationUnexistingResource ()
+            throws KustvaktException {
+        Response response = target().path(API_VERSION)
+                .path("corpus/ZUW19/query").queryParam("q", "[orth=der]")
+                .queryParam("ql", "poliqarp").queryParam("context", "base/s:s")
+                .request().method("GET");
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         assertEquals(101, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/2").asText(), "[Cannot found public Corpus with ids: [ZUW19]]");
+        assertEquals(node.at("/errors/0/2").asText(),
+                "[Cannot found public Corpus with ids: [ZUW19]]");
     }
 
     @Test
-    public void testQuerySerializationWithNonPublicCorpus() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("corpus/BRZ10/query").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("context", "base/s:s").request().method("GET");
+    public void testQuerySerializationWithNonPublicCorpus ()
+            throws KustvaktException {
+        Response response = target().path(API_VERSION)
+                .path("corpus/BRZ10/query").queryParam("q", "[orth=der]")
+                .queryParam("ql", "poliqarp").queryParam("context", "base/s:s")
+                .request().method("GET");
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         assertEquals(101, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/2").asText(), "[Cannot found public Corpus with ids: [BRZ10]]");
+        assertEquals(node.at("/errors/0/2").asText(),
+                "[Cannot found public Corpus with ids: [BRZ10]]");
     }
 
     @Test
-    public void testQuerySerializationWithAuthentication() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("corpus/BRZ10/query").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("kustvakt", "kustvakt2015")).method("GET");
+    public void testQuerySerializationWithAuthentication ()
+            throws KustvaktException {
+        Response response = target().path(API_VERSION)
+                .path("corpus/BRZ10/query").queryParam("q", "[orth=der]")
+                .queryParam("ql", "poliqarp").request()
+                .header(Attributes.AUTHORIZATION,
+                        HttpAuthorizationHandler
+                                .createBasicAuthorizationHeaderValue("kustvakt",
+                                        "kustvakt2015"))
+                .method("GET");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
@@ -68,9 +90,21 @@
     }
 
     @Test
-    public void testQuerySerializationWithNewCollection() throws KustvaktException {
+    public void testQuerySerializationWithNewCollection ()
+            throws KustvaktException {
         // Add Virtual Collection
-        Response response = target().path(API_VERSION).path("virtualcollection").queryParam("filter", "false").queryParam("query", "creationDate since 1775 & corpusSigle=GOE").queryParam("name", "Weimarer Werke").queryParam("description", "Goethe-Werke in Weimar (seit 1775)").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("kustvakt", "kustvakt2015")).post(Entity.json(""));
+        Response response = target().path(API_VERSION).path("virtualcollection")
+                .queryParam("filter", "false")
+                .queryParam("query",
+                        "creationDate since 1775 & corpusSigle=GOE")
+                .queryParam("name", "Weimarer Werke")
+                .queryParam("description", "Goethe-Werke in Weimar (seit 1775)")
+                .request()
+                .header(Attributes.AUTHORIZATION,
+                        HttpAuthorizationHandler
+                                .createBasicAuthorizationHeaderValue("kustvakt",
+                                        "kustvakt2015"))
+                .post(Entity.json(""));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
@@ -78,7 +112,12 @@
         assertTrue(node.isObject());
         assertEquals(node.path("name").asText(), "Weimarer Werke");
         // Get virtual collections
-        response = target().path(API_VERSION).path("collection").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("kustvakt", "kustvakt2015")).get();
+        response = target().path(API_VERSION).path("collection").request()
+                .header(Attributes.AUTHORIZATION,
+                        HttpAuthorizationHandler
+                                .createBasicAuthorizationHeaderValue("kustvakt",
+                                        "kustvakt2015"))
+                .get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         ent = response.readEntity(String.class);
         node = JsonUtils.readTree(ent);
@@ -93,42 +132,70 @@
         assertNotNull(id);
         assertFalse(id.isEmpty());
         // query serialization service
-        response = target().path(API_VERSION).path("collection").path(id).path("query").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("context", "base/s:s").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("kustvakt", "kustvakt2015")).method("GET");
+        response = target().path(API_VERSION).path("collection").path(id)
+                .path("query").queryParam("q", "[orth=der]")
+                .queryParam("ql", "poliqarp").queryParam("context", "base/s:s")
+                .request()
+                .header(Attributes.AUTHORIZATION,
+                        HttpAuthorizationHandler
+                                .createBasicAuthorizationHeaderValue("kustvakt",
+                                        "kustvakt2015"))
+                .method("GET");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         ent = response.readEntity(String.class);
         node = JsonUtils.readTree(ent);
         assertNotNull(node);
         // System.out.println("NODE " + ent);
         assertEquals(node.at("/collection/@type").asText(), "koral:docGroup");
-        assertEquals(node.at("/collection/operands/0/@type").asText(), "koral:doc");
-        assertEquals(node.at("/collection/operands/0/key").asText(), "creationDate");
+        assertEquals(node.at("/collection/operands/0/@type").asText(),
+                "koral:doc");
+        assertEquals(node.at("/collection/operands/0/key").asText(),
+                "creationDate");
         assertEquals(node.at("/collection/operands/0/value").asText(), "1775");
-        assertEquals(node.at("/collection/operands/0/type").asText(), "type:date");
-        assertEquals(node.at("/collection/operands/0/match").asText(), "match:geq");
-        assertEquals(node.at("/collection/operands/1/@type").asText(), "koral:doc");
-        assertEquals(node.at("/collection/operands/1/key").asText(), "corpusSigle");
+        assertEquals(node.at("/collection/operands/0/type").asText(),
+                "type:date");
+        assertEquals(node.at("/collection/operands/0/match").asText(),
+                "match:geq");
+        assertEquals(node.at("/collection/operands/1/@type").asText(),
+                "koral:doc");
+        assertEquals(node.at("/collection/operands/1/key").asText(),
+                "corpusSigle");
         assertEquals(node.at("/collection/operands/1/value").asText(), "GOE");
-        assertEquals(node.at("/collection/operands/1/match").asText(), "match:eq");
+        assertEquals(node.at("/collection/operands/1/match").asText(),
+                "match:eq");
     }
 
     @Test
-    public void testQuerySerializationOfVirtualCollection() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("collection/GOE-VC/query").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("context", "base/s:s").request().method("GET");
+    public void testQuerySerializationOfVirtualCollection ()
+            throws KustvaktException {
+        Response response = target().path(API_VERSION)
+                .path("collection/GOE-VC/query").queryParam("q", "[orth=der]")
+                .queryParam("ql", "poliqarp").queryParam("context", "base/s:s")
+                .request().method("GET");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         assertNotNull(node);
-        assertEquals(node.at("/collection/operands/0/@type").asText(), "koral:doc");
-        assertEquals(node.at("/collection/operands/0/key").asText(), "corpusSigle");
+        assertEquals(node.at("/collection/operands/0/@type").asText(),
+                "koral:doc");
+        assertEquals(node.at("/collection/operands/0/key").asText(),
+                "corpusSigle");
         assertEquals(node.at("/collection/operands/0/value").asText(), "GOE");
-        assertEquals(node.at("/collection/operands/1/@type").asText(), "koral:doc");
-        assertEquals(node.at("/collection/operands/1/key").asText(), "creationDate");
-        assertEquals(node.at("/collection/operands/1/value").asText(), "1810-01-01");
+        assertEquals(node.at("/collection/operands/1/@type").asText(),
+                "koral:doc");
+        assertEquals(node.at("/collection/operands/1/key").asText(),
+                "creationDate");
+        assertEquals(node.at("/collection/operands/1/value").asText(),
+                "1810-01-01");
     }
 
     @Test
-    public void testMetaQuerySerialization() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("query").queryParam("context", "sentence").queryParam("count", "20").queryParam("page", "5").queryParam("cutoff", "true").queryParam("q", "[pos=ADJA]").queryParam("ql", "poliqarp").request().method("GET");
+    public void testMetaQuerySerialization () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("query")
+                .queryParam("context", "sentence").queryParam("count", "20")
+                .queryParam("page", "5").queryParam("cutoff", "true")
+                .queryParam("q", "[pos=ADJA]").queryParam("ql", "poliqarp")
+                .request().method("GET");
         assertEquals(response.getStatus(), Status.OK.getStatusCode());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
@@ -143,8 +210,13 @@
     }
 
     @Test
-    public void testMetaQuerySerializationWithOffset() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("query").queryParam("context", "sentence").queryParam("count", "20").queryParam("page", "5").queryParam("offset", "2").queryParam("cutoff", "true").queryParam("q", "[pos=ADJA]").queryParam("ql", "poliqarp").request().method("GET");
+    public void testMetaQuerySerializationWithOffset ()
+            throws KustvaktException {
+        Response response = target().path(API_VERSION).path("query")
+                .queryParam("context", "sentence").queryParam("count", "20")
+                .queryParam("page", "5").queryParam("offset", "2")
+                .queryParam("cutoff", "true").queryParam("q", "[pos=ADJA]")
+                .queryParam("ql", "poliqarp").request().method("GET");
         assertEquals(response.getStatus(), Status.OK.getStatusCode());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/ResourceInfoControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/ResourceInfoControllerTest.java
index 8f30d17..d2d4fed 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/ResourceInfoControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/ResourceInfoControllerTest.java
@@ -20,14 +20,15 @@
 /**
  * @author hanl, margaretha
  * @lastUpdate 19/04/2017
- * EM: FIX ME: Database restructure
+ *             EM: FIX ME: Database restructure
  */
 @Disabled
 public class ResourceInfoControllerTest extends SpringJerseyTest {
 
     @Test
-    public void testGetPublicVirtualCollectionInfo() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("collection").request().get();
+    public void testGetPublicVirtualCollectionInfo () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("collection")
+                .request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -36,8 +37,15 @@
     }
 
     @Test
-    public void testGetVirtualCollectionInfoWithAuthentication() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("collection").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("kustvakt", "kustvakt2015")).get();
+    public void testGetVirtualCollectionInfoWithAuthentication ()
+            throws KustvaktException {
+        Response response = target().path(API_VERSION).path("collection")
+                .request()
+                .header(Attributes.AUTHORIZATION,
+                        HttpAuthorizationHandler
+                                .createBasicAuthorizationHeaderValue("kustvakt",
+                                        "kustvakt2015"))
+                .get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
         assertNotNull(node);
@@ -46,32 +54,38 @@
     }
 
     @Test
-    public void testGetVirtualCollectionInfoById() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("collection").path("GOE-VC").request().get();
+    public void testGetVirtualCollectionInfoById () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("collection")
+                .path("GOE-VC").request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         assertNotNull(node);
         assertNotEquals(0, node.size());
         assertEquals(node.path("name").asText(), "Goethe Virtual Collection");
-        assertEquals(node.path("description").asText(), "Goethe works from 1810");
+        assertEquals(node.path("description").asText(),
+                "Goethe works from 1810");
     }
 
     @Test
-    public void testGetVirtualCollectionInfoByIdUnauthorized() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("collection").path("WPD15-VC").request().get();
+    public void testGetVirtualCollectionInfoByIdUnauthorized ()
+            throws KustvaktException {
+        Response response = target().path(API_VERSION).path("collection")
+                .path("WPD15-VC").request().get();
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         assertNotNull(node);
         assertNotEquals(0, node.size());
         assertEquals(101, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/2").asText(), "[Cannot found public VirtualCollection with ids: [WPD15-VC]]");
+        assertEquals(node.at("/errors/0/2").asText(),
+                "[Cannot found public VirtualCollection with ids: [WPD15-VC]]");
     }
 
     @Test
-    public void testGetPublicCorporaInfo() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("corpus").request().get();
+    public void testGetPublicCorporaInfo () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("corpus").request()
+                .get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
@@ -81,8 +95,9 @@
     }
 
     @Test
-    public void testGetCorpusInfoById() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("corpus").path("WPD13").request().get();
+    public void testGetCorpusInfoById () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("corpus")
+                .path("WPD13").request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         // System.out.println(ent);
@@ -93,8 +108,9 @@
     }
 
     @Test
-    public void testGetCorpusInfoById2() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("corpus").path("GOE").request().get();
+    public void testGetCorpusInfoById2 () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("corpus")
+                .path("GOE").request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
@@ -104,8 +120,9 @@
     }
 
     @Test
-    public void testGetPublicFoundriesInfo() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("foundry").request().get();
+    public void testGetPublicFoundriesInfo () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("foundry").request()
+                .get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
@@ -115,8 +132,9 @@
     }
 
     @Test
-    public void testGetFoundryInfoById() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("foundry").path("tt").request().get();
+    public void testGetFoundryInfoById () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("foundry")
+                .path("tt").request().get();
         String ent = response.readEntity(String.class);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(ent);
@@ -125,15 +143,17 @@
     }
 
     @Test
-    public void testGetUnexistingCorpusInfo() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("corpus").path("ZUW19").request().get();
+    public void testGetUnexistingCorpusInfo () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("corpus")
+                .path("ZUW19").request().get();
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         assertNotNull(node);
         assertNotEquals(0, node.size());
         assertEquals(101, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/2").asText(), "[Cannot found public Corpus with ids: [ZUW19]]");
+        assertEquals(node.at("/errors/0/2").asText(),
+                "[Cannot found public Corpus with ids: [ZUW19]]");
     }
 
     // EM: queries for an unauthorized corpus get the same responses /
@@ -141,14 +161,16 @@
     // asking for an unexisting corpus info. Does it need a specific
     // exception instead?
     @Test
-    public void testGetUnauthorizedCorpusInfo() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("corpus").path("BRZ10").request().get();
+    public void testGetUnauthorizedCorpusInfo () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("corpus")
+                .path("BRZ10").request().get();
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         assertNotNull(node);
         assertNotEquals(0, node.size());
         assertEquals(101, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/2").asText(), "[Cannot found public Corpus with ids: [BRZ10]]");
+        assertEquals(node.at("/errors/0/2").asText(),
+                "[Cannot found public Corpus with ids: [BRZ10]]");
     }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/SearchControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/SearchControllerTest.java
index f683f01..9e932fc 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/SearchControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/SearchControllerTest.java
@@ -35,15 +35,19 @@
     @Autowired
     private KustvaktConfiguration config;
 
-    private JsonNode requestSearchWithFields(String fields) throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=das]").queryParam("ql", "poliqarp").queryParam("fields", fields).queryParam("context", "sentence").queryParam("count", "13").request().get();
+    private JsonNode requestSearchWithFields (String fields)
+            throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=das]").queryParam("ql", "poliqarp")
+                .queryParam("fields", fields).queryParam("context", "sentence")
+                .queryParam("count", "13").request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String query = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(query);
         return node;
     }
 
-    private String createJsonQuery() {
+    private String createJsonQuery () {
         QuerySerializer s = new QuerySerializer();
         s.setQuery("[orth=der]", "poliqarp");
         s.setCollection("corpusSigle=GOE");
@@ -52,17 +56,20 @@
     }
 
     @Test
-    public void testApiWelcomeMessage() {
+    public void testApiWelcomeMessage () {
         Response response = target().path(API_VERSION).path("").request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
-        assertEquals(response.getHeaders().getFirst("X-Index-Revision"), "Wes8Bd4h1OypPqbWF5njeQ==");
+        assertEquals(response.getHeaders().getFirst("X-Index-Revision"),
+                "Wes8Bd4h1OypPqbWF5njeQ==");
         String message = response.readEntity(String.class);
         assertEquals(message, config.getApiWelcomeMessage());
     }
 
     @Test
-    public void testSearchShowTokens() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=die]").queryParam("ql", "poliqarp").queryParam("show-tokens", true).request().get();
+    public void testSearchShowTokens () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=die]").queryParam("ql", "poliqarp")
+                .queryParam("show-tokens", true).request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -71,8 +78,11 @@
     }
 
     @Test
-    public void testSearchDisableSnippet() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=die]").queryParam("ql", "poliqarp").queryParam("show-snippet", false).queryParam("show-tokens", true).request().get();
+    public void testSearchDisableSnippet () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=die]").queryParam("ql", "poliqarp")
+                .queryParam("show-snippet", false)
+                .queryParam("show-tokens", true).request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -81,7 +91,7 @@
     }
 
     @Test
-    public void testSearchWithField() throws KustvaktException {
+    public void testSearchWithField () throws KustvaktException {
         JsonNode node = requestSearchWithFields("author");
         assertNotEquals(0, node.at("/matches").size());
         assertEquals(node.at("/meta/fields").toString(), "[\"author\"]");
@@ -89,15 +99,18 @@
     }
 
     @Test
-    public void testSearchWithMultipleFields() throws KustvaktException {
+    public void testSearchWithMultipleFields () throws KustvaktException {
         JsonNode node = requestSearchWithFields("author, title");
         assertNotEquals(0, node.at("/matches").size());
-        assertEquals(node.at("/meta/fields").toString(), "[\"author\",\"title\"]");
+        assertEquals(node.at("/meta/fields").toString(),
+                "[\"author\",\"title\"]");
     }
 
     @Test
-    public void testSearchQueryPublicCorpora() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").request().accept(MediaType.APPLICATION_JSON).get();
+    public void testSearchQueryPublicCorpora () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .request().accept(MediaType.APPLICATION_JSON).get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
@@ -105,13 +118,19 @@
         assertEquals(node.at("/collection/@type").asText(), "koral:doc");
         assertEquals(node.at("/collection/key").asText(), "availability");
         assertEquals(node.at("/collection/value").asText(), "CC-BY.*");
-        assertEquals(node.at("/collection/rewrites/0/scope").asText(), "availability(FREE)");
-        assertEquals(node.at("/collection/rewrites/0/operation").asText(), "operation:insertion");
+        assertEquals(node.at("/collection/rewrites/0/scope").asText(),
+                "availability(FREE)");
+        assertEquals(node.at("/collection/rewrites/0/operation").asText(),
+                "operation:insertion");
     }
 
     @Test
-    public void testSearchQueryFailure() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der").queryParam("ql", "poliqarp").queryParam("cq", "corpusSigle=WPD | corpusSigle=GOE").queryParam("count", "13").request().accept(MediaType.APPLICATION_JSON).get();
+    public void testSearchQueryFailure () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der").queryParam("ql", "poliqarp")
+                .queryParam("cq", "corpusSigle=WPD | corpusSigle=GOE")
+                .queryParam("count", "13").request()
+                .accept(MediaType.APPLICATION_JSON).get();
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
@@ -124,8 +143,12 @@
     }
 
     @Test
-    public void testSearchQueryWithMeta() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=Bachelor]").queryParam("ql", "poliqarp").queryParam("cutoff", "true").queryParam("count", "5").queryParam("page", "1").queryParam("context", "40-t,30-t").request().get();
+    public void testSearchQueryWithMeta () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=Bachelor]").queryParam("ql", "poliqarp")
+                .queryParam("cutoff", "true").queryParam("count", "5")
+                .queryParam("page", "1").queryParam("context", "40-t,30-t")
+                .request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
@@ -137,14 +160,19 @@
         assertEquals(40, node.at("/meta/context/left/1").asInt());
         assertEquals(30, node.at("/meta/context/right/1").asInt());
         assertEquals(-1, node.at("/meta/totalResults").asInt());
-        for (String path : new String[]{"/meta/count", "/meta/startIndex", "/meta/context/left/1", "/meta/context/right/1", "/meta/totalResults", "/meta/itemsPerPage"}) {
+        for (String path : new String[] { "/meta/count", "/meta/startIndex",
+                "/meta/context/left/1", "/meta/context/right/1",
+                "/meta/totalResults", "/meta/itemsPerPage" }) {
             assertTrue(node.at(path).isNumber(), path + " should be a number");
         }
     }
 
     @Test
-    public void testSearchQueryFreeExtern() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=die]").queryParam("ql", "poliqarp").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
+    public void testSearchQueryFreeExtern () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=die]").queryParam("ql", "poliqarp")
+                .request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -153,13 +181,18 @@
         assertEquals(node.at("/collection/@type").asText(), "koral:doc");
         assertEquals(node.at("/collection/key").asText(), "availability");
         assertEquals(node.at("/collection/value").asText(), "CC-BY.*");
-        assertEquals(node.at("/collection/rewrites/0/scope").asText(), "availability(FREE)");
-        assertEquals(node.at("/collection/rewrites/0/operation").asText(), "operation:insertion");
+        assertEquals(node.at("/collection/rewrites/0/scope").asText(),
+                "availability(FREE)");
+        assertEquals(node.at("/collection/rewrites/0/operation").asText(),
+                "operation:insertion");
     }
 
     @Test
-    public void testSearchQueryFreeIntern() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=die]").queryParam("ql", "poliqarp").request().header(HttpHeaders.X_FORWARDED_FOR, "172.27.0.32").get();
+    public void testSearchQueryFreeIntern () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=die]").queryParam("ql", "poliqarp")
+                .request().header(HttpHeaders.X_FORWARDED_FOR, "172.27.0.32")
+                .get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -168,13 +201,22 @@
         assertEquals(node.at("/collection/@type").asText(), "koral:doc");
         assertEquals(node.at("/collection/key").asText(), "availability");
         assertEquals(node.at("/collection/value").asText(), "CC-BY.*");
-        assertEquals(node.at("/collection/rewrites/0/scope").asText(), "availability(FREE)");
-        assertEquals(node.at("/collection/rewrites/0/operation").asText(), "operation:insertion");
+        assertEquals(node.at("/collection/rewrites/0/scope").asText(),
+                "availability(FREE)");
+        assertEquals(node.at("/collection/rewrites/0/operation").asText(),
+                "operation:insertion");
     }
 
     @Test
-    public void testSearchQueryExternAuthorized() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=die]").queryParam("ql", "poliqarp").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("kustvakt", "kustvakt2015")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
+    public void testSearchQueryExternAuthorized () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=die]").queryParam("ql", "poliqarp")
+                .request()
+                .header(Attributes.AUTHORIZATION,
+                        HttpAuthorizationHandler
+                                .createBasicAuthorizationHeaderValue("kustvakt",
+                                        "kustvakt2015"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -182,17 +224,31 @@
         assertNotNull(node);
         assertNotEquals(0, node.path("matches").size());
         assertEquals(node.at("/collection/@type").asText(), "koral:docGroup");
-        assertEquals(node.at("/collection/operands/0/value").asText(), "CC-BY.*");
-        assertEquals(node.at("/collection/operands/1/operands/0/value").asText(), "ACA.*");
-        assertEquals(node.at("/collection/operands/1/operands/1/value").asText(), "QAO-NC");
+        assertEquals(node.at("/collection/operands/0/value").asText(),
+                "CC-BY.*");
+        assertEquals(
+                node.at("/collection/operands/1/operands/0/value").asText(),
+                "ACA.*");
+        assertEquals(
+                node.at("/collection/operands/1/operands/1/value").asText(),
+                "QAO-NC");
         assertEquals(node.at("/collection/operation").asText(), "operation:or");
-        assertEquals(node.at("/collection/rewrites/0/scope").asText(), "availability(PUB)");
-        assertEquals(node.at("/collection/rewrites/0/operation").asText(), "operation:insertion");
+        assertEquals(node.at("/collection/rewrites/0/scope").asText(),
+                "availability(PUB)");
+        assertEquals(node.at("/collection/rewrites/0/operation").asText(),
+                "operation:insertion");
     }
 
     @Test
-    public void testSearchQueryInternAuthorized() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=die]").queryParam("ql", "poliqarp").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("kustvakt", "kustvakt2015")).header(HttpHeaders.X_FORWARDED_FOR, "172.27.0.32").get();
+    public void testSearchQueryInternAuthorized () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=die]").queryParam("ql", "poliqarp")
+                .request()
+                .header(Attributes.AUTHORIZATION,
+                        HttpAuthorizationHandler
+                                .createBasicAuthorizationHeaderValue("kustvakt",
+                                        "kustvakt2015"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "172.27.0.32").get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -200,74 +256,121 @@
         assertNotEquals(0, node.path("matches").size());
         // System.out.println(node);
         assertEquals(node.at("/collection/@type").asText(), "koral:docGroup");
-        assertEquals(node.at("/collection/operands/0/value").asText(), "CC-BY.*");
-        assertEquals(node.at("/collection/operands/1/operands/0/value").asText(), "ACA.*");
-        assertEquals(node.at("/collection/operands/1/operands/1/operands/0/value").asText(), "QAO-NC");
-        assertEquals(node.at("/collection/operands/1/operands/1/operands/1/value").asText(), "QAO.*");
+        assertEquals(node.at("/collection/operands/0/value").asText(),
+                "CC-BY.*");
+        assertEquals(
+                node.at("/collection/operands/1/operands/0/value").asText(),
+                "ACA.*");
+        assertEquals(
+                node.at("/collection/operands/1/operands/1/operands/0/value")
+                        .asText(),
+                "QAO-NC");
+        assertEquals(
+                node.at("/collection/operands/1/operands/1/operands/1/value")
+                        .asText(),
+                "QAO.*");
         assertEquals(node.at("/collection/operation").asText(), "operation:or");
-        assertEquals(node.at("/collection/rewrites/0/scope").asText(), "availability(ALL)");
-        assertEquals(node.at("/collection/rewrites/0/operation").asText(), "operation:insertion");
+        assertEquals(node.at("/collection/rewrites/0/scope").asText(),
+                "availability(ALL)");
+        assertEquals(node.at("/collection/rewrites/0/operation").asText(),
+                "operation:insertion");
     }
 
     @Test
-    public void testSearchWithCorpusQuery() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("cq", "corpusTitle=gingko").request().accept(MediaType.APPLICATION_JSON).get();
+    public void testSearchWithCorpusQuery () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("cq", "corpusTitle=gingko").request()
+                .accept(MediaType.APPLICATION_JSON).get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         assertEquals(node.at("/collection/@type").asText(), "koral:docGroup");
-        assertEquals(node.at("/collection/operation").asText(), "operation:and");
+        assertEquals(node.at("/collection/operation").asText(),
+                "operation:and");
         assertEquals(2, node.at("/collection/operands").size());
-        assertEquals(node.at("/collection/operands/0/value").asText(), "CC-BY.*");
-        assertEquals(node.at("/collection/operands/1/value").asText(), "gingko");
-        assertEquals(node.at("/collection/operands/1/match").asText(), "match:eq");
+        assertEquals(node.at("/collection/operands/0/value").asText(),
+                "CC-BY.*");
+        assertEquals(node.at("/collection/operands/1/value").asText(),
+                "gingko");
+        assertEquals(node.at("/collection/operands/1/match").asText(),
+                "match:eq");
         assertTrue(node.at("/collection/operands/1/type").isMissingNode());
     }
 
     @Test
-    public void testSearchQueryWithCollectionQueryAuthorizedWithoutIP() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=das]").queryParam("ql", "poliqarp").queryParam("cq", "textClass=politik & corpusSigle=BRZ10").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("kustvakt", "kustvakt2015")).get();
+    public void testSearchQueryWithCollectionQueryAuthorizedWithoutIP ()
+            throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=das]").queryParam("ql", "poliqarp")
+                .queryParam("cq", "textClass=politik & corpusSigle=BRZ10")
+                .request()
+                .header(Attributes.AUTHORIZATION,
+                        HttpAuthorizationHandler
+                                .createBasicAuthorizationHeaderValue("kustvakt",
+                                        "kustvakt2015"))
+                .get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
         assertNotNull(node);
-        assertEquals(node.at("/collection/rewrites/0/operation").asText(), "operation:insertion");
-        assertEquals(node.at("/collection/rewrites/0/scope").asText(), "availability(FREE)");
+        assertEquals(node.at("/collection/rewrites/0/operation").asText(),
+                "operation:insertion");
+        assertEquals(node.at("/collection/rewrites/0/scope").asText(),
+                "availability(FREE)");
         // EM: double AND operations
-        assertEquals(node.at("/collection/operands/0/key").asText(), "availability");
-        assertEquals(node.at("/collection/operands/0/value").asText(), "CC-BY.*");
-        assertEquals(node.at("/collection/operands/1/operands/0/key").asText(), "textClass");
-        assertEquals(node.at("/collection/operands/1/operands/1/key").asText(), "corpusSigle");
+        assertEquals(node.at("/collection/operands/0/key").asText(),
+                "availability");
+        assertEquals(node.at("/collection/operands/0/value").asText(),
+                "CC-BY.*");
+        assertEquals(node.at("/collection/operands/1/operands/0/key").asText(),
+                "textClass");
+        assertEquals(node.at("/collection/operands/1/operands/1/key").asText(),
+                "corpusSigle");
     }
 
     @Test
     @Disabled
-    public void testSearchQueryAuthorizedWithoutIP() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=die]").queryParam("ql", "poliqarp").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("kustvakt", "kustvakt2015")).get();
+    public void testSearchQueryAuthorizedWithoutIP () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=die]").queryParam("ql", "poliqarp")
+                .request()
+                .header(Attributes.AUTHORIZATION,
+                        HttpAuthorizationHandler
+                                .createBasicAuthorizationHeaderValue("kustvakt",
+                                        "kustvakt2015"))
+                .get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertNotNull(node);
         assertNotEquals(0, node.path("matches").size());
         assertEquals(node.at("/collection/@type").asText(), "koral:docGroup");
-        assertEquals(node.at("/collection/operands/0/value").asText(), "CC-BY.*");
+        assertEquals(node.at("/collection/operands/0/value").asText(),
+                "CC-BY.*");
         assertEquals(node.at("/collection/operands/1/value").asText(), "ACA.*");
         assertEquals(node.at("/collection/operation").asText(), "operation:or");
-        assertEquals(node.at("/collection/rewrites/0/scope").asText(), "availability(PUB)");
+        assertEquals(node.at("/collection/rewrites/0/scope").asText(),
+                "availability(PUB)");
     }
 
     @Test
-    public void testSearchWithInvalidPage() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=die]").queryParam("ql", "poliqarp").queryParam("page", "0").request().get();
+    public void testSearchWithInvalidPage () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=die]").queryParam("ql", "poliqarp")
+                .queryParam("page", "0").request().get();
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.INVALID_ARGUMENT, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.INVALID_ARGUMENT,
+                node.at("/errors/0/0").asInt());
         assertEquals(node.at("/errors/0/1").asText(), "page must start from 1");
     }
 
     @Test
-    public void testSearchSentenceMeta() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("context", "sentence").request().get();
+    public void testSearchSentenceMeta () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("context", "sentence").request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
@@ -279,10 +382,11 @@
     // EM: The API is disabled
     @Disabled
     @Test
-    public void testSearchSimpleCQL() throws KustvaktException {
+    public void testSearchSimpleCQL () throws KustvaktException {
         QuerySerializer s = new QuerySerializer();
         s.setQuery("(der) or (das)", "CQL");
-        Response response = target().path(API_VERSION).path("search").request().post(Entity.json(s.toJSON()));
+        Response response = target().path(API_VERSION).path("search").request()
+                .post(Entity.json(s.toJSON()));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
@@ -294,39 +398,55 @@
     // EM: The API is disabled
     @Test
     @Disabled
-    public void testSearchRawQuery() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").request().post(Entity.json(createJsonQuery()));
+    public void testSearchRawQuery () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search").request()
+                .post(Entity.json(createJsonQuery()));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         assertNotNull(node);
         assertNotEquals(0, node.path("matches").size());
-        assertEquals(node.at("/collection/rewrites/0/scope").asText(), "availability(FREE)");
+        assertEquals(node.at("/collection/rewrites/0/scope").asText(),
+                "availability(FREE)");
     }
 
     // EM: The API is disabled
     @Test
     @Disabled
-    public void testSearchPostAll() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").request().header(HttpHeaders.X_FORWARDED_FOR, "10.27.0.32").header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("kustvakt", "kustvakt2015")).post(Entity.json(createJsonQuery()));
+    public void testSearchPostAll () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search").request()
+                .header(HttpHeaders.X_FORWARDED_FOR, "10.27.0.32")
+                .header(Attributes.AUTHORIZATION,
+                        HttpAuthorizationHandler
+                                .createBasicAuthorizationHeaderValue("kustvakt",
+                                        "kustvakt2015"))
+                .post(Entity.json(createJsonQuery()));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         assertNotNull(node);
         assertNotEquals(0, node.path("matches").size());
-        assertEquals(node.at("/collection/rewrites/0/scope").asText(), "availability(ALL)");
+        assertEquals(node.at("/collection/rewrites/0/scope").asText(),
+                "availability(ALL)");
     }
 
     // EM: The API is disabled
     @Test
     @Disabled
-    public void testSearchPostPublic() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("kustvakt", "kustvakt2015")).post(Entity.json(createJsonQuery()));
+    public void testSearchPostPublic () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search").request()
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(Attributes.AUTHORIZATION,
+                        HttpAuthorizationHandler
+                                .createBasicAuthorizationHeaderValue("kustvakt",
+                                        "kustvakt2015"))
+                .post(Entity.json(createJsonQuery()));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         assertNotNull(node);
         assertNotEquals(0, node.path("matches").size());
-        assertEquals(node.at("/collection/rewrites/0/scope").asText(), "availability(PUB)");
+        assertEquals(node.at("/collection/rewrites/0/scope").asText(),
+                "availability(PUB)");
     }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/SearchNetworkEndpointTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/SearchNetworkEndpointTest.java
index 1938b51..ef42760 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/SearchNetworkEndpointTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/SearchNetworkEndpointTest.java
@@ -43,26 +43,41 @@
 
     private String endpointURL = "http://localhost:" + port + "/searchEndpoint";
 
-    public SearchNetworkEndpointTest() throws IOException {
-        searchResult = IOUtils.toString(ClassLoader.getSystemResourceAsStream("network-output/search-result.jsonld"), StandardCharsets.UTF_8);
+    public SearchNetworkEndpointTest () throws IOException {
+        searchResult = IOUtils.toString(
+                ClassLoader.getSystemResourceAsStream(
+                        "network-output/search-result.jsonld"),
+                StandardCharsets.UTF_8);
     }
 
     @BeforeEach
-    public void startMockServer() {
+    public void startMockServer () {
         mockServer = startClientAndServer(port);
         mockClient = new MockServerClient("localhost", mockServer.getPort());
     }
 
     @AfterEach
-    public void stopMockServer() {
+    public void stopMockServer () {
         mockServer.stop();
     }
 
     @Test
-    public void testSearchNetwork() throws IOException, KustvaktException, URISyntaxException {
+    public void testSearchNetwork ()
+            throws IOException, KustvaktException, URISyntaxException {
         config.setNetworkEndpointURL(endpointURL);
-        mockClient.reset().when(request().withMethod("POST").withPath("/searchEndpoint").withHeaders(new Header("Content-Type", "application/json; charset=utf-8"), new Header("Accept", "application/json"))).respond(response().withHeader(new Header("Content-Type", "application/json; charset=utf-8")).withBody(searchResult).withStatusCode(200));
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("engine", "network").request().get();
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/searchEndpoint")
+                        .withHeaders(
+                                new Header("Content-Type",
+                                        "application/json; charset=utf-8"),
+                                new Header("Accept", "application/json")))
+                .respond(response()
+                        .withHeader(new Header("Content-Type",
+                                "application/json; charset=utf-8"))
+                        .withBody(searchResult).withStatusCode(200));
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("engine", "network").request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -70,22 +85,29 @@
     }
 
     @Test
-    public void testSearchWithUnknownURL() throws IOException, KustvaktException {
+    public void testSearchWithUnknownURL ()
+            throws IOException, KustvaktException {
         config.setNetworkEndpointURL("http://localhost:1040/search");
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("engine", "network").request().get();
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("engine", "network").request().get();
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.SEARCH_NETWORK_ENDPOINT_FAILED, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.SEARCH_NETWORK_ENDPOINT_FAILED,
+                node.at("/errors/0/0").asInt());
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
     }
 
     @Test
-    public void testSearchWithUnknownHost() throws KustvaktException {
+    public void testSearchWithUnknownHost () throws KustvaktException {
         config.setNetworkEndpointURL("http://search.com");
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("engine", "network").request().get();
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("engine", "network").request().get();
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.SEARCH_NETWORK_ENDPOINT_FAILED, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.SEARCH_NETWORK_ENDPOINT_FAILED,
+                node.at("/errors/0/0").asInt());
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
     }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/SearchPipeTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/SearchPipeTest.java
index 9591933..03a019e 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/SearchPipeTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/SearchPipeTest.java
@@ -45,29 +45,43 @@
 
     private String glemmUri = "http://localhost:" + port + "/glemm";
 
-    public SearchPipeTest() throws URISyntaxException, IOException {
-        pipeJson = IOUtils.toString(ClassLoader.getSystemResourceAsStream("pipe-output/test-pipes.jsonld"), StandardCharsets.UTF_8);
-        pipeWithParamJson = IOUtils.toString(ClassLoader.getSystemResourceAsStream("pipe-output/with-param.jsonld"), StandardCharsets.UTF_8);
+    public SearchPipeTest () throws URISyntaxException, IOException {
+        pipeJson = IOUtils.toString(
+                ClassLoader.getSystemResourceAsStream(
+                        "pipe-output/test-pipes.jsonld"),
+                StandardCharsets.UTF_8);
+        pipeWithParamJson = IOUtils.toString(
+                ClassLoader.getSystemResourceAsStream(
+                        "pipe-output/with-param.jsonld"),
+                StandardCharsets.UTF_8);
     }
 
     @BeforeEach
-    public void startMockServer() {
+    public void startMockServer () {
         mockServer = startClientAndServer(port);
         mockClient = new MockServerClient("localhost", mockServer.getPort());
     }
 
     @AfterEach
-    public void stopMockServer() {
+    public void stopMockServer () {
         mockServer.stop();
     }
 
     @Test
-    public void testMockServer() throws IOException {
-        mockClient.reset().when(request().withMethod("POST").withPath("/test").withHeader(new Header("Content-Type", "application/json; charset=utf-8"))).respond(response().withHeader(new Header("Content-Type", "application/json; charset=utf-8")).withBody("{test}").withStatusCode(200));
+    public void testMockServer () throws IOException {
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/test")
+                        .withHeader(new Header("Content-Type",
+                                "application/json; charset=utf-8")))
+                .respond(response()
+                        .withHeader(new Header("Content-Type",
+                                "application/json; charset=utf-8"))
+                        .withBody("{test}").withStatusCode(200));
         URL url = new URL("http://localhost:" + port + "/test");
         HttpURLConnection connection = (HttpURLConnection) url.openConnection();
         connection.setRequestMethod("POST");
-        connection.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
+        connection.setRequestProperty("Content-Type",
+                "application/json; charset=UTF-8");
         connection.setRequestProperty("Accept", "application/json");
         connection.setDoOutput(true);
         String json = "{\"name\" : \"dory\"}";
@@ -76,21 +90,36 @@
             os.write(input, 0, input.length);
         }
         assertEquals(200, connection.getResponseCode());
-        BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream(), "utf-8"));
+        BufferedReader br = new BufferedReader(
+                new InputStreamReader(connection.getInputStream(), "utf-8"));
         assertEquals(br.readLine(), "{test}");
     }
 
     @Test
-    public void testSearchWithPipes() throws IOException, KustvaktException, URISyntaxException {
-        mockClient.reset().when(request().withMethod("POST").withPath("/glemm").withHeaders(new Header("Content-Type", "application/json; charset=utf-8"), new Header("Accept", "application/json"))).respond(response().withHeader(new Header("Content-Type", "application/json; charset=utf-8")).withBody(pipeJson).withStatusCode(200));
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("pipes", glemmUri).request().get();
+    public void testSearchWithPipes ()
+            throws IOException, KustvaktException, URISyntaxException {
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/glemm")
+                        .withHeaders(
+                                new Header("Content-Type",
+                                        "application/json; charset=utf-8"),
+                                new Header("Accept", "application/json")))
+                .respond(response()
+                        .withHeader(new Header("Content-Type",
+                                "application/json; charset=utf-8"))
+                        .withBody(pipeJson).withStatusCode(200));
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("pipes", glemmUri).request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(2, node.at("/query/wrap/key").size());
         assertEquals(1, node.at("/collection/rewrites").size());
-        assertEquals(node.at("/collection/rewrites/0/operation").asText(), "operation:insertion");
-        assertEquals(node.at("/collection/rewrites/0/scope").asText(), "availability(FREE)");
+        assertEquals(node.at("/collection/rewrites/0/operation").asText(),
+                "operation:insertion");
+        assertEquals(node.at("/collection/rewrites/0/scope").asText(),
+                "availability(FREE)");
         node = node.at("/query/wrap/rewrites");
         assertEquals(2, node.size());
         assertEquals(node.at("/0/src").asText(), "Glemm");
@@ -102,20 +131,44 @@
     }
 
     @Test
-    public void testSearchWithUrlEncodedPipes() throws IOException, KustvaktException {
-        mockClient.reset().when(request().withMethod("POST").withPath("/glemm").withHeaders(new Header("Content-Type", "application/json; charset=utf-8"), new Header("Accept", "application/json"))).respond(response().withHeader(new Header("Content-Type", "application/json; charset=utf-8")).withBody(pipeJson).withStatusCode(200));
+    public void testSearchWithUrlEncodedPipes ()
+            throws IOException, KustvaktException {
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/glemm")
+                        .withHeaders(
+                                new Header("Content-Type",
+                                        "application/json; charset=utf-8"),
+                                new Header("Accept", "application/json")))
+                .respond(response()
+                        .withHeader(new Header("Content-Type",
+                                "application/json; charset=utf-8"))
+                        .withBody(pipeJson).withStatusCode(200));
         glemmUri = URLEncoder.encode(glemmUri, "utf-8");
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("pipes", glemmUri).request().get();
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("pipes", glemmUri).request().get();
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(2, node.at("/query/wrap/key").size());
     }
 
     @Test
-    public void testSearchWithMultiplePipes() throws KustvaktException {
-        mockClient.reset().when(request().withMethod("POST").withPath("/glemm").withQueryStringParameter("param").withHeaders(new Header("Content-Type", "application/json; charset=utf-8"), new Header("Accept", "application/json"))).respond(response().withHeader(new Header("Content-Type", "application/json; charset=utf-8")).withBody(pipeWithParamJson).withStatusCode(200));
+    public void testSearchWithMultiplePipes () throws KustvaktException {
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/glemm")
+                        .withQueryStringParameter("param").withHeaders(
+                                new Header("Content-Type",
+                                        "application/json; charset=utf-8"),
+                                new Header("Accept", "application/json")))
+                .respond(response()
+                        .withHeader(new Header("Content-Type",
+                                "application/json; charset=utf-8"))
+                        .withBody(pipeWithParamJson).withStatusCode(200));
         String glemmUri2 = glemmUri + "?param=blah";
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("pipes", glemmUri + "," + glemmUri2).request().get();
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("pipes", glemmUri + "," + glemmUri2).request()
+                .get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -123,9 +176,13 @@
     }
 
     @Test
-    public void testSearchWithUnknownURL() throws IOException, KustvaktException {
-        String url = target().getUri().toString() + API_VERSION + "/test/tralala";
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("pipes", url).request().get();
+    public void testSearchWithUnknownURL ()
+            throws IOException, KustvaktException {
+        String url = target().getUri().toString() + API_VERSION
+                + "/test/tralala";
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("pipes", url).request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -134,8 +191,10 @@
     }
 
     @Test
-    public void testSearchWithUnknownHost() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("pipes", "http://glemm").request().get();
+    public void testSearchWithUnknownHost () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("pipes", "http://glemm").request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -144,21 +203,30 @@
     }
 
     @Test
-    public void testSearchUnsupportedMediaType() throws KustvaktException {
-        mockClient.reset().when(request().withMethod("POST").withPath("/non-json-pipe")).respond(response().withStatusCode(415));
+    public void testSearchUnsupportedMediaType () throws KustvaktException {
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/non-json-pipe"))
+                .respond(response().withStatusCode(415));
         String pipeUri = "http://localhost:" + port + "/non-json-pipe";
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("pipes", pipeUri).request().get();
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("pipes", pipeUri).request().get();
         String entity = response.readEntity(String.class);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(StatusCodes.PIPE_FAILED, node.at("/warnings/0/0").asInt());
-        assertEquals(node.at("/warnings/0/3").asText(), "415 Unsupported Media Type");
+        assertEquals(node.at("/warnings/0/3").asText(),
+                "415 Unsupported Media Type");
     }
 
     @Test
-    public void testSearchWithMultiplePipeWarnings() throws KustvaktException {
-        String url = target().getUri().toString() + API_VERSION + "/test/tralala";
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("pipes", url + "," + "http://glemm").request().get();
+    public void testSearchWithMultiplePipeWarnings () throws KustvaktException {
+        String url = target().getUri().toString() + API_VERSION
+                + "/test/tralala";
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("pipes", url + "," + "http://glemm").request()
+                .get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -172,37 +240,73 @@
     }
 
     @Test
-    public void testSearchWithInvalidJsonResponse() throws KustvaktException {
-        mockClient.reset().when(request().withMethod("POST").withPath("/invalid-response").withHeaders(new Header("Content-Type", "application/json; charset=utf-8"), new Header("Accept", "application/json"))).respond(response().withBody("{blah:}").withStatusCode(200).withHeaders(new Header("Content-Type", "application/json; charset=utf-8")));
+    public void testSearchWithInvalidJsonResponse () throws KustvaktException {
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/invalid-response")
+                        .withHeaders(
+                                new Header("Content-Type",
+                                        "application/json; charset=utf-8"),
+                                new Header("Accept", "application/json")))
+                .respond(response().withBody("{blah:}").withStatusCode(200)
+                        .withHeaders(new Header("Content-Type",
+                                "application/json; charset=utf-8")));
         String pipeUri = "http://localhost:" + port + "/invalid-response";
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("pipes", pipeUri).request().get();
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("pipes", pipeUri).request().get();
         String entity = response.readEntity(String.class);
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.DESERIALIZATION_FAILED, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.DESERIALIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
     }
 
     @Test
-    public void testSearchWithPlainTextResponse() throws KustvaktException {
-        mockClient.reset().when(request().withMethod("POST").withPath("/plain-text").withHeaders(new Header("Content-Type", "application/json; charset=utf-8"), new Header("Accept", "application/json"))).respond(response().withBody("blah").withStatusCode(200));
+    public void testSearchWithPlainTextResponse () throws KustvaktException {
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/plain-text")
+                        .withHeaders(
+                                new Header("Content-Type",
+                                        "application/json; charset=utf-8"),
+                                new Header("Accept", "application/json")))
+                .respond(response().withBody("blah").withStatusCode(200));
         String pipeUri = "http://localhost:" + port + "/plain-text";
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("pipes", pipeUri).request().get();
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("pipes", pipeUri).request().get();
         String entity = response.readEntity(String.class);
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.DESERIALIZATION_FAILED, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.DESERIALIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
     }
 
     @Test
-    public void testSearchWithMultipleAndUnknownPipes() throws KustvaktException {
-        mockClient.reset().when(request().withMethod("POST").withPath("/glemm").withHeaders(new Header("Content-Type", "application/json; charset=utf-8"), new Header("Accept", "application/json"))).respond(response().withHeader(new Header("Content-Type", "application/json; charset=utf-8")).withBody(pipeJson).withStatusCode(200));
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("pipes", "http://unknown" + "," + glemmUri).request().get();
+    public void testSearchWithMultipleAndUnknownPipes ()
+            throws KustvaktException {
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/glemm")
+                        .withHeaders(
+                                new Header("Content-Type",
+                                        "application/json; charset=utf-8"),
+                                new Header("Accept", "application/json")))
+                .respond(response()
+                        .withHeader(new Header("Content-Type",
+                                "application/json; charset=utf-8"))
+                        .withBody(pipeJson).withStatusCode(200));
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("pipes", "http://unknown" + "," + glemmUri)
+                .request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(2, node.at("/query/wrap/key").size());
         assertTrue(node.at("/warnings").isMissingNode());
-        response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("pipes", glemmUri + ",http://unknown").request().get();
+        response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("pipes", glemmUri + ",http://unknown").request()
+                .get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         entity = response.readEntity(String.class);
         node = JsonUtils.readTree(entity);
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/SearchPublicMetadataTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/SearchPublicMetadataTest.java
index 1d1db61..aeec05e 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/SearchPublicMetadataTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/SearchPublicMetadataTest.java
@@ -22,53 +22,73 @@
 public class SearchPublicMetadataTest extends SpringJerseyTest {
 
     @Test
-    public void testSearchPublicMetadata() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "Sonne").queryParam("ql", "poliqarp").queryParam("access-rewrite-disabled", "true").request().get();
+    public void testSearchPublicMetadata () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "Sonne").queryParam("ql", "poliqarp")
+                .queryParam("access-rewrite-disabled", "true").request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(node.at("/collection/rewrites/0/scope").asText(), "availability(ALL)");
+        assertEquals(node.at("/collection/rewrites/0/scope").asText(),
+                "availability(ALL)");
         assertTrue(node.at("/matches/0/snippet").isMissingNode());
     }
 
     @Test
-    public void testSearchPublicMetadataExtern() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "Sonne").queryParam("ql", "poliqarp").queryParam("access-rewrite-disabled", "true").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
+    public void testSearchPublicMetadataExtern () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "Sonne").queryParam("ql", "poliqarp")
+                .queryParam("access-rewrite-disabled", "true").request()
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(node.at("/collection/rewrites/0/scope").asText(), "availability(ALL)");
+        assertEquals(node.at("/collection/rewrites/0/scope").asText(),
+                "availability(ALL)");
         assertTrue(node.at("/matches/0/snippet").isMissingNode());
     }
 
     @Test
-    public void testSearchPublicMetadataWithCustomFields() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "Sonne").queryParam("ql", "poliqarp").queryParam("fields", "author,title").queryParam("access-rewrite-disabled", "true").request().get();
+    public void testSearchPublicMetadataWithCustomFields ()
+            throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "Sonne").queryParam("ql", "poliqarp")
+                .queryParam("fields", "author,title")
+                .queryParam("access-rewrite-disabled", "true").request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(node.at("/collection/rewrites/0/scope").asText(), "availability(ALL)");
+        assertEquals(node.at("/collection/rewrites/0/scope").asText(),
+                "availability(ALL)");
         assertTrue(node.at("/matches/0/snippet").isMissingNode());
-        assertEquals(node.at("/matches/0/author").asText(), "Goethe, Johann Wolfgang von");
-        assertEquals(node.at("/matches/0/title").asText(), "Italienische Reise");
+        assertEquals(node.at("/matches/0/author").asText(),
+                "Goethe, Johann Wolfgang von");
+        assertEquals(node.at("/matches/0/title").asText(),
+                "Italienische Reise");
         // assertEquals(3, node.at("/matches/0").size());
     }
 
     @Test
-    public void testSearchPublicMetadataWithNonPublicField() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "Sonne").queryParam("ql", "poliqarp").queryParam("fields", "author,title,snippet").queryParam("access-rewrite-disabled", "true").request().get();
+    public void testSearchPublicMetadataWithNonPublicField ()
+            throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "Sonne").queryParam("ql", "poliqarp")
+                .queryParam("fields", "author,title,snippet")
+                .queryParam("access-rewrite-disabled", "true").request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.NON_PUBLIC_FIELD_IGNORED, node.at("/warnings/0/0").asInt());
-        assertEquals(node.at("/warnings/0/1").asText(), "The requested non public fields are ignored");
+        assertEquals(StatusCodes.NON_PUBLIC_FIELD_IGNORED,
+                node.at("/warnings/0/0").asInt());
+        assertEquals(node.at("/warnings/0/1").asText(),
+                "The requested non public fields are ignored");
         assertEquals(node.at("/warnings/0/2").asText(), "snippet");
     }
 
     // EM: The API is disabled
     @Disabled
     @Test
-    public void testSearchPostPublicMetadata() throws KustvaktException {
+    public void testSearchPostPublicMetadata () throws KustvaktException {
         QuerySerializer s = new QuerySerializer();
         s.setQuery("[orth=der]", "poliqarp");
         s.setCollection("corpusSigle=GOE");
@@ -76,39 +96,55 @@
         MetaQueryBuilder meta = new MetaQueryBuilder();
         meta.addEntry("snippets", "true");
         s.setMeta(meta);
-        Response response = target().path(API_VERSION).path("search").request().post(Entity.json(s.toJSON()));
+        Response response = target().path(API_VERSION).path("search").request()
+                .post(Entity.json(s.toJSON()));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
-        assertEquals(node.at("/collection/rewrites/0/scope").asText(), "availability(ALL)");
+        assertEquals(node.at("/collection/rewrites/0/scope").asText(),
+                "availability(ALL)");
         assertTrue(node.at("/matches/0/snippet").isMissingNode());
     }
 
     @Test
-    public void testSearchPublicMetadataWithSystemVC() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "Sonne").queryParam("ql", "poliqarp").queryParam("cq", "referTo system-vc").queryParam("access-rewrite-disabled", "true").request().get();
+    public void testSearchPublicMetadataWithSystemVC ()
+            throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "Sonne").queryParam("ql", "poliqarp")
+                .queryParam("cq", "referTo system-vc")
+                .queryParam("access-rewrite-disabled", "true").request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(node.at("/collection/operation").asText(), "operation:and");
+        assertEquals(node.at("/collection/operation").asText(),
+                "operation:and");
         node = node.at("/collection/operands/1");
         assertEquals(node.at("/@type").asText(), "koral:doc");
         assertEquals(node.at("/value").asText(), "GOE");
         assertEquals(node.at("/match").asText(), "match:eq");
         assertEquals(node.at("/key").asText(), "corpusSigle");
-        assertEquals(node.at("/rewrites/0/operation").asText(), "operation:deletion");
-        assertEquals(node.at("/rewrites/0/scope").asText(), "@type(koral:docGroupRef)");
-        assertEquals(node.at("/rewrites/1/operation").asText(), "operation:deletion");
+        assertEquals(node.at("/rewrites/0/operation").asText(),
+                "operation:deletion");
+        assertEquals(node.at("/rewrites/0/scope").asText(),
+                "@type(koral:docGroupRef)");
+        assertEquals(node.at("/rewrites/1/operation").asText(),
+                "operation:deletion");
         assertEquals(node.at("/rewrites/1/scope").asText(), "ref(system-vc)");
-        assertEquals(node.at("/rewrites/2/operation").asText(), "operation:insertion");
+        assertEquals(node.at("/rewrites/2/operation").asText(),
+                "operation:insertion");
     }
 
     @Test
-    public void testSearchPublicMetadataWithPrivateVC() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "Sonne").queryParam("ql", "poliqarp").queryParam("cq", "referTo \"dory/dory-vc\"").queryParam("access-rewrite-disabled", "true").request().get();
+    public void testSearchPublicMetadataWithPrivateVC ()
+            throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "Sonne").queryParam("ql", "poliqarp")
+                .queryParam("cq", "referTo \"dory/dory-vc\"")
+                .queryParam("access-rewrite-disabled", "true").request().get();
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.AUTHORIZATION_FAILED, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.AUTHORIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
         assertEquals(node.at("/errors/0/2").asText(), "guest");
     }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/SearchTokenSnippetTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/SearchTokenSnippetTest.java
index c0e9fa7..e115f90 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/SearchTokenSnippetTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/SearchTokenSnippetTest.java
@@ -18,8 +18,12 @@
 public class SearchTokenSnippetTest extends SpringJerseyTest {
 
     @Test
-    public void testSearchWithTokens() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=das]").queryParam("ql", "poliqarp").queryParam("show-tokens", "true").queryParam("context", "sentence").queryParam("count", "13").request().get();
+    public void testSearchWithTokens () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=das]").queryParam("ql", "poliqarp")
+                .queryParam("show-tokens", "true")
+                .queryParam("context", "sentence").queryParam("count", "13")
+                .request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
@@ -31,8 +35,12 @@
     }
 
     @Test
-    public void testSearchWithoutTokens() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=das]").queryParam("ql", "poliqarp").queryParam("show-tokens", "false").queryParam("context", "sentence").queryParam("count", "13").request().get();
+    public void testSearchWithoutTokens () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=das]").queryParam("ql", "poliqarp")
+                .queryParam("show-tokens", "false")
+                .queryParam("context", "sentence").queryParam("count", "13")
+                .request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
@@ -42,8 +50,13 @@
     }
 
     @Test
-    public void testSearchPublicMetadataWithTokens() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=das]").queryParam("ql", "poliqarp").queryParam("access-rewrite-disabled", "true").queryParam("show-tokens", "true").queryParam("context", "sentence").queryParam("count", "13").request().get();
+    public void testSearchPublicMetadataWithTokens () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=das]").queryParam("ql", "poliqarp")
+                .queryParam("access-rewrite-disabled", "true")
+                .queryParam("show-tokens", "true")
+                .queryParam("context", "sentence").queryParam("count", "13")
+                .request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/StatisticsControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/StatisticsControllerTest.java
index 8bcb604..ecdad64 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/StatisticsControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/StatisticsControllerTest.java
@@ -25,11 +25,14 @@
 public class StatisticsControllerTest extends SpringJerseyTest {
 
     @Test
-    public void testGetStatisticsNoResource() throws IOException, KustvaktException {
+    public void testGetStatisticsNoResource ()
+            throws IOException, KustvaktException {
         String corpusQuery = "corpusSigle=WPD15";
-        Response response = target().path(API_VERSION).path("statistics").queryParam("corpusQuery", corpusQuery).request().get();
+        Response response = target().path(API_VERSION).path("statistics")
+                .queryParam("corpusQuery", corpusQuery).request().get();
         assert Status.OK.getStatusCode() == response.getStatus();
-        assertEquals(response.getHeaders().getFirst("X-Index-Revision"), "Wes8Bd4h1OypPqbWF5njeQ==");
+        assertEquals(response.getHeaders().getFirst("X-Index-Revision"),
+                "Wes8Bd4h1OypPqbWF5njeQ==");
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         assertEquals(node.get("documents").asInt(), 0);
@@ -37,8 +40,10 @@
     }
 
     @Test
-    public void testStatisticsWithCq() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("statistics").queryParam("cq", "textType=Abhandlung & corpusSigle=GOE").request().method("GET");
+    public void testStatisticsWithCq () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("statistics")
+                .queryParam("cq", "textType=Abhandlung & corpusSigle=GOE")
+                .request().method("GET");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String query = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(query);
@@ -50,8 +55,12 @@
     }
 
     @Test
-    public void testStatisticsWithCqAndCorpusQuery() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("statistics").queryParam("cq", "textType=Abhandlung & corpusSigle=GOE").queryParam("corpusQuery", "textType=Autobiographie & corpusSigle=GOE").request().method("GET");
+    public void testStatisticsWithCqAndCorpusQuery () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("statistics")
+                .queryParam("cq", "textType=Abhandlung & corpusSigle=GOE")
+                .queryParam("corpusQuery",
+                        "textType=Autobiographie & corpusSigle=GOE")
+                .request().method("GET");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String query = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(query);
@@ -63,21 +72,27 @@
     }
 
     @Test
-    public void testGetStatisticsWithcorpusQuery1() throws IOException, KustvaktException {
+    public void testGetStatisticsWithcorpusQuery1 ()
+            throws IOException, KustvaktException {
         String corpusQuery = "corpusSigle=GOE";
-        Response response = target().path(API_VERSION).path("statistics").queryParam("corpusQuery", corpusQuery).request().get();
+        Response response = target().path(API_VERSION).path("statistics")
+                .queryParam("corpusQuery", corpusQuery).request().get();
         assert Status.OK.getStatusCode() == response.getStatus();
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         assertEquals(node.get("documents").asInt(), 11);
         assertEquals(node.get("tokens").asInt(), 665842);
         assertEquals(StatusCodes.DEPRECATED, node.at("/warnings/0/0").asInt());
-        assertEquals(node.at("/warnings/0/1").asText(), "Parameter corpusQuery is deprecated in favor of cq.");
+        assertEquals(node.at("/warnings/0/1").asText(),
+                "Parameter corpusQuery is deprecated in favor of cq.");
     }
 
     @Test
-    public void testGetStatisticsWithcorpusQuery2() throws IOException, KustvaktException {
-        Response response = target().path(API_VERSION).path("statistics").queryParam("corpusQuery", "creationDate since 1810").request().get();
+    public void testGetStatisticsWithcorpusQuery2 ()
+            throws IOException, KustvaktException {
+        Response response = target().path(API_VERSION).path("statistics")
+                .queryParam("corpusQuery", "creationDate since 1810").request()
+                .get();
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         assert Status.OK.getStatusCode() == response.getStatus();
@@ -88,30 +103,41 @@
     }
 
     @Test
-    public void testGetStatisticsWithWrongcorpusQuery() throws IOException, KustvaktException {
-        Response response = target().path(API_VERSION).path("statistics").queryParam("corpusQuery", "creationDate geq 1810").request().get();
+    public void testGetStatisticsWithWrongcorpusQuery ()
+            throws IOException, KustvaktException {
+        Response response = target().path(API_VERSION).path("statistics")
+                .queryParam("corpusQuery", "creationDate geq 1810").request()
+                .get();
         assert Status.BAD_REQUEST.getStatusCode() == response.getStatus();
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         assertEquals(node.at("/errors/0/0").asInt(), 302);
-        assertEquals(node.at("/errors/0/1").asText(), "Could not parse query >>> (creationDate geq 1810) <<<.");
-        assertEquals(node.at("/errors/0/2").asText(), "(creationDate geq 1810)");
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Could not parse query >>> (creationDate geq 1810) <<<.");
+        assertEquals(node.at("/errors/0/2").asText(),
+                "(creationDate geq 1810)");
     }
 
     @Test
-    public void testGetStatisticsWithWrongcorpusQuery2() throws IOException, KustvaktException {
-        Response response = target().path(API_VERSION).path("statistics").queryParam("corpusQuery", "creationDate >= 1810").request().get();
+    public void testGetStatisticsWithWrongcorpusQuery2 ()
+            throws IOException, KustvaktException {
+        Response response = target().path(API_VERSION).path("statistics")
+                .queryParam("corpusQuery", "creationDate >= 1810").request()
+                .get();
         String ent = response.readEntity(String.class);
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(ent);
         assertEquals(node.at("/errors/0/0").asInt(), 305);
-        assertEquals(node.at("/errors/0/1").asText(), "Operator >= is not acceptable.");
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Operator >= is not acceptable.");
         assertEquals(node.at("/errors/0/2").asText(), ">=");
     }
 
     @Test
-    public void testGetStatisticsWithoutcorpusQuery() throws IOException, KustvaktException {
-        Response response = target().path(API_VERSION).path("statistics").request().get();
+    public void testGetStatisticsWithoutcorpusQuery ()
+            throws IOException, KustvaktException {
+        Response response = target().path(API_VERSION).path("statistics")
+                .request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
@@ -122,9 +148,17 @@
     }
 
     @Test
-    public void testGetStatisticsWithKoralQuery() throws IOException, KustvaktException {
-        Response response = target().path(API_VERSION).path("statistics").request().header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON).post(Entity.json("{ \"collection\" : {\"@type\": " + "\"koral:doc\", \"key\": \"availability\", \"match\": " + "\"match:eq\", \"type\": \"type:regex\", \"value\": " + "\"CC-BY.*\"} }"));
-        assertEquals(response.getHeaders().getFirst("X-Index-Revision"), "Wes8Bd4h1OypPqbWF5njeQ==");
+    public void testGetStatisticsWithKoralQuery ()
+            throws IOException, KustvaktException {
+        Response response = target().path(API_VERSION).path("statistics")
+                .request()
+                .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
+                .post(Entity.json("{ \"collection\" : {\"@type\": "
+                        + "\"koral:doc\", \"key\": \"availability\", \"match\": "
+                        + "\"match:eq\", \"type\": \"type:regex\", \"value\": "
+                        + "\"CC-BY.*\"} }"));
+        assertEquals(response.getHeaders().getFirst("X-Index-Revision"),
+                "Wes8Bd4h1OypPqbWF5njeQ==");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
@@ -135,28 +169,42 @@
     }
 
     @Test
-    public void testGetStatisticsWithEmptyCollection() throws IOException, KustvaktException {
-        Response response = target().path(API_VERSION).path("statistics").request().header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON).post(Entity.json("{}"));
+    public void testGetStatisticsWithEmptyCollection ()
+            throws IOException, KustvaktException {
+        Response response = target().path(API_VERSION).path("statistics")
+                .request()
+                .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
+                .post(Entity.json("{}"));
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
-        assertEquals(node.at("/errors/0/0").asInt(), de.ids_mannheim.korap.util.StatusCodes.MISSING_COLLECTION);
-        assertEquals(node.at("/errors/0/1").asText(), "Collection is not found");
+        assertEquals(node.at("/errors/0/0").asInt(),
+                de.ids_mannheim.korap.util.StatusCodes.MISSING_COLLECTION);
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Collection is not found");
     }
 
     @Test
-    public void testGetStatisticsWithIncorrectJson() throws IOException, KustvaktException {
-        Response response = target().path(API_VERSION).path("statistics").request().header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON).post(Entity.json("{ \"collection\" : }"));
+    public void testGetStatisticsWithIncorrectJson ()
+            throws IOException, KustvaktException {
+        Response response = target().path(API_VERSION).path("statistics")
+                .request()
+                .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
+                .post(Entity.json("{ \"collection\" : }"));
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
-        assertEquals(StatusCodes.DESERIALIZATION_FAILED, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "Failed deserializing json object: { \"collection\" : }");
+        assertEquals(StatusCodes.DESERIALIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Failed deserializing json object: { \"collection\" : }");
     }
 
     @Test
-    public void testGetStatisticsWithoutKoralQuery() throws IOException, KustvaktException {
-        Response response = target().path(API_VERSION).path("statistics").request().post(Entity.json(""));
+    public void testGetStatisticsWithoutKoralQuery ()
+            throws IOException, KustvaktException {
+        Response response = target().path(API_VERSION).path("statistics")
+                .request().post(Entity.json(""));
         String ent = response.readEntity(String.class);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(ent);
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/TokenExpiryTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/TokenExpiryTest.java
index 7cc5e6f..1d130b6 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/TokenExpiryTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/TokenExpiryTest.java
@@ -32,14 +32,19 @@
 
     @Disabled
     @Test
-    public void requestToken() throws KustvaktException, InterruptedException, IOException {
+    public void requestToken ()
+            throws KustvaktException, InterruptedException, IOException {
         Form form = new Form();
         form.param("grant_type", "password");
         form.param("client_id", "fCBbQkAyYzI4NzUxMg");
         form.param("client_secret", "secret");
         form.param("username", "dory");
         form.param("password", "password");
-        Response response = target().path(API_VERSION).path("oauth2").path("token").request().header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED).post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("oauth2")
+                .path("token").request()
+                .header(HttpHeaders.CONTENT_TYPE,
+                        ContentType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(form));
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         String token = node.at("/access_token").asText();
@@ -53,17 +58,23 @@
     // because sqlite needs a trigger after INSERT to
     // oauth_access_token to store created_date. Before INSERT trigger
     // does not work.
-    private void testSearchWithExpiredToken(String token) throws KustvaktException, IOException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "Wasser").queryParam("ql", "poliqarp").request().header(Attributes.AUTHORIZATION, "Bearer " + token).get();
+    private void testSearchWithExpiredToken (String token)
+            throws KustvaktException, IOException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "Wasser").queryParam("ql", "poliqarp")
+                .request().header(Attributes.AUTHORIZATION, "Bearer " + token)
+                .get();
         String ent = response.readEntity(String.class);
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(ent);
         assertEquals(StatusCodes.EXPIRED, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "Access token is expired");
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Access token is expired");
     }
 
     // cannot be tested dynamically
-    private void testRequestAuthorizationCodeAuthenticationTooOld(String token) throws KustvaktException {
+    private void testRequestAuthorizationCodeAuthenticationTooOld (String token)
+            throws KustvaktException {
         Form form = new Form();
         form.param("response_type", "code");
         form.param("client_id", "fCBbQkAyYzI4NzUxMg");
@@ -72,19 +83,22 @@
         form.param("scope", "search");
         form.param("max_age", "1");
 
-        Response response =
-                target().path(API_VERSION).path("oauth2").path("authorize")
-                        .request()
-                        .header(Attributes.AUTHORIZATION, "Bearer " + token)
-                        .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
-                        .header(HttpHeaders.CONTENT_TYPE,
-                                ContentType.APPLICATION_FORM_URLENCODED)
-                        .post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("oauth2")
+                .path("authorize").request()
+                .header(Attributes.AUTHORIZATION, "Bearer " + token)
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(HttpHeaders.CONTENT_TYPE,
+                        ContentType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(form));
 
         assertEquals(HttpStatus.SC_UNAUTHORIZED, response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.USER_REAUTHENTICATION_REQUIRED, node.at("/errors/0/0").asInt());
-        assertEquals("User reauthentication is required because the authentication " + "time is too old according to max_age", node.at("/errors/0/1").asText());
+        assertEquals(StatusCodes.USER_REAUTHENTICATION_REQUIRED,
+                node.at("/errors/0/0").asInt());
+        assertEquals(
+                "User reauthentication is required because the authentication "
+                        + "time is too old according to max_age",
+                node.at("/errors/0/1").asText());
     }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/UserControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/UserControllerTest.java
index 4ecbe46..27c8512 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/UserControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/UserControllerTest.java
@@ -25,11 +25,12 @@
 
     private String userAuthHeader;
 
-    public UserControllerTest() throws KustvaktException {
-        userAuthHeader = HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "password");
+    public UserControllerTest () throws KustvaktException {
+        userAuthHeader = HttpAuthorizationHandler
+                .createBasicAuthorizationHeaderValue(username, "password");
     }
 
-    private OAuth2ClientJson createOAuth2Client() {
+    private OAuth2ClientJson createOAuth2Client () {
         OAuth2ClientJson client = new OAuth2ClientJson();
         client.setName("OWID client");
         client.setType(OAuth2ClientType.PUBLIC);
@@ -38,7 +39,8 @@
         return client;
     }
 
-    private String registerClient() throws ProcessingException, KustvaktException {
+    private String registerClient ()
+            throws ProcessingException, KustvaktException {
         OAuth2ClientJson clientJson = createOAuth2Client();
         Response response = registerClient(username, clientJson);
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
@@ -46,10 +48,13 @@
         return clientId;
     }
 
-    private String requestOAuth2AccessToken(String clientId) throws KustvaktException {
-        Response response = requestAuthorizationCode("code", clientId, "", "user_info", "", userAuthHeader);
+    private String requestOAuth2AccessToken (String clientId)
+            throws KustvaktException {
+        Response response = requestAuthorizationCode("code", clientId, "",
+                "user_info", "", userAuthHeader);
         String code = parseAuthorizationCode(response);
-        response = requestTokenWithAuthorizationCodeAndForm(clientId, null, code);
+        response = requestTokenWithAuthorizationCodeAndForm(clientId, null,
+                code);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -58,10 +63,13 @@
     }
 
     @Test
-    public void getUsername() throws ProcessingException, KustvaktException {
+    public void getUsername () throws ProcessingException, KustvaktException {
         String clientId = registerClient();
         String accessToken = requestOAuth2AccessToken(clientId);
-        Response response = target().path(API_VERSION).path("user").path("info").request().header(Attributes.AUTHORIZATION, "Bearer " + accessToken).get();
+        Response response = target().path(API_VERSION).path("user").path("info")
+                .request()
+                .header(Attributes.AUTHORIZATION, "Bearer " + accessToken)
+                .get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/UserGroupControllerAdminTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/UserGroupControllerAdminTest.java
index 99cf31a..aa6a4c6 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/UserGroupControllerAdminTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/UserGroupControllerAdminTest.java
@@ -32,8 +32,12 @@
 
     private String testUser = "group-admin";
 
-    private JsonNode listGroup(String username) throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("group").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(testUser, "pass")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
+    private JsonNode listGroup (String username)
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("group").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(testUser, "pass"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -41,11 +45,15 @@
     }
 
     @Test
-    public void testListUserGroupsUsingAdminToken() throws KustvaktException {
+    public void testListUserGroupsUsingAdminToken () throws KustvaktException {
         Form f = new Form();
         f.param("username", "dory");
         f.param("token", "secret");
-        Response response = target().path(API_VERSION).path("admin").path("group").path("list").request().header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED).post(Entity.form(f));
+        Response response = target().path(API_VERSION).path("admin")
+                .path("group").path("list").request()
+                .header(HttpHeaders.CONTENT_TYPE,
+                        MediaType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(f));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -75,22 +83,38 @@
     // assertEquals(3, node.size());
     // }
     @Test
-    public void testListUserGroupsUnauthorized() throws KustvaktException {
+    public void testListUserGroupsUnauthorized () throws KustvaktException {
         Form f = new Form();
         f.param("username", "dory");
-        Response response = target().path(API_VERSION).path("admin").path("group").path("list").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(testUser, "pass")).header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED).post(Entity.form(f));
+        Response response = target().path(API_VERSION).path("admin")
+                .path("group").path("list").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(testUser, "pass"))
+                .header(HttpHeaders.CONTENT_TYPE,
+                        MediaType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(f));
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.AUTHORIZATION_FAILED, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.AUTHORIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
     }
 
     @Test
-    public void testListUserGroupsWithStatus() throws KustvaktException {
+    public void testListUserGroupsWithStatus () throws KustvaktException {
         Form f = new Form();
         f.param("username", "dory");
         f.param("status", "ACTIVE");
-        Response response = target().path(API_VERSION).path("admin").path("group").path("list").queryParam("username", "dory").queryParam("status", "ACTIVE").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(sysAdminUser, "pass")).header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED).post(Entity.form(f));
+        Response response = target().path(API_VERSION).path("admin")
+                .path("group").path("list").queryParam("username", "dory")
+                .queryParam("status", "ACTIVE").request()
+                .header(Attributes.AUTHORIZATION,
+                        HttpAuthorizationHandler
+                                .createBasicAuthorizationHeaderValue(
+                                        sysAdminUser, "pass"))
+                .header(HttpHeaders.CONTENT_TYPE,
+                        MediaType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(f));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         // System.out.println(entity);
@@ -100,16 +124,31 @@
 
     // same as list user-groups of the admin
     @Test
-    public void testListWithoutUsername() throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("group").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(sysAdminUser, "pass")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
+    public void testListWithoutUsername ()
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("group").request()
+                .header(Attributes.AUTHORIZATION,
+                        HttpAuthorizationHandler
+                                .createBasicAuthorizationHeaderValue(
+                                        sysAdminUser, "pass"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         assertEquals(entity, "[]");
     }
 
     @Test
-    public void testListByStatusAll() throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("admin").path("group").path("list").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(sysAdminUser, "pass")).header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED).post(null);
+    public void testListByStatusAll ()
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("admin")
+                .path("group").path("list").request()
+                .header(Attributes.AUTHORIZATION,
+                        HttpAuthorizationHandler
+                                .createBasicAuthorizationHeaderValue(
+                                        sysAdminUser, "pass"))
+                .header(HttpHeaders.CONTENT_TYPE,
+                        MediaType.APPLICATION_FORM_URLENCODED)
+                .post(null);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -123,10 +162,21 @@
     }
 
     @Test
-    public void testListByStatusHidden() throws ProcessingException, KustvaktException {
+    public void testListByStatusHidden ()
+            throws ProcessingException, KustvaktException {
         Form f = new Form();
         f.param("status", "HIDDEN");
-        Response response = target().path(API_VERSION).path("admin").path("group").path("list").queryParam("status", "HIDDEN").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(sysAdminUser, "pass")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED).post(Entity.form(f));
+        Response response = target().path(API_VERSION).path("admin")
+                .path("group").path("list").queryParam("status", "HIDDEN")
+                .request()
+                .header(Attributes.AUTHORIZATION,
+                        HttpAuthorizationHandler
+                                .createBasicAuthorizationHeaderValue(
+                                        sysAdminUser, "pass"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(HttpHeaders.CONTENT_TYPE,
+                        MediaType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(f));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -135,9 +185,17 @@
     }
 
     @Test
-    public void testUserGroupAdmin() throws ProcessingException, KustvaktException {
+    public void testUserGroupAdmin ()
+            throws ProcessingException, KustvaktException {
         String groupName = "admin-test-group";
-        Response response = target().path(API_VERSION).path("group").path("@" + groupName).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(testUser, "password")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").put(Entity.form(new Form()));
+        Response response = target().path(API_VERSION).path("group")
+                .path("@" + groupName).request()
+                .header(Attributes.AUTHORIZATION,
+                        HttpAuthorizationHandler
+                                .createBasicAuthorizationHeaderValue(testUser,
+                                        "password"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .put(Entity.form(new Form()));
         assertEquals(Status.CREATED.getStatusCode(), response.getStatus());
         // list user group
         JsonNode node = listGroup(testUser);
@@ -150,22 +208,38 @@
         testDeleteGroup(groupName);
     }
 
-    private void testMemberRole(String memberUsername, String groupName) throws ProcessingException, KustvaktException {
+    private void testMemberRole (String memberUsername, String groupName)
+            throws ProcessingException, KustvaktException {
         // accept invitation
-        Response response = target().path(API_VERSION).path("group").path("@" + groupName).path("subscribe").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(memberUsername, "pass")).post(Entity.form(new Form()));
+        Response response = target().path(API_VERSION).path("group")
+                .path("@" + groupName).path("subscribe").request()
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(Attributes.AUTHORIZATION,
+                        HttpAuthorizationHandler
+                                .createBasicAuthorizationHeaderValue(
+                                        memberUsername, "pass"))
+                .post(Entity.form(new Form()));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         testAddMemberRoles(groupName, memberUsername);
         testDeleteMemberRoles(groupName, memberUsername);
     }
 
-    private void testAddMemberRoles(String groupName, String memberUsername) throws ProcessingException, KustvaktException {
+    private void testAddMemberRoles (String groupName, String memberUsername)
+            throws ProcessingException, KustvaktException {
         Form form = new Form();
         form.param("memberUsername", memberUsername);
         // USER_GROUP_ADMIN
         form.param("roleId", "1");
         // USER_GROUP_MEMBER
         form.param("roleId", "2");
-        Response response = target().path(API_VERSION).path("group").path("@" + groupName).path("role").path("add").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(sysAdminUser, "password")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("group")
+                .path("@" + groupName).path("role").path("add").request()
+                .header(Attributes.AUTHORIZATION,
+                        HttpAuthorizationHandler
+                                .createBasicAuthorizationHeaderValue(
+                                        sysAdminUser, "password"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .post(Entity.form(form));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         JsonNode node = retrieveGroup(groupName).at("/members");
         JsonNode member;
@@ -173,18 +247,27 @@
             member = node.get(i);
             if (member.at("/userId").asText().equals(memberUsername)) {
                 assertEquals(3, member.at("/roles").size());
-                assertEquals(PredefinedRole.USER_GROUP_ADMIN.name(), member.at("/roles/0").asText());
+                assertEquals(PredefinedRole.USER_GROUP_ADMIN.name(),
+                        member.at("/roles/0").asText());
                 break;
             }
         }
     }
 
-    private void testDeleteMemberRoles(String groupName, String memberUsername) throws ProcessingException, KustvaktException {
+    private void testDeleteMemberRoles (String groupName, String memberUsername)
+            throws ProcessingException, KustvaktException {
         Form form = new Form();
         form.param("memberUsername", memberUsername);
         // USER_GROUP_ADMIN
         form.param("roleId", "1");
-        Response response = target().path(API_VERSION).path("group").path("@" + groupName).path("role").path("delete").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(sysAdminUser, "password")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("group")
+                .path("@" + groupName).path("role").path("delete").request()
+                .header(Attributes.AUTHORIZATION,
+                        HttpAuthorizationHandler
+                                .createBasicAuthorizationHeaderValue(
+                                        sysAdminUser, "password"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .post(Entity.form(form));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         JsonNode node = retrieveGroup(groupName).at("/members");
         JsonNode member;
@@ -197,46 +280,77 @@
         }
     }
 
-    private JsonNode retrieveGroup(String groupName) throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("admin").path("group").path("@" + groupName).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(sysAdminUser, "pass")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").post(null);
+    private JsonNode retrieveGroup (String groupName)
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("admin")
+                .path("group").path("@" + groupName).request()
+                .header(Attributes.AUTHORIZATION,
+                        HttpAuthorizationHandler
+                                .createBasicAuthorizationHeaderValue(
+                                        sysAdminUser, "pass"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").post(null);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         return node;
     }
 
-    private void testDeleteGroup(String groupName) throws ProcessingException, KustvaktException {
+    private void testDeleteGroup (String groupName)
+            throws ProcessingException, KustvaktException {
         // delete group
-        Response response = target().path(API_VERSION).path("group").path("@" + groupName).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(sysAdminUser, "pass")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").delete();
+        Response response = target().path(API_VERSION).path("group")
+                .path("@" + groupName).request()
+                .header(Attributes.AUTHORIZATION,
+                        HttpAuthorizationHandler
+                                .createBasicAuthorizationHeaderValue(
+                                        sysAdminUser, "pass"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").delete();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         // check group
         JsonNode node = listGroup(testUser);
         assertEquals(0, node.size());
     }
 
-    private void testDeleteMember(String groupName) throws ProcessingException, KustvaktException {
+    private void testDeleteMember (String groupName)
+            throws ProcessingException, KustvaktException {
         // delete marlin from group
-        Response response = target().path(API_VERSION).path("group").path("@" + groupName).path("~marlin").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(sysAdminUser, "pass")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").delete();
+        Response response = target().path(API_VERSION).path("group")
+                .path("@" + groupName).path("~marlin").request()
+                .header(Attributes.AUTHORIZATION,
+                        HttpAuthorizationHandler
+                                .createBasicAuthorizationHeaderValue(
+                                        sysAdminUser, "pass"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").delete();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         // check group member
         JsonNode node = listGroup(testUser);
         node = node.get(0);
         assertEquals(3, node.get("members").size());
         assertEquals(node.at("/members/1/userId").asText(), "nemo");
-        assertEquals(GroupMemberStatus.PENDING.name(), node.at("/members/1/status").asText());
+        assertEquals(GroupMemberStatus.PENDING.name(),
+                node.at("/members/1/status").asText());
     }
 
-    private void testInviteMember(String groupName) throws ProcessingException, KustvaktException {
+    private void testInviteMember (String groupName)
+            throws ProcessingException, KustvaktException {
         Form form = new Form();
         form.param("members", "marlin,nemo,darla");
-        Response response = target().path(API_VERSION).path("group").path("@" + groupName).path("invite").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(sysAdminUser, "pass")).post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("group")
+                .path("@" + groupName).path("invite").request()
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(Attributes.AUTHORIZATION,
+                        HttpAuthorizationHandler
+                                .createBasicAuthorizationHeaderValue(
+                                        sysAdminUser, "pass"))
+                .post(Entity.form(form));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         // list group
         JsonNode node = listGroup(testUser);
         node = node.get(0);
         assertEquals(4, node.get("members").size());
         assertEquals(node.at("/members/3/userId").asText(), "darla");
-        assertEquals(GroupMemberStatus.PENDING.name(), node.at("/members/1/status").asText());
+        assertEquals(GroupMemberStatus.PENDING.name(),
+                node.at("/members/1/status").asText());
         assertEquals(0, node.at("/members/1/roles").size());
     }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/UserGroupControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/UserGroupControllerTest.java
index 52e3bb3..5495c85 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/UserGroupControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/UserGroupControllerTest.java
@@ -40,22 +40,33 @@
 
     private String admin = "admin";
 
-    private JsonNode retrieveUserGroups(String username) throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("group").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
+    private JsonNode retrieveUserGroups (String username)
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("group").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
         String entity = response.readEntity(String.class);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         return JsonUtils.readTree(entity);
     }
 
-    private void deleteGroupByName(String groupName) throws KustvaktException {
-        Response response = target().path(API_VERSION).path("group").path("@" + groupName).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").delete();
+    private void deleteGroupByName (String groupName) throws KustvaktException {
+        Response response = target().path(API_VERSION).path("group")
+                .path("@" + groupName).request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").delete();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
     }
 
     // dory is a group admin in dory-group
     @Test
-    public void testListDoryGroups() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("group").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("dory", "pass")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
+    public void testListDoryGroups () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("group").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("dory", "pass"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
         String entity = response.readEntity(String.class);
         // System.out.println(entity);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
@@ -69,8 +80,11 @@
 
     // nemo is a group member in dory-group
     @Test
-    public void testListNemoGroups() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("group").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("nemo", "pass")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
+    public void testListNemoGroups () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("group").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("nemo", "pass"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
         String entity = response.readEntity(String.class);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         // System.out.println(entity);
@@ -84,8 +98,11 @@
 
     // marlin has 2 groups
     @Test
-    public void testListMarlinGroups() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("group").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("marlin", "pass")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
+    public void testListMarlinGroups () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("group").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("marlin", "pass"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
         String entity = response.readEntity(String.class);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(entity);
@@ -93,17 +110,21 @@
     }
 
     @Test
-    public void testListGroupGuest() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("group").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
+    public void testListGroupGuest () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("group").request()
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
-        assertEquals(StatusCodes.AUTHORIZATION_FAILED, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "Unauthorized operation for user: guest");
+        assertEquals(StatusCodes.AUTHORIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Unauthorized operation for user: guest");
     }
 
     @Test
-    public void testCreateGroupEmptyDescription() throws ProcessingException, KustvaktException {
+    public void testCreateGroupEmptyDescription ()
+            throws ProcessingException, KustvaktException {
         String groupName = "empty_group";
         Response response = testCreateUserGroup(groupName, "");
         assertEquals(Status.CREATED.getStatusCode(), response.getStatus());
@@ -111,50 +132,68 @@
     }
 
     @Test
-    public void testCreateGroupMissingDescription() throws ProcessingException, KustvaktException {
+    public void testCreateGroupMissingDescription ()
+            throws ProcessingException, KustvaktException {
         String groupName = "missing-desc-group";
         Response response = testCreateGroupWithoutDescription(groupName);
         assertEquals(Status.CREATED.getStatusCode(), response.getStatus());
         deleteGroupByName(groupName);
     }
 
-    private Response testCreateUserGroup(String groupName, String description) throws ProcessingException, KustvaktException {
+    private Response testCreateUserGroup (String groupName, String description)
+            throws ProcessingException, KustvaktException {
         Form form = new Form();
         form.param("description", description);
-        Response response = target().path(API_VERSION).path("group").path("@" + groupName).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").put(Entity.form(form));
+        Response response = target().path(API_VERSION).path("group")
+                .path("@" + groupName).request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .put(Entity.form(form));
         return response;
     }
 
-    private Response testCreateGroupWithoutDescription(String groupName) throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("group").path("@" + groupName).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").put(Entity.form(new Form()));
+    private Response testCreateGroupWithoutDescription (String groupName)
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("group")
+                .path("@" + groupName).request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .put(Entity.form(new Form()));
         return response;
     }
 
     @Test
-    public void testCreateGroupInvalidName() throws ProcessingException, KustvaktException {
+    public void testCreateGroupInvalidName ()
+            throws ProcessingException, KustvaktException {
         String groupName = "invalid-group-name$";
         Response response = testCreateGroupWithoutDescription(groupName);
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
-        assertEquals(StatusCodes.INVALID_ARGUMENT, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.INVALID_ARGUMENT,
+                node.at("/errors/0/0").asInt());
         // assertEquals("User-group name must only contains letters, numbers, "
         // + "underscores, hypens and spaces", node.at("/errors/0/1").asText());
         assertEquals(node.at("/errors/0/2").asText(), "invalid-group-name$");
     }
 
     @Test
-    public void testCreateGroupNameTooShort() throws ProcessingException, KustvaktException {
+    public void testCreateGroupNameTooShort ()
+            throws ProcessingException, KustvaktException {
         String groupName = "a";
         Response response = testCreateGroupWithoutDescription(groupName);
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
-        assertEquals(StatusCodes.INVALID_ARGUMENT, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "groupName must contain at least 3 characters");
+        assertEquals(StatusCodes.INVALID_ARGUMENT,
+                node.at("/errors/0/0").asInt());
+        assertEquals(node.at("/errors/0/1").asText(),
+                "groupName must contain at least 3 characters");
         assertEquals(node.at("/errors/0/2").asText(), "groupName");
     }
 
     @Test
-    public void testUserGroup() throws ProcessingException, KustvaktException {
+    public void testUserGroup () throws ProcessingException, KustvaktException {
         String groupName = "new-user-group";
         String description = "This is new-user-group.";
         Response response = testCreateUserGroup(groupName, description);
@@ -171,9 +210,12 @@
         assertEquals(username, node.get("owner").asText());
         assertEquals(1, node.get("members").size());
         assertEquals(username, node.at("/members/0/userId").asText());
-        assertEquals(GroupMemberStatus.ACTIVE.name(), node.at("/members/0/status").asText());
-        assertEquals(PredefinedRole.VC_ACCESS_ADMIN.name(), node.at("/members/0/roles/1").asText());
-        assertEquals(PredefinedRole.USER_GROUP_ADMIN.name(), node.at("/members/0/roles/0").asText());
+        assertEquals(GroupMemberStatus.ACTIVE.name(),
+                node.at("/members/0/status").asText());
+        assertEquals(PredefinedRole.VC_ACCESS_ADMIN.name(),
+                node.at("/members/0/roles/1").asText());
+        assertEquals(PredefinedRole.USER_GROUP_ADMIN.name(),
+                node.at("/members/0/roles/0").asText());
         testUpdateUserGroup(groupName);
         testInviteMember(groupName);
         testDeleteMemberUnauthorized(groupName);
@@ -183,7 +225,8 @@
         testUnsubscribeToDeletedGroup(groupName);
     }
 
-    private void testUpdateUserGroup(String groupName) throws ProcessingException, KustvaktException {
+    private void testUpdateUserGroup (String groupName)
+            throws ProcessingException, KustvaktException {
         String description = "Description is updated.";
         Response response = testCreateUserGroup(groupName, description);
         assertEquals(Status.NO_CONTENT.getStatusCode(), response.getStatus());
@@ -192,32 +235,52 @@
         assertEquals(description, node.get(0).get("description").asText());
     }
 
-    private void testDeleteMember(String groupName) throws ProcessingException, KustvaktException {
+    private void testDeleteMember (String groupName)
+            throws ProcessingException, KustvaktException {
         // delete darla from group
-        Response response = target().path(API_VERSION).path("group").path("@" + groupName).path("~darla").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").delete();
+        Response response = target().path(API_VERSION).path("group")
+                .path("@" + groupName).path("~darla").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").delete();
         // check group member
-        response = target().path(API_VERSION).path("group").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
+        response = target().path(API_VERSION).path("group").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         node = node.get(0);
         assertEquals(1, node.get("members").size());
     }
 
-    private void testDeleteMemberUnauthorized(String groupName) throws ProcessingException, KustvaktException {
+    private void testDeleteMemberUnauthorized (String groupName)
+            throws ProcessingException, KustvaktException {
         // nemo is a group member
-        Response response = target().path(API_VERSION).path("group").path("@" + groupName).path("~darla").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("nemo", "pass")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").delete();
+        Response response = target().path(API_VERSION).path("group")
+                .path("@" + groupName).path("~darla").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("nemo", "pass"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").delete();
         String entity = response.readEntity(String.class);
         // System.out.println(entity);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
-        assertEquals(StatusCodes.AUTHORIZATION_FAILED, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "Unauthorized operation for user: nemo");
+        assertEquals(StatusCodes.AUTHORIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Unauthorized operation for user: nemo");
     }
 
     // EM: same as cancel invitation
-    private void testDeletePendingMember() throws ProcessingException, KustvaktException {
+    private void testDeletePendingMember ()
+            throws ProcessingException, KustvaktException {
         // dory delete pearl
-        Response response = target().path(API_VERSION).path("group").path("@dory-group").path("~pearl").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("dory", "pass")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").delete();
+        Response response = target().path(API_VERSION).path("group")
+                .path("@dory-group").path("~pearl").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("dory", "pass"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").delete();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         // check member
         JsonNode node = retrieveUserGroups("pearl");
@@ -225,20 +288,32 @@
     }
 
     @Test
-    public void testDeleteDeletedMember() throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("group").path("@dory-group").path("~pearl").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("dory", "pass")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").delete();
+    public void testDeleteDeletedMember ()
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("group")
+                .path("@dory-group").path("~pearl").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("dory", "pass"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").delete();
         String entity = response.readEntity(String.class);
         // System.out.println(entity);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
-        assertEquals(StatusCodes.GROUP_MEMBER_DELETED, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "pearl has already been deleted from the group dory-group");
+        assertEquals(StatusCodes.GROUP_MEMBER_DELETED,
+                node.at("/errors/0/0").asInt());
+        assertEquals(node.at("/errors/0/1").asText(),
+                "pearl has already been deleted from the group dory-group");
         assertEquals(node.at("/errors/0/2").asText(), "[pearl, dory-group]");
     }
 
-    private void testDeleteGroup(String groupName) throws ProcessingException, KustvaktException {
+    private void testDeleteGroup (String groupName)
+            throws ProcessingException, KustvaktException {
         // delete group
-        Response response = target().path(API_VERSION).path("group").path("@" + groupName).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").delete();
+        Response response = target().path(API_VERSION).path("group")
+                .path("@" + groupName).request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").delete();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         Form f = new Form();
         f.param("username", username);
@@ -246,7 +321,13 @@
         // EM: this is so complicated because the group retrieval are not allowed
         // for delete groups
         // check group
-        response = target().path(API_VERSION).path("admin").path("group").path("list").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(admin, "pass")).header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED).post(Entity.form(f));
+        response = target().path(API_VERSION).path("admin").path("group")
+                .path("list").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(admin, "pass"))
+                .header(HttpHeaders.CONTENT_TYPE,
+                        MediaType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(f));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -254,136 +335,214 @@
             JsonNode group = node.get(j);
             // check group members
             for (int i = 0; i < group.at("/0/members").size(); i++) {
-                assertEquals(GroupMemberStatus.DELETED.name(), group.at("/0/members/" + i + "/status").asText());
+                assertEquals(GroupMemberStatus.DELETED.name(),
+                        group.at("/0/members/" + i + "/status").asText());
             }
         }
     }
 
     @Test
-    public void testDeleteGroupUnauthorized() throws ProcessingException, KustvaktException {
+    public void testDeleteGroupUnauthorized ()
+            throws ProcessingException, KustvaktException {
         // dory is a group admin in marlin-group
-        Response response = target().path(API_VERSION).path("group").path("@marlin-group").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("dory", "pass")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").delete();
+        Response response = target().path(API_VERSION).path("group")
+                .path("@marlin-group").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("dory", "pass"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").delete();
         String entity = response.readEntity(String.class);
         // System.out.println(entity);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
-        assertEquals(StatusCodes.AUTHORIZATION_FAILED, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "Unauthorized operation for user: dory");
+        assertEquals(StatusCodes.AUTHORIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Unauthorized operation for user: dory");
     }
 
     @Test
-    public void testDeleteDeletedGroup() throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("group").path("@deleted-group").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("dory", "pass")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").delete();
+    public void testDeleteDeletedGroup ()
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("group")
+                .path("@deleted-group").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("dory", "pass"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").delete();
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(StatusCodes.GROUP_DELETED, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "Group deleted-group has been deleted.");
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Group deleted-group has been deleted.");
         assertEquals(node.at("/errors/0/2").asText(), "deleted-group");
     }
 
     @Test
-    public void testDeleteGroupOwner() throws ProcessingException, KustvaktException {
+    public void testDeleteGroupOwner ()
+            throws ProcessingException, KustvaktException {
         // delete marlin from marlin-group
         // dory is a group admin in marlin-group
-        Response response = target().path(API_VERSION).path("group").path("@marlin-group").path("~marlin").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("dory", "pass")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").delete();
+        Response response = target().path(API_VERSION).path("group")
+                .path("@marlin-group").path("~marlin").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("dory", "pass"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").delete();
         String entity = response.readEntity(String.class);
         // System.out.println(entity);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         assertEquals(StatusCodes.NOT_ALLOWED, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "Operation 'delete group owner'is not allowed.");
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Operation 'delete group owner'is not allowed.");
     }
 
-    private void testInviteMember(String groupName) throws ProcessingException, KustvaktException {
+    private void testInviteMember (String groupName)
+            throws ProcessingException, KustvaktException {
         Form form = new Form();
         form.param("members", "darla");
-        Response response = target().path(API_VERSION).path("group").path("@" + groupName).path("invite").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("group")
+                .path("@" + groupName).path("invite").request()
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .post(Entity.form(form));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         // list group
-        response = target().path(API_VERSION).path("group").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
+        response = target().path(API_VERSION).path("group").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         node = node.get(0);
         assertEquals(2, node.get("members").size());
         assertEquals(node.at("/members/1/userId").asText(), "darla");
-        assertEquals(GroupMemberStatus.PENDING.name(), node.at("/members/1/status").asText());
+        assertEquals(GroupMemberStatus.PENDING.name(),
+                node.at("/members/1/status").asText());
         assertEquals(0, node.at("/members/1/roles").size());
     }
 
-    private void testInviteDeletedMember() throws ProcessingException, KustvaktException {
+    private void testInviteDeletedMember ()
+            throws ProcessingException, KustvaktException {
         Form form = new Form();
         form.param("members", "marlin");
-        Response response = target().path(API_VERSION).path("group").path("@dory-group").path("invite").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("dory", "pass")).post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("group")
+                .path("@dory-group").path("invite").request()
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("dory", "pass"))
+                .post(Entity.form(form));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         // check member
         JsonNode node = retrieveUserGroups("marlin");
         assertEquals(2, node.size());
         JsonNode group = node.get(1);
-        assertEquals(GroupMemberStatus.PENDING.name(), group.at("/userMemberStatus").asText());
+        assertEquals(GroupMemberStatus.PENDING.name(),
+                group.at("/userMemberStatus").asText());
     }
 
     @Test
-    public void testInviteDeletedMember2() throws ProcessingException, KustvaktException {
+    public void testInviteDeletedMember2 ()
+            throws ProcessingException, KustvaktException {
         // pearl has status deleted in dory-group
         Form form = new Form();
         form.param("members", "pearl");
-        Response response = target().path(API_VERSION).path("group").path("@dory-group").path("invite").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("dory", "pass")).post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("group")
+                .path("@dory-group").path("invite").request()
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("dory", "pass"))
+                .post(Entity.form(form));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         // check member
         JsonNode node = retrieveUserGroups("pearl");
         assertEquals(1, node.size());
         JsonNode group = node.get(0);
-        assertEquals(GroupMemberStatus.PENDING.name(), group.at("/userMemberStatus").asText());
+        assertEquals(GroupMemberStatus.PENDING.name(),
+                group.at("/userMemberStatus").asText());
         testDeletePendingMember();
     }
 
     @Test
-    public void testInvitePendingMember() throws ProcessingException, KustvaktException {
+    public void testInvitePendingMember ()
+            throws ProcessingException, KustvaktException {
         // marlin has status PENDING in dory-group
         Form form = new Form();
         form.param("members", "marlin");
-        Response response = target().path(API_VERSION).path("group").path("@dory-group").path("invite").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("dory", "pass")).post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("group")
+                .path("@dory-group").path("invite").request()
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("dory", "pass"))
+                .post(Entity.form(form));
         String entity = response.readEntity(String.class);
         // System.out.println(entity);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
-        assertEquals(StatusCodes.GROUP_MEMBER_EXISTS, node.at("/errors/0/0").asInt());
-        assertEquals("Username marlin with status PENDING exists in the user-group " + "dory-group", node.at("/errors/0/1").asText());
-        assertEquals(node.at("/errors/0/2").asText(), "[marlin, PENDING, dory-group]");
+        assertEquals(StatusCodes.GROUP_MEMBER_EXISTS,
+                node.at("/errors/0/0").asInt());
+        assertEquals(
+                "Username marlin with status PENDING exists in the user-group "
+                        + "dory-group",
+                node.at("/errors/0/1").asText());
+        assertEquals(node.at("/errors/0/2").asText(),
+                "[marlin, PENDING, dory-group]");
     }
 
     @Test
-    public void testInviteActiveMember() throws ProcessingException, KustvaktException {
+    public void testInviteActiveMember ()
+            throws ProcessingException, KustvaktException {
         // nemo has status active in dory-group
         Form form = new Form();
         form.param("members", "nemo");
-        Response response = target().path(API_VERSION).path("group").path("@dory-group").path("invite").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("dory", "pass")).post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("group")
+                .path("@dory-group").path("invite").request()
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("dory", "pass"))
+                .post(Entity.form(form));
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.GROUP_MEMBER_EXISTS, node.at("/errors/0/0").asInt());
-        assertEquals("Username nemo with status ACTIVE exists in the user-group " + "dory-group", node.at("/errors/0/1").asText());
-        assertEquals(node.at("/errors/0/2").asText(), "[nemo, ACTIVE, dory-group]");
+        assertEquals(StatusCodes.GROUP_MEMBER_EXISTS,
+                node.at("/errors/0/0").asInt());
+        assertEquals(
+                "Username nemo with status ACTIVE exists in the user-group "
+                        + "dory-group",
+                node.at("/errors/0/1").asText());
+        assertEquals(node.at("/errors/0/2").asText(),
+                "[nemo, ACTIVE, dory-group]");
     }
 
     @Test
-    public void testInviteMemberToDeletedGroup() throws ProcessingException, KustvaktException {
+    public void testInviteMemberToDeletedGroup ()
+            throws ProcessingException, KustvaktException {
         Form form = new Form();
         form.param("members", "nemo");
-        Response response = target().path(API_VERSION).path("group").path("@deleted-group").path("invite").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("dory", "pass")).post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("group")
+                .path("@deleted-group").path("invite").request()
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("dory", "pass"))
+                .post(Entity.form(form));
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(StatusCodes.GROUP_DELETED, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "Group deleted-group has been deleted.");
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Group deleted-group has been deleted.");
         assertEquals(node.at("/errors/0/2").asText(), "deleted-group");
     }
 
     // marlin has GroupMemberStatus.PENDING in dory-group
     @Test
-    public void testSubscribePendingMember() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("group").path("@dory-group").path("subscribe").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("marlin", "pass")).post(Entity.form(new Form()));
+    public void testSubscribePendingMember () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("group")
+                .path("@dory-group").path("subscribe").request()
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("marlin", "pass"))
+                .post(Entity.form(new Form()));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         // retrieve marlin group
         JsonNode node = retrieveUserGroups("marlin");
@@ -395,9 +554,12 @@
         assertEquals(group.at("/owner").asText(), "dory");
         // group members are not allowed to see other members
         assertEquals(0, group.at("/members").size());
-        assertEquals(GroupMemberStatus.ACTIVE.name(), group.at("/userMemberStatus").asText());
-        assertEquals(PredefinedRole.VC_ACCESS_MEMBER.name(), group.at("/userRoles/1").asText());
-        assertEquals(PredefinedRole.USER_GROUP_MEMBER.name(), group.at("/userRoles/0").asText());
+        assertEquals(GroupMemberStatus.ACTIVE.name(),
+                group.at("/userMemberStatus").asText());
+        assertEquals(PredefinedRole.VC_ACCESS_MEMBER.name(),
+                group.at("/userRoles/1").asText());
+        assertEquals(PredefinedRole.USER_GROUP_MEMBER.name(),
+                group.at("/userRoles/0").asText());
         // unsubscribe marlin from dory-group
         testUnsubscribeActiveMember("dory-group");
         checkGroupMemberRole("dory-group", "marlin");
@@ -408,60 +570,104 @@
 
     // pearl has GroupMemberStatus.DELETED in dory-group
     @Test
-    public void testSubscribeDeletedMember() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("group").path("@dory-group").path("subscribe").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("pearl", "pass")).post(Entity.form(new Form()));
+    public void testSubscribeDeletedMember () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("group")
+                .path("@dory-group").path("subscribe").request()
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("pearl", "pass"))
+                .post(Entity.form(new Form()));
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
-        assertEquals(StatusCodes.GROUP_MEMBER_DELETED, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "pearl has already been deleted from the group dory-group");
+        assertEquals(StatusCodes.GROUP_MEMBER_DELETED,
+                node.at("/errors/0/0").asInt());
+        assertEquals(node.at("/errors/0/1").asText(),
+                "pearl has already been deleted from the group dory-group");
     }
 
     @Test
-    public void testSubscribeMissingGroupName() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("group").path("subscribe").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("bruce", "pass")).post(Entity.form(new Form()));
+    public void testSubscribeMissingGroupName () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("group")
+                .path("subscribe").request()
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("bruce", "pass"))
+                .post(Entity.form(new Form()));
         assertEquals(Status.NOT_FOUND.getStatusCode(), response.getStatus());
     }
 
     @Test
-    public void testSubscribeNonExistentMember() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("group").path("@dory-group").path("subscribe").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("bruce", "pass")).post(Entity.form(new Form()));
+    public void testSubscribeNonExistentMember () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("group")
+                .path("@dory-group").path("subscribe").request()
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("bruce", "pass"))
+                .post(Entity.form(new Form()));
         String entity = response.readEntity(String.class);
         // System.out.println(entity);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
-        assertEquals(StatusCodes.GROUP_MEMBER_NOT_FOUND, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "bruce is not found in the group");
+        assertEquals(StatusCodes.GROUP_MEMBER_NOT_FOUND,
+                node.at("/errors/0/0").asInt());
+        assertEquals(node.at("/errors/0/1").asText(),
+                "bruce is not found in the group");
     }
 
     @Test
-    public void testSubscribeToNonExistentGroup() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("group").path("@non-existent").path("subscribe").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("pearl", "pass")).post(Entity.form(new Form()));
+    public void testSubscribeToNonExistentGroup () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("group")
+                .path("@non-existent").path("subscribe").request()
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("pearl", "pass"))
+                .post(Entity.form(new Form()));
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(Status.NOT_FOUND.getStatusCode(), response.getStatus());
-        assertEquals(StatusCodes.NO_RESOURCE_FOUND, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "Group non-existent is not found");
+        assertEquals(StatusCodes.NO_RESOURCE_FOUND,
+                node.at("/errors/0/0").asInt());
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Group non-existent is not found");
     }
 
-    private void testSubscribeToDeletedGroup(String groupName) throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("group").path("@" + groupName).path("subscribe").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("nemo", "pass")).post(Entity.form(new Form()));
+    private void testSubscribeToDeletedGroup (String groupName)
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("group")
+                .path("@" + groupName).path("subscribe").request()
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("nemo", "pass"))
+                .post(Entity.form(new Form()));
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(StatusCodes.GROUP_DELETED, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "Group new-user-group has been deleted.");
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Group new-user-group has been deleted.");
     }
 
-    private void testUnsubscribeActiveMember(String groupName) throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("group").path("@" + groupName).path("unsubscribe").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("marlin", "pass")).delete();
+    private void testUnsubscribeActiveMember (String groupName)
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("group")
+                .path("@" + groupName).path("unsubscribe").request()
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("marlin", "pass"))
+                .delete();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         JsonNode node = retrieveUserGroups("marlin");
         assertEquals(1, node.size());
     }
 
-    private void checkGroupMemberRole(String groupName, String deletedMemberName) throws KustvaktException {
-        Response response = target().path(API_VERSION).path("admin").path("group").path("@" + groupName).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(admin, "pass")).post(null);
+    private void checkGroupMemberRole (String groupName,
+            String deletedMemberName) throws KustvaktException {
+        Response response = target().path(API_VERSION).path("admin")
+                .path("group").path("@" + groupName).request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(admin, "pass"))
+                .post(null);
         String entity = response.readEntity(String.class);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(entity).at("/members");
@@ -476,23 +682,37 @@
     }
 
     @Test
-    public void testUnsubscribeDeletedMember() throws ProcessingException, KustvaktException {
+    public void testUnsubscribeDeletedMember ()
+            throws ProcessingException, KustvaktException {
         // pearl unsubscribes from dory-group
-        Response response = target().path(API_VERSION).path("group").path("@dory-group").path("unsubscribe").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("pearl", "pass")).delete();
+        Response response = target().path(API_VERSION).path("group")
+                .path("@dory-group").path("unsubscribe").request()
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("pearl", "pass"))
+                .delete();
         String entity = response.readEntity(String.class);
         // System.out.println(entity);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
-        assertEquals(StatusCodes.GROUP_MEMBER_DELETED, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "pearl has already been deleted from the group dory-group");
+        assertEquals(StatusCodes.GROUP_MEMBER_DELETED,
+                node.at("/errors/0/0").asInt());
+        assertEquals(node.at("/errors/0/1").asText(),
+                "pearl has already been deleted from the group dory-group");
         assertEquals(node.at("/errors/0/2").asText(), "[pearl, dory-group]");
     }
 
     @Test
-    public void testUnsubscribePendingMember() throws ProcessingException, KustvaktException {
+    public void testUnsubscribePendingMember ()
+            throws ProcessingException, KustvaktException {
         JsonNode node = retrieveUserGroups("marlin");
         assertEquals(2, node.size());
-        Response response = target().path(API_VERSION).path("group").path("@dory-group").path("unsubscribe").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("marlin", "pass")).delete();
+        Response response = target().path(API_VERSION).path("group")
+                .path("@dory-group").path("unsubscribe").request()
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("marlin", "pass"))
+                .delete();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         node = retrieveUserGroups("marlin");
         assertEquals(1, node.size());
@@ -502,46 +722,77 @@
     }
 
     @Test
-    public void testUnsubscribeMissingGroupName() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("group").path("unsubscribe").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("marlin", "pass")).delete();
+    public void testUnsubscribeMissingGroupName () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("group")
+                .path("unsubscribe").request()
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("marlin", "pass"))
+                .delete();
         assertEquals(Status.NOT_FOUND.getStatusCode(), response.getStatus());
     }
 
     @Test
-    public void testUnsubscribeNonExistentMember() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("group").path("@dory-group").path("unsubscribe").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("bruce", "pass")).delete();
+    public void testUnsubscribeNonExistentMember () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("group")
+                .path("@dory-group").path("unsubscribe").request()
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("bruce", "pass"))
+                .delete();
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.GROUP_MEMBER_NOT_FOUND, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "bruce is not found in the group");
+        assertEquals(StatusCodes.GROUP_MEMBER_NOT_FOUND,
+                node.at("/errors/0/0").asInt());
+        assertEquals(node.at("/errors/0/1").asText(),
+                "bruce is not found in the group");
     }
 
     @Test
-    public void testUnsubscribeToNonExistentGroup() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("group").path("@tralala-group").path("unsubscribe").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("pearl", "pass")).delete();
+    public void testUnsubscribeToNonExistentGroup () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("group")
+                .path("@tralala-group").path("unsubscribe").request()
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("pearl", "pass"))
+                .delete();
         assertEquals(Status.NOT_FOUND.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.NO_RESOURCE_FOUND, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "Group tralala-group is not found");
+        assertEquals(StatusCodes.NO_RESOURCE_FOUND,
+                node.at("/errors/0/0").asInt());
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Group tralala-group is not found");
     }
 
-    private void testUnsubscribeToDeletedGroup(String groupName) throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("group").path("@" + groupName).path("unsubscribe").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("nemo", "pass")).delete();
+    private void testUnsubscribeToDeletedGroup (String groupName)
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("group")
+                .path("@" + groupName).path("unsubscribe").request()
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("nemo", "pass"))
+                .delete();
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(StatusCodes.GROUP_DELETED, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "Group new-user-group has been deleted.");
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Group new-user-group has been deleted.");
     }
 
     @Test
-    public void testAddSameMemberRole() throws ProcessingException, KustvaktException {
+    public void testAddSameMemberRole ()
+            throws ProcessingException, KustvaktException {
         Form form = new Form();
         form.param("memberUsername", "dory");
         form.param("roleId", "1");
-        Response response = target().path(API_VERSION).path("group").path("@marlin-group").path("role").path("add").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("marlin", "pass")).post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("group")
+                .path("@marlin-group").path("role").path("add").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("marlin", "pass"))
+                .post(Entity.form(form));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         UserGroupMember member = memberDao.retrieveMemberById("dory", 1);
         Set<Role> roles = member.getRoles();
@@ -549,11 +800,16 @@
     }
 
     @Test
-    public void testDeleteAddMemberRole() throws ProcessingException, KustvaktException {
+    public void testDeleteAddMemberRole ()
+            throws ProcessingException, KustvaktException {
         Form form = new Form();
         form.param("memberUsername", "dory");
         form.param("roleId", "1");
-        Response response = target().path(API_VERSION).path("group").path("@marlin-group").path("role").path("delete").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("marlin", "pass")).post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("group")
+                .path("@marlin-group").path("role").path("delete").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("marlin", "pass"))
+                .post(Entity.form(form));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         UserGroupMember member = memberDao.retrieveMemberById("dory", 1);
         Set<Role> roles = member.getRoles();
@@ -562,10 +818,15 @@
     }
 
     @Test
-    public void testEditMemberRoleEmpty() throws ProcessingException, KustvaktException {
+    public void testEditMemberRoleEmpty ()
+            throws ProcessingException, KustvaktException {
         Form form = new Form();
         form.param("memberUsername", "dory");
-        Response response = target().path(API_VERSION).path("group").path("@marlin-group").path("role").path("edit").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("marlin", "pass")).post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("group")
+                .path("@marlin-group").path("role").path("edit").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("marlin", "pass"))
+                .post(Entity.form(form));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         UserGroupMember member = memberDao.retrieveMemberById("dory", 1);
         Set<Role> roles = member.getRoles();
@@ -573,12 +834,17 @@
         testEditMemberRole();
     }
 
-    private void testEditMemberRole() throws ProcessingException, KustvaktException {
+    private void testEditMemberRole ()
+            throws ProcessingException, KustvaktException {
         Form form = new Form();
         form.param("memberUsername", "dory");
         form.param("roleId", "1");
         form.param("roleId", "3");
-        Response response = target().path(API_VERSION).path("group").path("@marlin-group").path("role").path("edit").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("marlin", "pass")).post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("group")
+                .path("@marlin-group").path("role").path("edit").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("marlin", "pass"))
+                .post(Entity.form(form));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         UserGroupMember member = memberDao.retrieveMemberById("dory", 1);
         Set<Role> roles = member.getRoles();
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/UserSettingControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/UserSettingControllerTest.java
index 7f7078e..176e31b 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/UserSettingControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/UserSettingControllerTest.java
@@ -30,18 +30,29 @@
 
     private String username2 = "UserSetting.Test2";
 
-    public Response sendPutRequest(String username, Map<String, Object> map) throws KustvaktException {
-        Response response = target().path(API_VERSION).path("~" + username).path("setting").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).put(Entity.json(map));
+    public Response sendPutRequest (String username, Map<String, Object> map)
+            throws KustvaktException {
+        Response response = target().path(API_VERSION).path("~" + username)
+                .path("setting").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .put(Entity.json(map));
         return response;
     }
 
     @Test
-    public void testCreateSettingWithJson() throws KustvaktException {
-        String json = "{\"pos-foundry\":\"opennlp\",\"metadata\":[\"author\", \"title\"," + "\"textSigle\", \"availability\"],\"resultPerPage\":25}";
-        Response response = target().path(API_VERSION).path("~" + username).path("setting").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).put(Entity.json(json));
+    public void testCreateSettingWithJson () throws KustvaktException {
+        String json = "{\"pos-foundry\":\"opennlp\",\"metadata\":[\"author\", \"title\","
+                + "\"textSigle\", \"availability\"],\"resultPerPage\":25}";
+        Response response = target().path(API_VERSION).path("~" + username)
+                .path("setting").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .put(Entity.json(json));
         assertEquals(Status.CREATED.getStatusCode(), response.getStatus());
         int numOfResult = 25;
-        String metadata = "[\"author\",\"title\",\"textSigle\"," + "\"availability\"]";
+        String metadata = "[\"author\",\"title\",\"textSigle\","
+                + "\"availability\"]";
         testRetrieveSettings(username, "opennlp", numOfResult, metadata, true);
         testDeleteKeyNotExist(username);
         testDeleteKey(username, numOfResult, metadata, true);
@@ -49,102 +60,151 @@
     }
 
     @Test
-    public void testCreateSettingWithMap() throws KustvaktException {
+    public void testCreateSettingWithMap () throws KustvaktException {
         Map<String, Object> map = new HashMap<>();
         map.put("pos-foundry", "opennlp");
         map.put("resultPerPage", 25);
         map.put("metadata", "author title textSigle availability");
         Response response = sendPutRequest(username2, map);
         assertEquals(Status.CREATED.getStatusCode(), response.getStatus());
-        testRetrieveSettings(username2, "opennlp", 25, "author title textSigle availability", false);
+        testRetrieveSettings(username2, "opennlp", 25,
+                "author title textSigle availability", false);
         testUpdateSetting(username2);
         testputRequestInvalidKey();
     }
 
     @Test
-    public void testputRequestInvalidKey() throws KustvaktException {
+    public void testputRequestInvalidKey () throws KustvaktException {
         Map<String, Object> map = new HashMap<>();
         map.put("key/", "invalidKey");
         Response response = sendPutRequest(username2, map);
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
-        assertEquals(StatusCodes.INVALID_ARGUMENT, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.INVALID_ARGUMENT,
+                node.at("/errors/0/0").asInt());
         assertEquals(node.at("/errors/0/2").asText(), "key/");
     }
 
     @Test
-    public void testPutDifferentUsername() throws KustvaktException {
-        String json = "{\"pos-foundry\":\"opennlp\",\"metadata\":\"author title " + "textSigle availability\",\"resultPerPage\":25}";
-        Response response = target().path(API_VERSION).path("~" + username).path("setting").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username2, "pass")).put(Entity.json(json));
+    public void testPutDifferentUsername () throws KustvaktException {
+        String json = "{\"pos-foundry\":\"opennlp\",\"metadata\":\"author title "
+                + "textSigle availability\",\"resultPerPage\":25}";
+        Response response = target().path(API_VERSION).path("~" + username)
+                .path("setting").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username2, "pass"))
+                .put(Entity.json(json));
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.INVALID_ARGUMENT, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.INVALID_ARGUMENT,
+                node.at("/errors/0/0").asInt());
     }
 
     @Test
-    public void testGetDifferentUsername() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("~" + username).path("setting").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username2, "pass")).get();
+    public void testGetDifferentUsername () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("~" + username)
+                .path("setting").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username2, "pass"))
+                .get();
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.INVALID_ARGUMENT, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.INVALID_ARGUMENT,
+                node.at("/errors/0/0").asInt());
     }
 
     @Test
-    public void testGetSettingNotExist() throws KustvaktException {
+    public void testGetSettingNotExist () throws KustvaktException {
         String username = "tralala";
-        Response response = target().path(API_VERSION).path("~" + username).path("setting").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).get();
+        Response response = target().path(API_VERSION).path("~" + username)
+                .path("setting").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .get();
         assertEquals(Status.NOT_FOUND.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.NO_RESOURCE_FOUND, node.at("/errors/0/0").asInt());
-        assertEquals("No default setting for username: " + username + " is found", node.at("/errors/0/1").asText());
+        assertEquals(StatusCodes.NO_RESOURCE_FOUND,
+                node.at("/errors/0/0").asInt());
+        assertEquals(
+                "No default setting for username: " + username + " is found",
+                node.at("/errors/0/1").asText());
         assertEquals(username, node.at("/errors/0/2").asText());
     }
 
     @Test
-    public void testDeleteSettingNotExist() throws KustvaktException {
+    public void testDeleteSettingNotExist () throws KustvaktException {
         String username = "tralala";
-        Response response = target().path(API_VERSION).path("~" + username).path("setting").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).delete();
+        Response response = target().path(API_VERSION).path("~" + username)
+                .path("setting").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .delete();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
     }
 
     @Test
-    public void testDeleteKeyDifferentUsername() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("~" + username).path("setting").path("pos-foundry").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username2, "pass")).delete();
+    public void testDeleteKeyDifferentUsername () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("~" + username)
+                .path("setting").path("pos-foundry").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username2, "pass"))
+                .delete();
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.INVALID_ARGUMENT, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.INVALID_ARGUMENT,
+                node.at("/errors/0/0").asInt());
     }
 
-    private void testDeleteSetting(String username) throws KustvaktException {
-        Response response = target().path(API_VERSION).path("~" + username).path("setting").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).delete();
+    private void testDeleteSetting (String username) throws KustvaktException {
+        Response response = target().path(API_VERSION).path("~" + username)
+                .path("setting").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .delete();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
-        response = target().path(API_VERSION).path("~" + username).path("setting").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
+        response = target().path(API_VERSION).path("~" + username)
+                .path("setting").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
         assertEquals(Status.NOT_FOUND.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.NO_RESOURCE_FOUND, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.NO_RESOURCE_FOUND,
+                node.at("/errors/0/0").asInt());
         assertEquals(username, node.at("/errors/0/2").asText());
     }
 
     // EM: deleting a non-existing key does not throw an error,
     // because
     // the purpose of the request has been achieved.
-    private void testDeleteKeyNotExist(String username) throws KustvaktException {
-        Response response = target().path(API_VERSION).path("~" + username).path("setting").path("lemma-foundry").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).delete();
+    private void testDeleteKeyNotExist (String username)
+            throws KustvaktException {
+        Response response = target().path(API_VERSION).path("~" + username)
+                .path("setting").path("lemma-foundry").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .delete();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
     }
 
-    private void testDeleteKey(String username, int numOfResult, String metadata, boolean isMetadataArray) throws KustvaktException {
-        Response response = target().path(API_VERSION).path("~" + username).path("setting").path("pos-foundry").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).delete();
+    private void testDeleteKey (String username, int numOfResult,
+            String metadata, boolean isMetadataArray) throws KustvaktException {
+        Response response = target().path(API_VERSION).path("~" + username)
+                .path("setting").path("pos-foundry").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .delete();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
-        testRetrieveSettings(username, null, numOfResult, metadata, isMetadataArray);
+        testRetrieveSettings(username, null, numOfResult, metadata,
+                isMetadataArray);
     }
 
-    private void testUpdateSetting(String username) throws KustvaktException {
+    private void testUpdateSetting (String username) throws KustvaktException {
         Map<String, Object> map = new HashMap<>();
         map.put("pos-foundry", "malt");
         map.put("resultPerPage", 15);
@@ -154,19 +214,27 @@
         testRetrieveSettings(username, "malt", 15, "author title", false);
     }
 
-    private void testRetrieveSettings(String username, String posFoundry, int numOfResult, String metadata, boolean isMetadataArray) throws KustvaktException {
-        Response response = target().path(API_VERSION).path("~" + username).path("setting").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
+    private void testRetrieveSettings (String username, String posFoundry,
+            int numOfResult, String metadata, boolean isMetadataArray)
+            throws KustvaktException {
+        Response response = target().path(API_VERSION).path("~" + username)
+                .path("setting").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         if (posFoundry == null) {
             assertTrue(node.at("/pos-foundry").isMissingNode());
-        } else {
+        }
+        else {
             assertEquals(posFoundry, node.at("/pos-foundry").asText());
         }
         assertEquals(numOfResult, node.at("/resultPerPage").asInt());
         if (isMetadataArray) {
             assertEquals(metadata, node.at("/metadata").toString());
-        } else {
+        }
+        else {
             assertEquals(metadata, node.at("/metadata").asText());
         }
     }
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/VCReferenceTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/VCReferenceTest.java
index 382535d..346b71d 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/VCReferenceTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/VCReferenceTest.java
@@ -45,15 +45,18 @@
      * @throws KustvaktException
      */
     @Test
-    public void testRefVcNotPrecached() throws KustvaktException {
+    public void testRefVcNotPrecached () throws KustvaktException {
         JsonNode node = testSearchWithRef_VC1();
-        assertEquals(StatusCodes.NO_RESOURCE_FOUND, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "Virtual corpus system/named-vc1 is not found.");
+        assertEquals(StatusCodes.NO_RESOURCE_FOUND,
+                node.at("/errors/0/0").asInt());
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Virtual corpus system/named-vc1 is not found.");
         assertEquals(node.at("/errors/0/2").asText(), "system/named-vc1");
     }
 
     @Test
-    public void testRefVcPrecached() throws KustvaktException, IOException, QueryException {
+    public void testRefVcPrecached ()
+            throws KustvaktException, IOException, QueryException {
         int numOfMatches = testSearchWithoutRef_VC1();
         vcLoader.loadVCToCache("named-vc1", "/vc/named-vc1.jsonld");
         assertTrue(VirtualCorpusCache.contains("named-vc1"));
@@ -77,8 +80,12 @@
         assertNull(vc);
     }
 
-    private int testSearchWithoutRef_VC1() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("cq", "textSigle=\"GOE/AGF/00000\" | textSigle=\"GOE/AGA/01784\"").request().get();
+    private int testSearchWithoutRef_VC1 () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("cq",
+                        "textSigle=\"GOE/AGF/00000\" | textSigle=\"GOE/AGA/01784\"")
+                .request().get();
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         int size = node.at("/matches").size();
@@ -86,8 +93,12 @@
         return size;
     }
 
-    private int testSearchWithoutRef_VC2() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("cq", "textSigle!=\"GOE/AGI/04846\" & textSigle!=\"GOE/AGA/01784\"").request().get();
+    private int testSearchWithoutRef_VC2 () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("cq",
+                        "textSigle!=\"GOE/AGI/04846\" & textSigle!=\"GOE/AGA/01784\"")
+                .request().get();
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         int size = node.at("/matches").size();
@@ -95,22 +106,28 @@
         return size;
     }
 
-    private JsonNode testSearchWithRef_VC1() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("cq", "referTo \"system/named-vc1\"").request().get();
+    private JsonNode testSearchWithRef_VC1 () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("cq", "referTo \"system/named-vc1\"").request()
+                .get();
         String ent = response.readEntity(String.class);
         return JsonUtils.readTree(ent);
     }
 
-    private JsonNode testSearchWithRef_VC2() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("cq", "referTo named-vc2").request().get();
+    private JsonNode testSearchWithRef_VC2 () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("cq", "referTo named-vc2").request().get();
         String ent = response.readEntity(String.class);
         return JsonUtils.readTree(ent);
     }
 
     @Test
-    public void testStatisticsWithRef() throws KustvaktException {
+    public void testStatisticsWithRef () throws KustvaktException {
         String corpusQuery = "availability = /CC-BY.*/ & referTo named-vc1";
-        Response response = target().path(API_VERSION).path("statistics").queryParam("corpusQuery", corpusQuery).request().get();
+        Response response = target().path(API_VERSION).path("statistics")
+                .queryParam("corpusQuery", corpusQuery).request().get();
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         assertEquals(2, node.at("/documents").asInt());
@@ -119,33 +136,45 @@
     }
 
     @Test
-    public void testRefVcNotExist() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("cq", "referTo \"username/vc1\"").request().get();
+    public void testRefVcNotExist () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("cq", "referTo \"username/vc1\"").request().get();
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
-        assertEquals(StatusCodes.NO_RESOURCE_FOUND, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.NO_RESOURCE_FOUND,
+                node.at("/errors/0/0").asInt());
         assertEquals(node.at("/errors/0/2").asText(), "username/vc1");
     }
 
     @Test
-    public void testRefNotAuthorized() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("cq", "referTo \"dory/dory-vc\"").request().get();
+    public void testRefNotAuthorized () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("cq", "referTo \"dory/dory-vc\"").request().get();
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
-        assertEquals(StatusCodes.AUTHORIZATION_FAILED, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.AUTHORIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
         assertEquals(node.at("/errors/0/2").asText(), "guest");
     }
 
     @Test
-    public void testSearchWithRefPublishedVcGuest() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("cq", "referTo \"marlin/published-vc\"").request().get();
+    public void testSearchWithRefPublishedVcGuest () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("cq", "referTo \"marlin/published-vc\"").request()
+                .get();
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         assertTrue(node.at("/matches").size() > 0);
-        assertEquals(node.at("/collection/operands/0/value").asText(), "CC-BY.*");
-        assertEquals(node.at("/collection/operands/1/@type").asText(), "koral:doc");
+        assertEquals(node.at("/collection/operands/0/value").asText(),
+                "CC-BY.*");
+        assertEquals(node.at("/collection/operands/1/@type").asText(),
+                "koral:doc");
         assertEquals(node.at("/collection/operands/1/value").asText(), "GOE");
-        assertEquals(node.at("/collection/operands/1/key").asText(), "corpusSigle");
+        assertEquals(node.at("/collection/operands/1/key").asText(),
+                "corpusSigle");
         node = node.at("/collection/operands/1/rewrites");
         assertEquals(3, node.size());
         assertEquals(node.at("/0/operation").asText(), "operation:deletion");
@@ -156,15 +185,26 @@
     }
 
     @Test
-    public void testSearchWithRefPublishedVc() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("cq", "referTo \"marlin/published-vc\"").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("squirt", "pass")).get();
+    public void testSearchWithRefPublishedVc () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("cq", "referTo \"marlin/published-vc\"").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("squirt", "pass"))
+                .get();
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         assertTrue(node.at("/matches").size() > 0);
         Form f = new Form();
         f.param("status", "HIDDEN");
         // check dory in the hidden group of the vc
-        response = target().path(API_VERSION).path("admin").path("group").path("list").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("admin", "pass")).header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED).post(Entity.form(f));
+        response = target().path(API_VERSION).path("admin").path("group")
+                .path("list").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("admin", "pass"))
+                .header(HttpHeaders.CONTENT_TYPE,
+                        MediaType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(f));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         node = JsonUtils.readTree(entity);
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusAccessTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusAccessTest.java
index beb1308..a1594fc 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusAccessTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusAccessTest.java
@@ -21,10 +21,12 @@
     private String testUser = "VirtualCorpusAccessTest";
 
     @Test
-    public void testlistAccessByNonVCAAdmin() throws KustvaktException {
+    public void testlistAccessByNonVCAAdmin () throws KustvaktException {
         JsonNode node = listAccessByGroup("nemo", "dory-group");
-        assertEquals(StatusCodes.AUTHORIZATION_FAILED, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "Unauthorized operation for user: nemo");
+        assertEquals(StatusCodes.AUTHORIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Unauthorized operation for user: nemo");
     }
 
     // @Test
@@ -48,8 +50,12 @@
     // assertEquals("vcId", node.at("/errors/0/1").asText());
     // }
     @Test
-    public void testlistAccessByGroup() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("vc").path("access").queryParam("groupName", "dory-group").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("dory", "pass")).get();
+    public void testlistAccessByGroup () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("vc").path("access")
+                .queryParam("groupName", "dory-group").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("dory", "pass"))
+                .get();
         String entity = response.readEntity(String.class);
         // System.out.println(entity);
         JsonNode node = JsonUtils.readTree(entity);
@@ -61,11 +67,14 @@
     }
 
     @Test
-    public void testDeleteSharedVC() throws KustvaktException {
-        String json = "{\"type\": \"PROJECT\"" + ",\"queryType\": \"VIRTUAL_CORPUS\"" + ",\"corpusQuery\": \"corpusSigle=GOE\"}";
+    public void testDeleteSharedVC () throws KustvaktException {
+        String json = "{\"type\": \"PROJECT\""
+                + ",\"queryType\": \"VIRTUAL_CORPUS\""
+                + ",\"corpusQuery\": \"corpusSigle=GOE\"}";
         String vcName = "new_project_vc";
         String username = "dory";
-        String authHeader = HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass");
+        String authHeader = HttpAuthorizationHandler
+                .createBasicAuthorizationHeaderValue(username, "pass");
         createVC(authHeader, username, vcName, json);
         String groupName = "dory-group";
         testShareVCByCreator(username, vcName, groupName);
@@ -78,7 +87,8 @@
     }
 
     @Test
-    public void testCreateDeleteAccess() throws ProcessingException, KustvaktException {
+    public void testCreateDeleteAccess ()
+            throws ProcessingException, KustvaktException {
         String vcName = "marlin-vc";
         String groupName = "marlin-group";
         // check the vc type
@@ -116,30 +126,40 @@
         String json = "{\"type\": \"" + ResourceType.PRIVATE + "\"}";
         editVC("marlin", "marlin", vcName, json);
         node = retrieveVCInfo("marlin", "marlin", vcName);
-        assertEquals(ResourceType.PRIVATE.displayName(), node.at("/type").asText());
+        assertEquals(ResourceType.PRIVATE.displayName(),
+                node.at("/type").asText());
     }
 
-    private void testShareVC_nonUniqueAccess(String vcCreator, String vcName, String groupName) throws ProcessingException, KustvaktException {
+    private void testShareVC_nonUniqueAccess (String vcCreator, String vcName,
+            String groupName) throws ProcessingException, KustvaktException {
         Response response = testShareVCByCreator(vcCreator, vcName, groupName);
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
         assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatus());
-        assertEquals(StatusCodes.DB_INSERT_FAILED, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.DB_INSERT_FAILED,
+                node.at("/errors/0/0").asInt());
         // EM: message differs depending on the database used
         // for testing. The message below is from sqlite.
         // assertTrue(node.at("/errors/0/1").asText()
         // .startsWith("[SQLITE_CONSTRAINT_UNIQUE]"));
     }
 
-    private Response testDeleteAccess(String username, String accessId) throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("vc").path("access").path(accessId).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).delete();
+    private Response testDeleteAccess (String username, String accessId)
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("vc").path("access")
+                .path(accessId).request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .delete();
         return response;
     }
 
     @Test
-    public void testDeleteNonExistingAccess() throws ProcessingException, KustvaktException {
+    public void testDeleteNonExistingAccess ()
+            throws ProcessingException, KustvaktException {
         Response response = testDeleteAccess("dory", "100");
         assertEquals(Status.NOT_FOUND.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
-        assertEquals(StatusCodes.NO_RESOURCE_FOUND, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.NO_RESOURCE_FOUND,
+                node.at("/errors/0/0").asInt());
     }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusClientTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusClientTest.java
index 225a331..a3b7e12 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusClientTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusClientTest.java
@@ -16,7 +16,7 @@
     private String username = "VirtualCorpusClientTest";
 
     @Test
-    public void testVC_withClient() throws KustvaktException {
+    public void testVC_withClient () throws KustvaktException {
         // create client
         Response response = registerConfidentialClient(username);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
@@ -24,20 +24,27 @@
         String clientId = node.at("/client_id").asText();
         String clientSecret = node.at("/client_secret").asText();
         // obtain authorization
-        String userAuthHeader = HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "password");
-        response = requestAuthorizationCode("code", clientId, clientRedirectUri, "create_vc vc_info delete_vc edit_vc", "myState", userAuthHeader);
+        String userAuthHeader = HttpAuthorizationHandler
+                .createBasicAuthorizationHeaderValue(username, "password");
+        response = requestAuthorizationCode("code", clientId, clientRedirectUri,
+                "create_vc vc_info delete_vc edit_vc", "myState",
+                userAuthHeader);
         String code = parseAuthorizationCode(response);
-        response = requestTokenWithAuthorizationCodeAndForm(clientId, clientSecret, code, clientRedirectUri);
+        response = requestTokenWithAuthorizationCodeAndForm(clientId,
+                clientSecret, code, clientRedirectUri);
         node = JsonUtils.readTree(response.readEntity(String.class));
         String accessToken = node.at("/access_token").asText();
         String accessTokenHeader = "Bearer " + accessToken;
         // create VC 1
         String vcName = "vc-client1";
-        String vcJson = "{\"type\": \"PRIVATE\"" + ",\"queryType\": \"VIRTUAL_CORPUS\"" + ",\"corpusQuery\": \"creationDate since 1820\"}";
+        String vcJson = "{\"type\": \"PRIVATE\""
+                + ",\"queryType\": \"VIRTUAL_CORPUS\""
+                + ",\"corpusQuery\": \"creationDate since 1820\"}";
         createVC(accessTokenHeader, username, vcName, vcJson);
         // create VC 2
         vcName = "vc-client2";
-        vcJson = "{\"type\": \"PRIVATE\"" + ",\"queryType\": \"VIRTUAL_CORPUS\"" + ",\"corpusQuery\": \"creationDate until 1820\"}";
+        vcJson = "{\"type\": \"PRIVATE\"" + ",\"queryType\": \"VIRTUAL_CORPUS\""
+                + ",\"corpusQuery\": \"creationDate until 1820\"}";
         createVC(accessTokenHeader, username, vcName, vcJson);
         // edit VC
         String description = "vc created from client";
@@ -58,7 +65,8 @@
         deregisterClient(username, clientId);
         testSearchWithRevokedAccessToken(accessToken);
         // obtain authorization from another client
-        response = requestTokenWithPassword(superClientId, this.clientSecret, username, "pass");
+        response = requestTokenWithPassword(superClientId, this.clientSecret,
+                username, "pass");
         node = JsonUtils.readTree(response.readEntity(String.class));
         accessToken = node.at("/access_token").asText();
         // checking vc should still be available after client deregistration
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusControllerAdminTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusControllerAdminTest.java
index e93582f..90f9d4a 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusControllerAdminTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusControllerAdminTest.java
@@ -28,48 +28,82 @@
 
     private String testUser = "VirtualCorpusControllerAdminTest";
 
-    private JsonNode testAdminListVC(String username) throws ProcessingException, KustvaktException {
+    private JsonNode testAdminListVC (String username)
+            throws ProcessingException, KustvaktException {
         Form f = new Form();
         f.param("createdBy", username);
-        Response response = target().path(API_VERSION).path("admin").path("vc").path("list").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(admin, "pass")).header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED).post(Entity.form(f));
+        Response response = target().path(API_VERSION).path("admin").path("vc")
+                .path("list").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(admin, "pass"))
+                .header(HttpHeaders.CONTENT_TYPE,
+                        MediaType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(f));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         return JsonUtils.readTree(entity);
     }
 
-    private JsonNode testAdminListVC_UsingAdminToken(String username, ResourceType type) throws ProcessingException, KustvaktException {
+    private JsonNode testAdminListVC_UsingAdminToken (String username,
+            ResourceType type) throws ProcessingException, KustvaktException {
         Form f = new Form();
         f.param("createdBy", username);
         f.param("type", type.toString());
         f.param("token", "secret");
-        Response response = target().path(API_VERSION).path("admin").path("vc").path("list").request().header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED).post(Entity.form(f));
+        Response response = target().path(API_VERSION).path("admin").path("vc")
+                .path("list").request()
+                .header(HttpHeaders.CONTENT_TYPE,
+                        MediaType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(f));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         return JsonUtils.readTree(entity);
     }
 
     @Test
-    public void testCreateSystemVC() throws KustvaktException {
-        String json = "{\"type\": \"SYSTEM\"" + ",\"queryType\": \"VIRTUAL_CORPUS\"" + ",\"corpusQuery\": \"creationDate since 1820\"}";
-        Response response = target().path(API_VERSION).path("vc").path("~system").path("new-system-vc").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(admin, "pass")).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).put(Entity.json(json));
+    public void testCreateSystemVC () throws KustvaktException {
+        String json = "{\"type\": \"SYSTEM\""
+                + ",\"queryType\": \"VIRTUAL_CORPUS\""
+                + ",\"corpusQuery\": \"creationDate since 1820\"}";
+        Response response = target().path(API_VERSION).path("vc")
+                .path("~system").path("new-system-vc").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(admin, "pass"))
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .put(Entity.json(json));
         assertEquals(Status.CREATED.getStatusCode(), response.getStatus());
-        JsonNode node = testAdminListVC_UsingAdminToken("system", ResourceType.SYSTEM);
+        JsonNode node = testAdminListVC_UsingAdminToken("system",
+                ResourceType.SYSTEM);
         assertEquals(2, node.size());
         testDeleteSystemVC(admin, "new-system-vc");
     }
 
-    private void testDeleteSystemVC(String vcCreator, String vcName) throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("vc").path("~system").path(vcName).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(admin, "pass")).delete();
+    private void testDeleteSystemVC (String vcCreator, String vcName)
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("vc")
+                .path("~system").path(vcName).request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(admin, "pass"))
+                .delete();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
-        JsonNode node = testAdminListVC_UsingAdminToken("system", ResourceType.SYSTEM);
+        JsonNode node = testAdminListVC_UsingAdminToken("system",
+                ResourceType.SYSTEM);
         assertEquals(1, node.size());
     }
 
     @Test
-    public void testCreatePrivateVC() throws ProcessingException, KustvaktException {
-        String json = "{\"type\": \"PRIVATE\"" + ",\"queryType\": \"VIRTUAL_CORPUS\"" + ",\"corpusQuery\": \"corpusSigle=GOE\"}";
+    public void testCreatePrivateVC ()
+            throws ProcessingException, KustvaktException {
+        String json = "{\"type\": \"PRIVATE\""
+                + ",\"queryType\": \"VIRTUAL_CORPUS\""
+                + ",\"corpusQuery\": \"corpusSigle=GOE\"}";
         String vcName = "new-vc";
-        Response response = target().path(API_VERSION).path("vc").path("~" + testUser).path(vcName).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(admin, "pass")).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).put(Entity.json(json));
+        Response response = target().path(API_VERSION).path("vc")
+                .path("~" + testUser).path(vcName).request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(admin, "pass"))
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .put(Entity.json(json));
         assertEquals(Status.CREATED.getStatusCode(), response.getStatus());
         JsonNode node = testAdminListVC(testUser);
         assertEquals(1, node.size());
@@ -77,16 +111,27 @@
         testDeletePrivateVC(testUser, vcName);
     }
 
-    private void testEditPrivateVC(String vcCreator, String vcName) throws ProcessingException, KustvaktException {
+    private void testEditPrivateVC (String vcCreator, String vcName)
+            throws ProcessingException, KustvaktException {
         String json = "{\"description\": \"edited vc\"}";
-        Response response = target().path(API_VERSION).path("vc").path("~" + vcCreator).path(vcName).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(admin, "pass")).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).put(Entity.json(json));
+        Response response = target().path(API_VERSION).path("vc")
+                .path("~" + vcCreator).path(vcName).request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(admin, "pass"))
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .put(Entity.json(json));
         assertEquals(Status.NO_CONTENT.getStatusCode(), response.getStatus());
         JsonNode node = testAdminListVC(testUser);
         assertEquals(node.at("/0/description").asText(), "edited vc");
     }
 
-    private void testDeletePrivateVC(String vcCreator, String vcName) throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("vc").path("~" + vcCreator).path(vcName).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(admin, "pass")).delete();
+    private void testDeletePrivateVC (String vcCreator, String vcName)
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("vc")
+                .path("~" + vcCreator).path(vcName).request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(admin, "pass"))
+                .delete();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         JsonNode node = testAdminListVC(vcCreator);
         assertEquals(0, node.size());
@@ -116,8 +161,13 @@
     // 
     // return node.at("/accessId").asText();
     // }
-    private JsonNode testlistAccessByGroup(String groupName) throws KustvaktException {
-        Response response = target().path(API_VERSION).path("vc").path("access").queryParam("groupName", groupName).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(admin, "pass")).get();
+    private JsonNode testlistAccessByGroup (String groupName)
+            throws KustvaktException {
+        Response response = target().path(API_VERSION).path("vc").path("access")
+                .queryParam("groupName", groupName).request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(admin, "pass"))
+                .get();
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(2, node.size());
@@ -125,35 +175,49 @@
     }
 
     @Test
-    public void testVCSharing() throws ProcessingException, KustvaktException {
+    public void testVCSharing () throws ProcessingException, KustvaktException {
         String vcCreator = "marlin";
         String vcName = "marlin-vc";
         String groupName = "marlin-group";
-        JsonNode node2 = testAdminListVC_UsingAdminToken(vcCreator, ResourceType.PROJECT);
+        JsonNode node2 = testAdminListVC_UsingAdminToken(vcCreator,
+                ResourceType.PROJECT);
         assertEquals(0, node2.size());
         testCreateVCAccess(vcCreator, vcName, groupName);
         JsonNode node = testlistAccessByGroup(groupName);
         String accessId = node.at("/accessId").asText();
         testDeleteVCAccess(accessId);
-        node2 = testAdminListVC_UsingAdminToken(vcCreator, ResourceType.PROJECT);
+        node2 = testAdminListVC_UsingAdminToken(vcCreator,
+                ResourceType.PROJECT);
         assertEquals(1, node2.size());
         String json = "{\"type\": \"" + ResourceType.PRIVATE + "\"}";
         editVC(admin, vcCreator, vcName, json);
         node = retrieveVCInfo(admin, vcCreator, vcName);
-        assertEquals(ResourceType.PRIVATE.displayName(), node.at("/type").asText());
-        node2 = testAdminListVC_UsingAdminToken(vcCreator, ResourceType.PROJECT);
+        assertEquals(ResourceType.PRIVATE.displayName(),
+                node.at("/type").asText());
+        node2 = testAdminListVC_UsingAdminToken(vcCreator,
+                ResourceType.PROJECT);
         assertEquals(0, node2.size());
     }
 
-    private void testCreateVCAccess(String vcCreator, String vcName, String groupName) throws ProcessingException, KustvaktException {
+    private void testCreateVCAccess (String vcCreator, String vcName,
+            String groupName) throws ProcessingException, KustvaktException {
         Response response;
         // share VC
-        response = target().path(API_VERSION).path("vc").path("~" + vcCreator).path(vcName).path("share").path("@" + groupName).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(admin, "pass")).post(Entity.form(new Form()));
+        response = target().path(API_VERSION).path("vc").path("~" + vcCreator)
+                .path(vcName).path("share").path("@" + groupName).request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(admin, "pass"))
+                .post(Entity.form(new Form()));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
     }
 
-    private void testDeleteVCAccess(String accessId) throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("vc").path("access").path(accessId).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(admin, "pass")).delete();
+    private void testDeleteVCAccess (String accessId)
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("vc").path("access")
+                .path(accessId).request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(admin, "pass"))
+                .delete();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
     }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusControllerTest.java
index fe45cec..a9ff786 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusControllerTest.java
@@ -34,13 +34,16 @@
 
     private String authHeader;
 
-    public VirtualCorpusControllerTest() throws KustvaktException {
-        authHeader = HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(testUser, "pass");
+    public VirtualCorpusControllerTest () throws KustvaktException {
+        authHeader = HttpAuthorizationHandler
+                .createBasicAuthorizationHeaderValue(testUser, "pass");
     }
 
     @Test
-    public void testCreatePrivateVC() throws KustvaktException {
-        String json = "{\"type\": \"PRIVATE\"" + ",\"queryType\": \"VIRTUAL_CORPUS\"" + ",\"corpusQuery\": \"corpusSigle=GOE\"}";
+    public void testCreatePrivateVC () throws KustvaktException {
+        String json = "{\"type\": \"PRIVATE\""
+                + ",\"queryType\": \"VIRTUAL_CORPUS\""
+                + ",\"corpusQuery\": \"corpusSigle=GOE\"}";
         createVC(authHeader, testUser, "new_vc", json);
         // list user VC
         JsonNode node = listVC(testUser);
@@ -54,8 +57,10 @@
     }
 
     @Test
-    public void testCreatePublishedVC() throws KustvaktException {
-        String json = "{\"type\": \"PUBLISHED\"" + ",\"queryType\": \"VIRTUAL_CORPUS\"" + ",\"corpusQuery\": \"corpusSigle=GOE\"}";
+    public void testCreatePublishedVC () throws KustvaktException {
+        String json = "{\"type\": \"PUBLISHED\""
+                + ",\"queryType\": \"VIRTUAL_CORPUS\""
+                + ",\"corpusQuery\": \"corpusSigle=GOE\"}";
         String vcName = "new-published-vc";
         createVC(authHeader, testUser, vcName, json);
         // test list owner vc
@@ -76,44 +81,64 @@
         deleteVC(vcName, testUser, testUser);
         // EM: check if the hidden groups are deleted as well
         node = testCheckHiddenGroup(groupName);
-        assertEquals(StatusCodes.NO_RESOURCE_FOUND, node.at("/errors/0/0").asInt());
-        assertEquals("Group " + groupName + " is not found", node.at("/errors/0/1").asText());
+        assertEquals(StatusCodes.NO_RESOURCE_FOUND,
+                node.at("/errors/0/0").asInt());
+        assertEquals("Group " + groupName + " is not found",
+                node.at("/errors/0/1").asText());
     }
 
-    private JsonNode testCheckHiddenGroup(String groupName) throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("admin").path("group").path("@" + groupName).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("admin", "pass")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").post(null);
+    private JsonNode testCheckHiddenGroup (String groupName)
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("admin")
+                .path("group").path("@" + groupName).request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("admin", "pass"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").post(null);
         String entity = response.readEntity(String.class);
         return JsonUtils.readTree(entity);
     }
 
     @Test
-    public void testCreateVCWithInvalidToken() throws IOException, KustvaktException {
-        String json = "{\"type\": \"PRIVATE\"," + "\"corpusQuery\": \"corpusSigle=GOE\"}";
-        InputStream is = getClass().getClassLoader().getResourceAsStream("test-invalid-signature.token");
+    public void testCreateVCWithInvalidToken ()
+            throws IOException, KustvaktException {
+        String json = "{\"type\": \"PRIVATE\","
+                + "\"corpusQuery\": \"corpusSigle=GOE\"}";
+        InputStream is = getClass().getClassLoader()
+                .getResourceAsStream("test-invalid-signature.token");
         String authToken;
-        try (BufferedReader reader = new BufferedReader(new InputStreamReader(is))) {
+        try (BufferedReader reader = new BufferedReader(
+                new InputStreamReader(is))) {
             authToken = reader.readLine();
         }
-        Response response = target().path(API_VERSION).path("vc").path("~" + testUser).path("new_vc").request().header(Attributes.AUTHORIZATION, AuthenticationScheme.BEARER.displayName() + " " + authToken).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).put(Entity.json(json));
+        Response response = target().path(API_VERSION).path("vc")
+                .path("~" + testUser).path("new_vc").request()
+                .header(Attributes.AUTHORIZATION,
+                        AuthenticationScheme.BEARER.displayName() + " "
+                                + authToken)
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .put(Entity.json(json));
         String entity = response.readEntity(String.class);
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.INVALID_ACCESS_TOKEN, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "Access token is invalid");
+        assertEquals(StatusCodes.INVALID_ACCESS_TOKEN,
+                node.at("/errors/0/0").asInt());
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Access token is invalid");
         checkWWWAuthenticateHeader(response);
     }
 
     @Test
-    public void testCreateVCWithExpiredToken() throws IOException, KustvaktException {
+    public void testCreateVCWithExpiredToken ()
+            throws IOException, KustvaktException {
         String json = "{\"type\": \"PRIVATE\","
                 + "\"corpusQuery\": \"corpusSigle=GOE\"}";
 
         //String authToken = "fia0123ikBWn931470H8s5gRqx7Moc4p";
         String authToken = createExpiredAccessToken();
-        
+
         Response response = target().path(API_VERSION).path("vc")
-                .path("~marlin").path("new_vc")
-                .request()
+                .path("~marlin").path("new_vc").request()
                 .header(Attributes.AUTHORIZATION,
                         AuthenticationScheme.BEARER.displayName() + " "
                                 + authToken)
@@ -121,130 +146,201 @@
                 .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
                 .put(Entity.json(json));
 
-
         String entity = response.readEntity(String.class);
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(StatusCodes.EXPIRED, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "Access token is expired");
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Access token is expired");
         checkWWWAuthenticateHeader(response);
     }
 
     @Test
-    public void testCreateSystemVC() throws KustvaktException {
-        String json = "{\"type\": \"SYSTEM\"" + ",\"queryType\": \"VIRTUAL_CORPUS\"" + ",\"corpusQuery\": \"pubDate since 1820\"}";
+    public void testCreateSystemVC () throws KustvaktException {
+        String json = "{\"type\": \"SYSTEM\""
+                + ",\"queryType\": \"VIRTUAL_CORPUS\""
+                + ",\"corpusQuery\": \"pubDate since 1820\"}";
         String vcName = "new_system_vc";
-        Response response = target().path(API_VERSION).path("vc").path("~system").path(vcName).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("admin", "pass")).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).put(Entity.json(json));
+        Response response = target().path(API_VERSION).path("vc")
+                .path("~system").path(vcName).request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("admin", "pass"))
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .put(Entity.json(json));
         assertEquals(Status.CREATED.getStatusCode(), response.getStatus());
         JsonNode node = listSystemVC("pearl");
         assertEquals(2, node.size());
-        assertEquals(ResourceType.SYSTEM.displayName(), node.at("/0/type").asText());
-        assertEquals(ResourceType.SYSTEM.displayName(), node.at("/1/type").asText());
+        assertEquals(ResourceType.SYSTEM.displayName(),
+                node.at("/0/type").asText());
+        assertEquals(ResourceType.SYSTEM.displayName(),
+                node.at("/1/type").asText());
         deleteVC(vcName, "system", "admin");
         node = listSystemVC("pearl");
         assertEquals(1, node.size());
     }
 
     @Test
-    public void testCreateSystemVC_unauthorized() throws KustvaktException {
-        String json = "{\"type\": \"SYSTEM\"" + ",\"queryType\": \"VIRTUAL_CORPUS\"" + ",\"corpusQuery\": \"creationDate since 1820\"}";
-        Response response = target().path(API_VERSION).path("vc").path("~" + testUser).path("new_vc").request().header(Attributes.AUTHORIZATION, authHeader).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).put(Entity.json(json));
+    public void testCreateSystemVC_unauthorized () throws KustvaktException {
+        String json = "{\"type\": \"SYSTEM\""
+                + ",\"queryType\": \"VIRTUAL_CORPUS\""
+                + ",\"corpusQuery\": \"creationDate since 1820\"}";
+        Response response = target().path(API_VERSION).path("vc")
+                .path("~" + testUser).path("new_vc").request()
+                .header(Attributes.AUTHORIZATION, authHeader)
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .put(Entity.json(json));
         testResponseUnauthorized(response, testUser);
     }
 
     @Test
-    public void testCreateVC_invalidName() throws KustvaktException {
-        String json = "{\"type\": \"PRIVATE\"" + ",\"queryType\": \"VIRTUAL_CORPUS\"" + ",\"corpusQuery\": \"creationDate since 1820\"}";
-        Response response = target().path(API_VERSION).path("vc").path("~" + testUser).path("new $vc").request().header(Attributes.AUTHORIZATION, authHeader).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).put(Entity.json(json));
+    public void testCreateVC_invalidName () throws KustvaktException {
+        String json = "{\"type\": \"PRIVATE\""
+                + ",\"queryType\": \"VIRTUAL_CORPUS\""
+                + ",\"corpusQuery\": \"creationDate since 1820\"}";
+        Response response = target().path(API_VERSION).path("vc")
+                .path("~" + testUser).path("new $vc").request()
+                .header(Attributes.AUTHORIZATION, authHeader)
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .put(Entity.json(json));
         String entity = response.readEntity(String.class);
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.INVALID_ARGUMENT, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.INVALID_ARGUMENT,
+                node.at("/errors/0/0").asInt());
     }
 
     @Test
-    public void testCreateVC_nameTooShort() throws KustvaktException {
-        String json = "{\"type\": \"PRIVATE\"" + ",\"queryType\": \"VIRTUAL_CORPUS\"" + ",\"corpusQuery\": \"creationDate since 1820\"}";
-        Response response = target().path(API_VERSION).path("vc").path("~" + testUser).path("ne").request().header(Attributes.AUTHORIZATION, authHeader).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).put(Entity.json(json));
+    public void testCreateVC_nameTooShort () throws KustvaktException {
+        String json = "{\"type\": \"PRIVATE\""
+                + ",\"queryType\": \"VIRTUAL_CORPUS\""
+                + ",\"corpusQuery\": \"creationDate since 1820\"}";
+        Response response = target().path(API_VERSION).path("vc")
+                .path("~" + testUser).path("ne").request()
+                .header(Attributes.AUTHORIZATION, authHeader)
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .put(Entity.json(json));
         String entity = response.readEntity(String.class);
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.INVALID_ARGUMENT, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "queryName must contain at least 3 characters");
+        assertEquals(StatusCodes.INVALID_ARGUMENT,
+                node.at("/errors/0/0").asInt());
+        assertEquals(node.at("/errors/0/1").asText(),
+                "queryName must contain at least 3 characters");
     }
 
     @Test
-    public void testCreateVC_unauthorized() throws KustvaktException {
-        String json = "{\"type\": \"PRIVATE\"," + "\"corpusQuery\": \"creationDate since 1820\"}";
-        Response response = target().path(API_VERSION).path("vc").path("~" + testUser).path("new_vc").request().header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).put(Entity.json(json));
+    public void testCreateVC_unauthorized () throws KustvaktException {
+        String json = "{\"type\": \"PRIVATE\","
+                + "\"corpusQuery\": \"creationDate since 1820\"}";
+        Response response = target().path(API_VERSION).path("vc")
+                .path("~" + testUser).path("new_vc").request()
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .put(Entity.json(json));
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.AUTHORIZATION_FAILED, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "Unauthorized operation for user: guest");
+        assertEquals(StatusCodes.AUTHORIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Unauthorized operation for user: guest");
         checkWWWAuthenticateHeader(response);
     }
 
     @Test
-    public void testCreateVC_withoutCorpusQuery() throws KustvaktException {
-        String json = "{\"type\": \"PRIVATE\"" + ",\"queryType\": \"VIRTUAL_CORPUS\"" + "}";
-        Response response = target().path(API_VERSION).path("vc").path("~" + testUser).path("new_vc").request().header(Attributes.AUTHORIZATION, authHeader).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).put(Entity.json(json));
+    public void testCreateVC_withoutCorpusQuery () throws KustvaktException {
+        String json = "{\"type\": \"PRIVATE\""
+                + ",\"queryType\": \"VIRTUAL_CORPUS\"" + "}";
+        Response response = target().path(API_VERSION).path("vc")
+                .path("~" + testUser).path("new_vc").request()
+                .header(Attributes.AUTHORIZATION, authHeader)
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .put(Entity.json(json));
         String entity = response.readEntity(String.class);
         // System.out.println(entity);
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.INVALID_ARGUMENT, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.INVALID_ARGUMENT,
+                node.at("/errors/0/0").asInt());
         assertEquals(node.at("/errors/0/1").asText(), "corpusQuery is null");
         assertEquals(node.at("/errors/0/2").asText(), "corpusQuery");
     }
 
     @Test
-    public void testCreateVC_withoutEntity() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("vc").path("~" + testUser).path("new_vc").request().header(Attributes.AUTHORIZATION, authHeader).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).put(Entity.json(""));
+    public void testCreateVC_withoutEntity () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("vc")
+                .path("~" + testUser).path("new_vc").request()
+                .header(Attributes.AUTHORIZATION, authHeader)
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .put(Entity.json(""));
         String entity = response.readEntity(String.class);
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.INVALID_ARGUMENT, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.INVALID_ARGUMENT,
+                node.at("/errors/0/0").asInt());
         assertEquals(node.at("/errors/0/1").asText(), "request entity is null");
         assertEquals(node.at("/errors/0/2").asText(), "request entity");
     }
 
     @Test
-    public void testCreateVC_withoutType() throws KustvaktException {
-        String json = "{\"corpusQuery\": " + "\"creationDate since 1820\"" + ",\"queryType\": \"VIRTUAL_CORPUS\"" + "}";
-        Response response = target().path(API_VERSION).path("vc").path("~" + testUser).path("new_vc").request().header(Attributes.AUTHORIZATION, authHeader).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).put(Entity.json(json));
+    public void testCreateVC_withoutType () throws KustvaktException {
+        String json = "{\"corpusQuery\": " + "\"creationDate since 1820\""
+                + ",\"queryType\": \"VIRTUAL_CORPUS\"" + "}";
+        Response response = target().path(API_VERSION).path("vc")
+                .path("~" + testUser).path("new_vc").request()
+                .header(Attributes.AUTHORIZATION, authHeader)
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .put(Entity.json(json));
         String entity = response.readEntity(String.class);
         // System.out.println(entity);
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.INVALID_ARGUMENT, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.INVALID_ARGUMENT,
+                node.at("/errors/0/0").asInt());
         assertEquals(node.at("/errors/0/1").asText(), "type is null");
         assertEquals(node.at("/errors/0/2").asText(), "type");
     }
 
     @Test
-    public void testCreateVC_withWrongType() throws KustvaktException {
-        String json = "{\"type\": \"PRIVAT\"" + ",\"queryType\": \"VIRTUAL_CORPUS\"" + ",\"corpusQuery\": \"creationDate since 1820\"}";
-        Response response = target().path(API_VERSION).path("vc").path("~" + testUser).path("new_vc").request().header(Attributes.AUTHORIZATION, authHeader).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).put(Entity.json(json));
+    public void testCreateVC_withWrongType () throws KustvaktException {
+        String json = "{\"type\": \"PRIVAT\""
+                + ",\"queryType\": \"VIRTUAL_CORPUS\""
+                + ",\"corpusQuery\": \"creationDate since 1820\"}";
+        Response response = target().path(API_VERSION).path("vc")
+                .path("~" + testUser).path("new_vc").request()
+                .header(Attributes.AUTHORIZATION, authHeader)
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .put(Entity.json(json));
         String entity = response.readEntity(String.class);
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.DESERIALIZATION_FAILED, node.at("/errors/0/0").asInt());
-        assertTrue(node.at("/errors/0/1").asText().startsWith("Cannot deserialize value of type `de.ids_mannheim.korap.constant." + "ResourceType` from String \"PRIVAT\""));
+        assertEquals(StatusCodes.DESERIALIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
+        assertTrue(node.at("/errors/0/1").asText().startsWith(
+                "Cannot deserialize value of type `de.ids_mannheim.korap.constant."
+                        + "ResourceType` from String \"PRIVAT\""));
     }
 
     @Test
-    public void testMaxNumberOfVC() throws KustvaktException {
-        String json = "{\"type\": \"PRIVATE\"" + ",\"queryType\": \"VIRTUAL_CORPUS\"" + ",\"corpusQuery\": \"corpusSigle=GOE\"}";
+    public void testMaxNumberOfVC () throws KustvaktException {
+        String json = "{\"type\": \"PRIVATE\""
+                + ",\"queryType\": \"VIRTUAL_CORPUS\""
+                + ",\"corpusQuery\": \"corpusSigle=GOE\"}";
         for (int i = 1; i < 6; i++) {
             createVC(authHeader, testUser, "new_vc_" + i, json);
         }
-        Response response = target().path(API_VERSION).path("vc").path("~" + testUser).path("new_vc_6").request().header(Attributes.AUTHORIZATION, authHeader).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).put(Entity.json(json));
+        Response response = target().path(API_VERSION).path("vc")
+                .path("~" + testUser).path("new_vc_6").request()
+                .header(Attributes.AUTHORIZATION, authHeader)
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .put(Entity.json(json));
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(StatusCodes.NOT_ALLOWED, node.at("/errors/0/0").asInt());
-        assertEquals("Cannot create virtual corpus. The maximum number of " + "virtual corpus has been reached.", node.at("/errors/0/1").asText());
+        assertEquals(
+                "Cannot create virtual corpus. The maximum number of "
+                        + "virtual corpus has been reached.",
+                node.at("/errors/0/1").asText());
         // list user VC
         node = listVC(testUser);
         // including 1 system-vc
@@ -260,13 +356,15 @@
     }
 
     @Test
-    public void testDeleteVC_unauthorized() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("vc").path("~dory").path("dory-vc").request().header(Attributes.AUTHORIZATION, authHeader).delete();
+    public void testDeleteVC_unauthorized () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("vc").path("~dory")
+                .path("dory-vc").request()
+                .header(Attributes.AUTHORIZATION, authHeader).delete();
         testResponseUnauthorized(response, testUser);
     }
 
     @Test
-    public void testEditVC() throws KustvaktException {
+    public void testEditVC () throws KustvaktException {
         // 1st edit
         String json = "{\"description\": \"edited vc\"}";
         editVC("dory", "dory", "dory-vc", json);
@@ -282,20 +380,28 @@
     }
 
     @Test
-    public void testEditVCName() throws KustvaktException {
+    public void testEditVCName () throws KustvaktException {
         String json = "{\"name\": \"new-name\"}";
-        Response response = target().path(API_VERSION).path("vc").path("~dory").path("dory-vc").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("dory", "pass")).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).put(Entity.json(json));
+        Response response = target().path(API_VERSION).path("vc").path("~dory")
+                .path("dory-vc").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("dory", "pass"))
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .put(Entity.json(json));
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.DESERIALIZATION_FAILED, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.DESERIALIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
     }
 
     @Test
-    public void testEditCorpusQuery() throws ProcessingException, KustvaktException {
+    public void testEditCorpusQuery ()
+            throws ProcessingException, KustvaktException {
         JsonNode node = testRetrieveKoralQuery("dory", "dory-vc");
         assertEquals(node.at("/collection/@type").asText(), "koral:docGroup");
-        assertEquals(node.at("/collection/operation").asText(), "operation:and");
+        assertEquals(node.at("/collection/operation").asText(),
+                "operation:and");
         assertEquals(2, node.at("/collection/operands").size());
         String json = "{\"corpusQuery\": \"corpusSigle=WPD17\"}";
         editVC("dory", "dory", "dory-vc", json);
@@ -305,8 +411,14 @@
         assertEquals(node.at("/collection/value").asText(), "WPD17");
     }
 
-    private JsonNode testRetrieveKoralQuery(String username, String vcName) throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("vc").path("koralQuery").path("~" + username).path(vcName).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("dory", "pass")).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).get();
+    private JsonNode testRetrieveKoralQuery (String username, String vcName)
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("vc")
+                .path("koralQuery").path("~" + username).path(vcName).request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("dory", "pass"))
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -314,30 +426,39 @@
     }
 
     @Test
-    public void testEditVC_notOwner() throws KustvaktException {
+    public void testEditVC_notOwner () throws KustvaktException {
         String json = "{\"description\": \"edited vc\"}";
-        Response response = target().path(API_VERSION).path("vc").path("~dory").path("dory-vc").request().header(Attributes.AUTHORIZATION, authHeader).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).put(Entity.json(json));
+        Response response = target().path(API_VERSION).path("vc").path("~dory")
+                .path("dory-vc").request()
+                .header(Attributes.AUTHORIZATION, authHeader)
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .put(Entity.json(json));
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
-        assertEquals(StatusCodes.AUTHORIZATION_FAILED, node.at("/errors/0/0").asInt());
-        assertEquals("Unauthorized operation for user: " + testUser, node.at("/errors/0/1").asText());
+        assertEquals(StatusCodes.AUTHORIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
+        assertEquals("Unauthorized operation for user: " + testUser,
+                node.at("/errors/0/1").asText());
         checkWWWAuthenticateHeader(response);
     }
 
     @Test
-    public void testPublishProjectVC() throws KustvaktException {
+    public void testPublishProjectVC () throws KustvaktException {
         String vcName = "group-vc";
         // check the vc type
         JsonNode node = retrieveVCInfo("dory", "dory", vcName);
-        assertEquals(ResourceType.PROJECT.displayName(), node.get("type").asText());
+        assertEquals(ResourceType.PROJECT.displayName(),
+                node.get("type").asText());
         // edit vc
         String json = "{\"type\": \"PUBLISHED\"}";
         editVC("dory", "dory", vcName, json);
         // check VC
         node = testListOwnerVC("dory");
         JsonNode n = node.get(1);
-        assertEquals(ResourceType.PUBLISHED.displayName(), n.get("type").asText());
+        assertEquals(ResourceType.PUBLISHED.displayName(),
+                n.get("type").asText());
         // check hidden VC access
         node = listAccessByGroup("admin", "");
         assertEquals(4, node.size());
@@ -349,7 +470,8 @@
         json = "{\"type\": \"PROJECT\"}";
         editVC("dory", "dory", vcName, json);
         node = testListOwnerVC("dory");
-        assertEquals(ResourceType.PROJECT.displayName(), node.get(1).get("type").asText());
+        assertEquals(ResourceType.PROJECT.displayName(),
+                node.get(1).get("type").asText());
         // check VC access
         node = listAccessByGroup("admin", "");
         assertEquals(3, node.size());
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusFieldTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusFieldTest.java
index 1e06bd3..27c527d 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusFieldTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusFieldTest.java
@@ -32,23 +32,37 @@
     @Autowired
     private QueryDao dao;
 
-    private JsonNode testRetrieveField(String username, String vcName, String field) throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("vc").path("field").path("~" + username).path(vcName).queryParam("fieldName", field).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("admin", "pass")).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).get();
+    private JsonNode testRetrieveField (String username, String vcName,
+            String field) throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("vc").path("field")
+                .path("~" + username).path(vcName)
+                .queryParam("fieldName", field).request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("admin", "pass"))
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         return node;
     }
 
-    private void testRetrieveProhibitedField(String username, String vcName, String field) throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("vc").path("field").path("~" + username).path(vcName).queryParam("fieldName", field).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("admin", "pass")).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).get();
+    private void testRetrieveProhibitedField (String username, String vcName,
+            String field) throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("vc").path("field")
+                .path("~" + username).path(vcName)
+                .queryParam("fieldName", field).request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("admin", "pass"))
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .get();
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(StatusCodes.NOT_ALLOWED, node.at("/errors/0/0").asInt());
     }
 
-    private void deleteVcFromDB(String vcName) throws KustvaktException {
+    private void deleteVcFromDB (String vcName) throws KustvaktException {
         QueryDO vc = dao.retrieveQueryByName(vcName, "system");
         dao.deleteQuery(vc);
         vc = dao.retrieveQueryByName(vcName, "system");
@@ -56,15 +70,18 @@
     }
 
     @Test
-    public void testRetrieveFieldsNamedVC1() throws IOException, QueryException, KustvaktException {
+    public void testRetrieveFieldsNamedVC1 ()
+            throws IOException, QueryException, KustvaktException {
         vcLoader.loadVCToCache("named-vc1", "/vc/named-vc1.jsonld");
         JsonNode n = testRetrieveField("system", "named-vc1", "textSigle");
-        assertEquals(n.at("/@context").asText(), "http://korap.ids-mannheim.de/ns/KoralQuery/v0.3/context.jsonld");
+        assertEquals(n.at("/@context").asText(),
+                "http://korap.ids-mannheim.de/ns/KoralQuery/v0.3/context.jsonld");
         assertEquals(n.at("/corpus/key").asText(), "textSigle");
         assertEquals(2, n.at("/corpus/value").size());
         n = testRetrieveField("system", "named-vc1", "author");
         assertEquals(2, n.at("/corpus/value").size());
-        assertEquals(n.at("/corpus/value/0").asText(), "Goethe, Johann Wolfgang von");
+        assertEquals(n.at("/corpus/value/0").asText(),
+                "Goethe, Johann Wolfgang von");
         testRetrieveUnknownTokens();
         testRetrieveProhibitedField("system", "named-vc1", "tokens");
         testRetrieveProhibitedField("system", "named-vc1", "base");
@@ -72,14 +89,16 @@
         deleteVcFromDB("named-vc1");
     }
 
-    private void testRetrieveUnknownTokens() throws ProcessingException, KustvaktException {
+    private void testRetrieveUnknownTokens ()
+            throws ProcessingException, KustvaktException {
         JsonNode n = testRetrieveField("system", "named-vc1", "unknown");
         assertEquals(n.at("/corpus/key").asText(), "unknown");
         assertEquals(0, n.at("/corpus/value").size());
     }
 
     @Test
-    public void testRetrieveTextSigleNamedVC2() throws IOException, QueryException, KustvaktException {
+    public void testRetrieveTextSigleNamedVC2 ()
+            throws IOException, QueryException, KustvaktException {
         vcLoader.loadVCToCache("named-vc2", "/vc/named-vc2.jsonld");
         JsonNode n = testRetrieveField("system", "named-vc2", "textSigle");
         assertEquals(2, n.at("/corpus/value").size());
@@ -88,7 +107,8 @@
     }
 
     @Test
-    public void testRetrieveTextSigleNamedVC3() throws IOException, QueryException, KustvaktException {
+    public void testRetrieveTextSigleNamedVC3 ()
+            throws IOException, QueryException, KustvaktException {
         vcLoader.loadVCToCache("named-vc3", "/vc/named-vc3.jsonld");
         JsonNode n = testRetrieveField("system", "named-vc3", "textSigle");
         n = n.at("/corpus/value");
@@ -99,14 +119,23 @@
     }
 
     @Test
-    public void testRetrieveFieldUnauthorized() throws KustvaktException, IOException, QueryException {
+    public void testRetrieveFieldUnauthorized ()
+            throws KustvaktException, IOException, QueryException {
         vcLoader.loadVCToCache("named-vc3", "/vc/named-vc3.jsonld");
-        Response response = target().path(API_VERSION).path("vc").path("field").path("~system").path("named-vc3").queryParam("fieldName", "textSigle").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("dory", "pass")).header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON).get();
+        Response response = target().path(API_VERSION).path("vc").path("field")
+                .path("~system").path("named-vc3")
+                .queryParam("fieldName", "textSigle").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("dory", "pass"))
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .get();
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.AUTHORIZATION_FAILED, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "Unauthorized operation for user: dory");
+        assertEquals(StatusCodes.AUTHORIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Unauthorized operation for user: dory");
         VirtualCorpusCache.delete("named-vc3");
         deleteVcFromDB("named-vc3");
     }
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusInfoTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusInfoTest.java
index 168edbb..4d20c0f 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusInfoTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusInfoTest.java
@@ -26,64 +26,96 @@
     private String testUser = "VirtualCorpusInfoTest";
 
     @Test
-    public void testRetrieveSystemVC() throws ProcessingException, KustvaktException {
+    public void testRetrieveSystemVC ()
+            throws ProcessingException, KustvaktException {
         JsonNode node = retrieveVCInfo(testUser, "system", "system-vc");
         assertEquals(node.at("/name").asText(), "system-vc");
-        assertEquals(ResourceType.SYSTEM.displayName(), node.at("/type").asText());
+        assertEquals(ResourceType.SYSTEM.displayName(),
+                node.at("/type").asText());
         // assertEquals("koral:doc", node.at("/koralQuery/collection/@type").asText());
         assertTrue(node.at("/query").isMissingNode());
         assertTrue(node.at("/queryLanguage").isMissingNode());
     }
 
     @Test
-    public void testRetrieveSystemVCGuest() throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("vc").path("~system").path("system-vc").request().get();
+    public void testRetrieveSystemVCGuest ()
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("vc")
+                .path("~system").path("system-vc").request().get();
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
         assertEquals(node.at("/name").asText(), "system-vc");
-        assertEquals(ResourceType.SYSTEM.displayName(), node.at("/type").asText());
+        assertEquals(ResourceType.SYSTEM.displayName(),
+                node.at("/type").asText());
     }
 
     @Test
-    public void testRetrieveOwnerPrivateVC() throws ProcessingException, KustvaktException {
+    public void testRetrieveOwnerPrivateVC ()
+            throws ProcessingException, KustvaktException {
         JsonNode node = retrieveVCInfo("dory", "dory", "dory-vc");
         assertEquals(node.at("/name").asText(), "dory-vc");
-        assertEquals(ResourceType.PRIVATE.displayName(), node.at("/type").asText());
+        assertEquals(ResourceType.PRIVATE.displayName(),
+                node.at("/type").asText());
     }
 
     @Test
-    public void testRetrievePrivateVCUnauthorized() throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("vc").path("~dory").path("dory-vc").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(testUser, "pass")).get();
+    public void testRetrievePrivateVCUnauthorized ()
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("vc").path("~dory")
+                .path("dory-vc").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(testUser, "pass"))
+                .get();
         testResponseUnauthorized(response, testUser);
     }
 
     @Test
-    public void testRetrieveProjectVC() throws ProcessingException, KustvaktException {
+    public void testRetrieveProjectVC ()
+            throws ProcessingException, KustvaktException {
         JsonNode node = retrieveVCInfo("nemo", "dory", "group-vc");
         assertEquals(node.at("/name").asText(), "group-vc");
-        assertEquals(ResourceType.PROJECT.displayName(), node.at("/type").asText());
+        assertEquals(ResourceType.PROJECT.displayName(),
+                node.at("/type").asText());
     }
 
     @Test
-    public void testRetrieveProjectVCUnauthorized() throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("vc").path("~dory").path("group-vc").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(testUser, "pass")).get();
+    public void testRetrieveProjectVCUnauthorized ()
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("vc").path("~dory")
+                .path("group-vc").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(testUser, "pass"))
+                .get();
         testResponseUnauthorized(response, testUser);
     }
 
     @Test
-    public void testRetrieveProjectVCbyNonActiveMember() throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("vc").path("~dory").path("group-vc").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("marlin", "pass")).get();
+    public void testRetrieveProjectVCbyNonActiveMember ()
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("vc").path("~dory")
+                .path("group-vc").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("marlin", "pass"))
+                .get();
         testResponseUnauthorized(response, "marlin");
     }
 
     @Test
-    public void testRetrievePublishedVC() throws ProcessingException, KustvaktException {
+    public void testRetrievePublishedVC ()
+            throws ProcessingException, KustvaktException {
         JsonNode node = retrieveVCInfo("gill", "marlin", "published-vc");
         assertEquals(node.at("/name").asText(), "published-vc");
-        assertEquals(ResourceType.PUBLISHED.displayName(), node.at("/type").asText());
+        assertEquals(ResourceType.PUBLISHED.displayName(),
+                node.at("/type").asText());
         Form f = new Form();
         f.param("status", "HIDDEN");
         // check gill in the hidden group of the vc
-        Response response = target().path(API_VERSION).path("admin").path("group").path("list").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("admin", "pass")).header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED).post(Entity.form(f));
+        Response response = target().path(API_VERSION).path("admin")
+                .path("group").path("list").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("admin", "pass"))
+                .header(HttpHeaders.CONTENT_TYPE,
+                        MediaType.APPLICATION_FORM_URLENCODED)
+                .post(Entity.form(f));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         node = JsonUtils.readTree(entity);
@@ -93,8 +125,13 @@
     }
 
     @Test
-    public void testAdminRetrievePrivateVC() throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("vc").path("~dory").path("dory-vc").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(admin, "pass")).get();
+    public void testAdminRetrievePrivateVC ()
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("vc").path("~dory")
+                .path("dory-vc").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(admin, "pass"))
+                .get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -103,12 +140,18 @@
     }
 
     @Test
-    public void testAdminRetrieveProjectVC() throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("vc").path("~dory").path("group-vc").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(admin, "pass")).get();
+    public void testAdminRetrieveProjectVC ()
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("vc").path("~dory")
+                .path("group-vc").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(admin, "pass"))
+                .get();
         String entity = response.readEntity(String.class);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(node.at("/name").asText(), "group-vc");
-        assertEquals(ResourceType.PROJECT.displayName(), node.at("/type").asText());
+        assertEquals(ResourceType.PROJECT.displayName(),
+                node.at("/type").asText());
     }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusListTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusListTest.java
index df1ac17..f1e1d17 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusListTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusListTest.java
@@ -19,7 +19,8 @@
 public class VirtualCorpusListTest extends VirtualCorpusTestBase {
 
     @Test
-    public void testListVCNemo() throws ProcessingException, KustvaktException {
+    public void testListVCNemo ()
+            throws ProcessingException, KustvaktException {
         JsonNode node = testListOwnerVC("nemo");
         assertEquals(1, node.size());
         node = listSystemVC("nemo");
@@ -29,7 +30,8 @@
     }
 
     @Test
-    public void testListVCPearl() throws ProcessingException, KustvaktException {
+    public void testListVCPearl ()
+            throws ProcessingException, KustvaktException {
         JsonNode node = testListOwnerVC("pearl");
         assertEquals(0, node.size());
         node = listVC("pearl");
@@ -37,7 +39,8 @@
     }
 
     @Test
-    public void testListVCDory() throws ProcessingException, KustvaktException {
+    public void testListVCDory ()
+            throws ProcessingException, KustvaktException {
         JsonNode node = testListOwnerVC("dory");
         assertEquals(2, node.size());
         node = listVC("dory");
@@ -45,29 +48,43 @@
     }
 
     @Test
-    public void testListAvailableVCGuest() throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("vc").request().get();
+    public void testListAvailableVCGuest ()
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("vc").request()
+                .get();
         testResponseUnauthorized(response, "guest");
     }
 
     @Disabled
     @Deprecated
     @Test
-    public void testListAvailableVCByOtherUser() throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("vc").path("~dory").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("pearl", "pass")).get();
+    public void testListAvailableVCByOtherUser ()
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("vc").path("~dory")
+                .request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("pearl", "pass"))
+                .get();
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
-        assertEquals(StatusCodes.AUTHORIZATION_FAILED, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "Unauthorized operation for user: pearl");
+        assertEquals(StatusCodes.AUTHORIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Unauthorized operation for user: pearl");
         checkWWWAuthenticateHeader(response);
     }
 
     @Disabled
     @Deprecated
     @Test
-    public void testListUserVC() throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("vc").queryParam("username", "dory").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("admin", "pass")).get();
+    public void testListUserVC ()
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("vc")
+                .queryParam("username", "dory").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("admin", "pass"))
+                .get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusSharingTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusSharingTest.java
index 288c9e3..d7de5a3 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusSharingTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusSharingTest.java
@@ -25,40 +25,60 @@
     private String testUser = "VirtualCorpusSharingTest";
 
     @Test
-    public void testShareUnknownVC() throws ProcessingException, KustvaktException {
-        Response response = testShareVCByCreator("marlin", "non-existing-vc", "marlin group");
+    public void testShareUnknownVC ()
+            throws ProcessingException, KustvaktException {
+        Response response = testShareVCByCreator("marlin", "non-existing-vc",
+                "marlin group");
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
         assertEquals(HttpStatus.SC_NOT_FOUND, response.getStatus());
-        assertEquals(StatusCodes.NO_RESOURCE_FOUND, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.NO_RESOURCE_FOUND,
+                node.at("/errors/0/0").asInt());
     }
 
     @Test
-    public void testShareUnknownGroup() throws ProcessingException, KustvaktException {
-        Response response = testShareVCByCreator("marlin", "marlin-vc", "non-existing-group");
+    public void testShareUnknownGroup ()
+            throws ProcessingException, KustvaktException {
+        Response response = testShareVCByCreator("marlin", "marlin-vc",
+                "non-existing-group");
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
         assertEquals(HttpStatus.SC_NOT_FOUND, response.getStatus());
-        assertEquals(StatusCodes.NO_RESOURCE_FOUND, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.NO_RESOURCE_FOUND,
+                node.at("/errors/0/0").asInt());
     }
 
     @Test
-    public void testShareVC_notOwner() throws ProcessingException, KustvaktException {
+    public void testShareVC_notOwner ()
+            throws ProcessingException, KustvaktException {
         // dory is VCA in marlin group
-        Response response = target().path(API_VERSION).path("vc").path("~marlin").path("marlin-vc").path("share").path("@marlin group").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("dory", "pass")).post(Entity.form(new Form()));
+        Response response = target().path(API_VERSION).path("vc")
+                .path("~marlin").path("marlin-vc").path("share")
+                .path("@marlin group").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("dory", "pass"))
+                .post(Entity.form(new Form()));
         testResponseUnauthorized(response, "dory");
     }
 
     @Test
-    public void testShareVC_byMember() throws ProcessingException, KustvaktException {
+    public void testShareVC_byMember ()
+            throws ProcessingException, KustvaktException {
         // nemo is not VCA in marlin group
-        Response response = target().path(API_VERSION).path("vc").path("~nemo").path("nemo-vc").path("share").path("@marlin-group").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("nemo", "pass")).post(Entity.form(new Form()));
+        Response response = target().path(API_VERSION).path("vc").path("~nemo")
+                .path("nemo-vc").path("share").path("@marlin-group").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("nemo", "pass"))
+                .post(Entity.form(new Form()));
         testResponseUnauthorized(response, "nemo");
     }
 
     @Test
-    public void testCreateShareProjectVC() throws KustvaktException {
-        String json = "{\"type\": \"PROJECT\"" + ",\"queryType\": \"VIRTUAL_CORPUS\"" + ",\"corpusQuery\": \"corpusSigle=GOE\"}";
+    public void testCreateShareProjectVC () throws KustvaktException {
+        String json = "{\"type\": \"PROJECT\""
+                + ",\"queryType\": \"VIRTUAL_CORPUS\""
+                + ",\"corpusQuery\": \"corpusSigle=GOE\"}";
         String vcName = "new_project_vc";
-        String authHeader = HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(testUser, "pass");
+        String authHeader = HttpAuthorizationHandler
+                .createBasicAuthorizationHeaderValue(testUser, "pass");
         createVC(authHeader, testUser, vcName, json);
         // retrieve vc info
         JsonNode vcInfo = retrieveVCInfo(testUser, testUser, vcName);
@@ -96,54 +116,87 @@
         response = searchWithVCRef(memberName, testUser, vcName);
         assertEquals(Status.NOT_FOUND.getStatusCode(), response.getStatus());
         node = JsonUtils.readTree(response.readEntity(String.class));
-        assertEquals(StatusCodes.NO_RESOURCE_FOUND, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.NO_RESOURCE_FOUND,
+                node.at("/errors/0/0").asInt());
     }
 
-    private Response createUserGroup(String username, String groupName, String description) throws ProcessingException, KustvaktException {
+    private Response createUserGroup (String username, String groupName,
+            String description) throws ProcessingException, KustvaktException {
         Form form = new Form();
         form.param("description", description);
-        Response response = target().path(API_VERSION).path("group").path("@" + groupName).request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).put(Entity.form(form));
+        Response response = target().path(API_VERSION).path("group")
+                .path("@" + groupName).request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .put(Entity.form(form));
         return response;
     }
 
-    private JsonNode listUserGroup(String username, String groupName) throws KustvaktException {
-        Response response = target().path(API_VERSION).path("group").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).get();
+    private JsonNode listUserGroup (String username, String groupName)
+            throws KustvaktException {
+        Response response = target().path(API_VERSION).path("group").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         return node;
     }
 
-    private void testInviteMember(String username, String groupName, String memberName) throws ProcessingException, KustvaktException {
+    private void testInviteMember (String username, String groupName,
+            String memberName) throws ProcessingException, KustvaktException {
         Form form = new Form();
         form.param("members", memberName);
-        Response response = target().path(API_VERSION).path("group").path("@" + groupName).path("invite").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("group")
+                .path("@" + groupName).path("invite").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .post(Entity.form(form));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         // list group
         JsonNode node = listUserGroup(username, groupName);
         node = node.get(0);
         assertEquals(2, node.get("members").size());
         assertEquals(memberName, node.at("/members/1/userId").asText());
-        assertEquals(GroupMemberStatus.PENDING.name(), node.at("/members/1/status").asText());
+        assertEquals(GroupMemberStatus.PENDING.name(),
+                node.at("/members/1/status").asText());
         assertEquals(0, node.at("/members/1/roles").size());
     }
 
-    private void subscribeToGroup(String username, String groupName) throws KustvaktException {
-        Response response = target().path(API_VERSION).path("group").path("@" + groupName).path("subscribe").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).post(Entity.form(new Form()));
+    private void subscribeToGroup (String username, String groupName)
+            throws KustvaktException {
+        Response response = target().path(API_VERSION).path("group")
+                .path("@" + groupName).path("subscribe").request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .post(Entity.form(new Form()));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
     }
 
-    private void checkMemberInGroup(String memberName, String testUser, String groupName) throws KustvaktException {
+    private void checkMemberInGroup (String memberName, String testUser,
+            String groupName) throws KustvaktException {
         JsonNode node = listUserGroup(testUser, groupName).get(0);
         assertEquals(2, node.get("members").size());
         assertEquals(memberName, node.at("/members/1/userId").asText());
-        assertEquals(GroupMemberStatus.ACTIVE.name(), node.at("/members/1/status").asText());
-        assertEquals(PredefinedRole.VC_ACCESS_MEMBER.name(), node.at("/members/1/roles/1").asText());
-        assertEquals(PredefinedRole.USER_GROUP_MEMBER.name(), node.at("/members/1/roles/0").asText());
+        assertEquals(GroupMemberStatus.ACTIVE.name(),
+                node.at("/members/1/status").asText());
+        assertEquals(PredefinedRole.VC_ACCESS_MEMBER.name(),
+                node.at("/members/1/roles/1").asText());
+        assertEquals(PredefinedRole.USER_GROUP_MEMBER.name(),
+                node.at("/members/1/roles/0").asText());
     }
 
-    private Response searchWithVCRef(String username, String vcCreator, String vcName) throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("cq", "referTo \"" + vcCreator + "/" + vcName + "\"").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue(username, "pass")).get();
+    private Response searchWithVCRef (String username, String vcCreator,
+            String vcName) throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("cq",
+                        "referTo \"" + vcCreator + "/" + vcName + "\"")
+                .request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue(username, "pass"))
+                .get();
         return response;
     }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusTestBase.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusTestBase.java
index 7293e04..04538e9 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusTestBase.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/VirtualCorpusTestBase.java
@@ -43,7 +43,7 @@
         return JsonUtils.readTree(entity);
     }
 
-    protected void createVC (String authHeader,String username, String vcName, 
+    protected void createVC (String authHeader, String username, String vcName,
             String vcJson) throws KustvaktException {
         Response response = target().path(API_VERSION).path("vc")
                 .path("~" + username).path(vcName).request()
@@ -78,7 +78,7 @@
         // System.out.println(entity);
         return JsonUtils.readTree(entity);
     }
-    
+
     protected JsonNode listVCWithAuthHeader (String authHeader)
             throws ProcessingException, KustvaktException {
         Response response = target().path(API_VERSION).path("vc").request()
@@ -88,7 +88,7 @@
         String entity = response.readEntity(String.class);
         return JsonUtils.readTree(entity);
     }
-    
+
     protected JsonNode testListOwnerVC (String username)
             throws ProcessingException, KustvaktException {
         Response response = target().path(API_VERSION).path("vc")
@@ -146,7 +146,7 @@
 
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
     }
-    
+
     protected void testResponseUnauthorized (Response response, String username)
             throws KustvaktException {
         assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
@@ -158,19 +158,22 @@
                 node.at("/errors/0/0").asInt());
         assertEquals("Unauthorized operation for user: " + username,
                 node.at("/errors/0/1").asText());
-        
+
         checkWWWAuthenticateHeader(response);
     }
-    
+
     protected void checkWWWAuthenticateHeader (Response response) {
-        Set<Entry<String, List<Object>>> headers =
-                response.getHeaders().entrySet();
+        Set<Entry<String, List<Object>>> headers = response.getHeaders()
+                .entrySet();
 
         for (Entry<String, List<Object>> header : headers) {
             if (header.getKey().equals(ContainerRequest.WWW_AUTHENTICATE)) {
-                assertThat(header.getValue(), not(hasItem("Api realm=\"Kustvakt\"")));
-                assertThat(header.getValue(), hasItem("Bearer realm=\"Kustvakt\""));
-                assertThat(header.getValue(), hasItem("Basic realm=\"Kustvakt\""));
+                assertThat(header.getValue(),
+                        not(hasItem("Api realm=\"Kustvakt\"")));
+                assertThat(header.getValue(),
+                        hasItem("Bearer realm=\"Kustvakt\""));
+                assertThat(header.getValue(),
+                        hasItem("Basic realm=\"Kustvakt\""));
             }
         }
     }
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/lite/InfoControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/lite/InfoControllerTest.java
index f8b2b1d..27054fd 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/lite/InfoControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/lite/InfoControllerTest.java
@@ -25,15 +25,21 @@
     private SearchKrill krill;
 
     @Test
-    public void testInfo() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("info").request().get();
+    public void testInfo () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("info").request()
+                .get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(config.getCurrentVersion(), node.at("/latest_api_version").asText());
-        assertEquals(config.getSupportedVersions().size(), node.at("/supported_api_versions").size());
-        assertEquals(ServiceInfo.getInfo().getVersion(), node.at("/kustvakt_version").asText());
-        assertEquals(krill.getIndex().getVersion(), node.at("/krill_version").asText());
-        assertEquals(ServiceInfo.getInfo().getKoralVersion(), node.at("/koral_version").asText());
+        assertEquals(config.getCurrentVersion(),
+                node.at("/latest_api_version").asText());
+        assertEquals(config.getSupportedVersions().size(),
+                node.at("/supported_api_versions").size());
+        assertEquals(ServiceInfo.getInfo().getVersion(),
+                node.at("/kustvakt_version").asText());
+        assertEquals(krill.getIndex().getVersion(),
+                node.at("/krill_version").asText());
+        assertEquals(ServiceInfo.getInfo().getKoralVersion(),
+                node.at("/koral_version").asText());
     }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/lite/LiteMultipleCorpusQueryTest.java b/full/src/test/java/de/ids_mannheim/korap/web/lite/LiteMultipleCorpusQueryTest.java
index c037f20..5d93355 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/lite/LiteMultipleCorpusQueryTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/lite/LiteMultipleCorpusQueryTest.java
@@ -18,8 +18,12 @@
 public class LiteMultipleCorpusQueryTest extends LiteJerseyTest {
 
     @Test
-    public void testSearchGet() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "das").queryParam("ql", "poliqarp").queryParam("cq", "pubPlace=München").queryParam("cq", "textSigle=\"GOE/AGA/01784\"").request().get();
+    public void testSearchGet () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "das").queryParam("ql", "poliqarp")
+                .queryParam("cq", "pubPlace=München")
+                .queryParam("cq", "textSigle=\"GOE/AGA/01784\"").request()
+                .get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -36,8 +40,11 @@
     }
 
     @Test
-    public void testStatisticsWithMultipleCq() throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("statistics").queryParam("cq", "textType=Abhandlung").queryParam("cq", "corpusSigle=GOE").request().method("GET");
+    public void testStatisticsWithMultipleCq ()
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("statistics")
+                .queryParam("cq", "textType=Abhandlung")
+                .queryParam("cq", "corpusSigle=GOE").request().method("GET");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -49,8 +56,12 @@
     }
 
     @Test
-    public void testStatisticsWithMultipleCorpusQuery() throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("statistics").queryParam("corpusQuery", "textType=Autobiographie").queryParam("corpusQuery", "corpusSigle=GOE").request().method("GET");
+    public void testStatisticsWithMultipleCorpusQuery ()
+            throws ProcessingException, KustvaktException {
+        Response response = target().path(API_VERSION).path("statistics")
+                .queryParam("corpusQuery", "textType=Autobiographie")
+                .queryParam("corpusQuery", "corpusSigle=GOE").request()
+                .method("GET");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -59,6 +70,7 @@
         assertEquals(19387, node.at("/sentences").asInt());
         assertEquals(514, node.at("/paragraphs").asInt());
         assertEquals(StatusCodes.DEPRECATED, node.at("/warnings/0/0").asInt());
-        assertEquals(node.at("/warnings/0/1").asText(), "Parameter corpusQuery is deprecated in favor of cq.");
+        assertEquals(node.at("/warnings/0/1").asText(),
+                "Parameter corpusQuery is deprecated in favor of cq.");
     }
 }
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/lite/LiteSearchControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/lite/LiteSearchControllerTest.java
index 60b6550..610646c0 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/lite/LiteSearchControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/lite/LiteSearchControllerTest.java
@@ -43,8 +43,11 @@
     // EM: The API is disabled
     @Disabled
     @Test
-    public void testGetJSONQuery() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("query").queryParam("q", "[orth=das]").queryParam("ql", "poliqarp").queryParam("context", "sentence").queryParam("count", "13").request().method("GET");
+    public void testGetJSONQuery () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("query")
+                .queryParam("q", "[orth=das]").queryParam("ql", "poliqarp")
+                .queryParam("context", "sentence").queryParam("count", "13")
+                .request().method("GET");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String query = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(query);
@@ -58,13 +61,17 @@
     // EM: The API is disabled
     @Disabled
     @Test
-    public void testbuildAndPostQuery() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("query").queryParam("q", "[orth=das]").queryParam("ql", "poliqarp").queryParam("cq", "corpusSigle=WPD | corpusSigle=GOE").request().method("GET");
+    public void testbuildAndPostQuery () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("query")
+                .queryParam("q", "[orth=das]").queryParam("ql", "poliqarp")
+                .queryParam("cq", "corpusSigle=WPD | corpusSigle=GOE").request()
+                .method("GET");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String query = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(query);
         assertNotNull(node);
-        response = target().path(API_VERSION).path("search").request().post(Entity.json(query));
+        response = target().path(API_VERSION).path("search").request()
+                .post(Entity.json(query));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String matches = response.readEntity(String.class);
         JsonNode match_node = JsonUtils.readTree(matches);
@@ -72,17 +79,21 @@
     }
 
     @Test
-    public void testApiWelcomeMessage() {
+    public void testApiWelcomeMessage () {
         Response response = target().path(API_VERSION).path("").request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String message = response.readEntity(String.class);
-        assertEquals(response.getHeaders().getFirst("X-Index-Revision"), "Wes8Bd4h1OypPqbWF5njeQ==");
+        assertEquals(response.getHeaders().getFirst("X-Index-Revision"),
+                "Wes8Bd4h1OypPqbWF5njeQ==");
         assertEquals(message, config.getApiWelcomeMessage());
     }
 
     @Test
-    public void testQueryGet() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=das]").queryParam("ql", "poliqarp").queryParam("context", "sentence").queryParam("count", "13").request().get();
+    public void testQueryGet () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=das]").queryParam("ql", "poliqarp")
+                .queryParam("context", "sentence").queryParam("count", "13")
+                .request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String query = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(query);
@@ -94,8 +105,11 @@
     }
 
     @Test
-    public void testQueryFailure() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=das").queryParam("ql", "poliqarp").queryParam("cq", "corpusSigle=WPD | corpusSigle=GOE").queryParam("count", "13").request().get();
+    public void testQueryFailure () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=das").queryParam("ql", "poliqarp")
+                .queryParam("cq", "corpusSigle=WPD | corpusSigle=GOE")
+                .queryParam("count", "13").request().get();
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         String query = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(query);
@@ -108,8 +122,11 @@
     }
 
     @Test
-    public void testFoundryRewrite() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=das]").queryParam("ql", "poliqarp").queryParam("context", "sentence").queryParam("count", "13").request().get();
+    public void testFoundryRewrite () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=das]").queryParam("ql", "poliqarp")
+                .queryParam("context", "sentence").queryParam("count", "13")
+                .request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String query = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(query);
@@ -121,10 +138,11 @@
     // EM: The API is disabled
     @Test
     @Disabled
-    public void testQueryPost() throws KustvaktException {
+    public void testQueryPost () throws KustvaktException {
         QuerySerializer s = new QuerySerializer();
         s.setQuery("[orth=das]", "poliqarp");
-        Response response = target().path(API_VERSION).path("search").request().post(Entity.json(s.toJSON()));
+        Response response = target().path(API_VERSION).path("search").request()
+                .post(Entity.json(s.toJSON()));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String query = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(query);
@@ -134,71 +152,105 @@
     }
 
     @Test
-    public void testParameterField() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=das]").queryParam("ql", "poliqarp").queryParam("fields", "author,docSigle").queryParam("context", "sentence").queryParam("count", "13").request().get();
+    public void testParameterField () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=das]").queryParam("ql", "poliqarp")
+                .queryParam("fields", "author,docSigle")
+                .queryParam("context", "sentence").queryParam("count", "13")
+                .request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String query = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(query);
         assertNotNull(node);
         assertEquals(node.at("/query/wrap/layer").asText(), "orth");
         assertNotEquals(0, node.at("/matches").size());
-        assertEquals(node.at("/meta/fields").toString(), "[\"author\",\"docSigle\"]");
+        assertEquals(node.at("/meta/fields").toString(),
+                "[\"author\",\"docSigle\"]");
     }
 
     @Test
-    public void testMatchInfoGetWithoutSpans() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("corpus/GOE/AGA/01784/p36-46(5)37-45(2)38-42/matchInfo").queryParam("foundry", "*").queryParam("spans", "false").request().get();
+    public void testMatchInfoGetWithoutSpans () throws KustvaktException {
+        Response response = target().path(API_VERSION)
+                .path("corpus/GOE/AGA/01784/p36-46(5)37-45(2)38-42/matchInfo")
+                .queryParam("foundry", "*").queryParam("spans", "false")
+                .request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         assertNotNull(node);
         assertEquals(node.at("/textSigle").asText(), "GOE/AGA/01784");
-        assertEquals(node.at("/matchID").asText(), "match-GOE/AGA/01784-p36-46(5)37-45(2)38-42");
+        assertEquals(node.at("/matchID").asText(),
+                "match-GOE/AGA/01784-p36-46(5)37-45(2)38-42");
         assertEquals(node.at("/title").asText(), "Belagerung von Mainz");
     }
 
     @Test
-    public void testMatchInfoGetWithoutHighlights() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("corpus/GOE/AGA/01784/p36-46(5)37-45(2)38-42/matchInfo").queryParam("foundry", "xy").queryParam("spans", "false").request().get();
+    public void testMatchInfoGetWithoutHighlights () throws KustvaktException {
+        Response response = target().path(API_VERSION)
+                .path("corpus/GOE/AGA/01784/p36-46(5)37-45(2)38-42/matchInfo")
+                .queryParam("foundry", "xy").queryParam("spans", "false")
+                .request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         assertNotNull(node);
-        assertEquals(node.at("/snippet").asText(), "<span class=\"context-left\"></span><span class=\"match\">der alte freie Weg nach Mainz war gesperrt, ich mußte über die Schiffbrücke bei Rüsselsheim; in Ginsheim ward <mark>gefüttert; der Ort ist sehr zerschossen; dann über die Schiffbrücke</mark> auf die Nonnenaue, wo viele Bäume niedergehauen lagen, sofort auf dem zweiten Teil der Schiffbrücke über den größern Arm des Rheins.</span><span class=\"context-right\"></span>");
+        assertEquals(node.at("/snippet").asText(),
+                "<span class=\"context-left\"></span><span class=\"match\">der alte freie Weg nach Mainz war gesperrt, ich mußte über die Schiffbrücke bei Rüsselsheim; in Ginsheim ward <mark>gefüttert; der Ort ist sehr zerschossen; dann über die Schiffbrücke</mark> auf die Nonnenaue, wo viele Bäume niedergehauen lagen, sofort auf dem zweiten Teil der Schiffbrücke über den größern Arm des Rheins.</span><span class=\"context-right\"></span>");
         assertEquals(node.at("/textSigle").asText(), "GOE/AGA/01784");
-        assertEquals(node.at("/matchID").asText(), "match-GOE/AGA/01784-p36-46(5)37-45(2)38-42");
+        assertEquals(node.at("/matchID").asText(),
+                "match-GOE/AGA/01784-p36-46(5)37-45(2)38-42");
         assertEquals(node.at("/title").asText(), "Belagerung von Mainz");
     }
 
     @Test
-    public void testMatchInfoWithoutExtension() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("corpus/GOE/AGA/01784/p36-46(5)37-45(2)38-42").queryParam("foundry", "-").queryParam("spans", "false").queryParam("expand", "false").request().get();
+    public void testMatchInfoWithoutExtension () throws KustvaktException {
+        Response response = target().path(API_VERSION)
+                .path("corpus/GOE/AGA/01784/p36-46(5)37-45(2)38-42")
+                .queryParam("foundry", "-").queryParam("spans", "false")
+                .queryParam("expand", "false").request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         assertNotNull(node);
         assertEquals(node.at("/textSigle").asText(), "GOE/AGA/01784");
-        assertEquals(node.at("/matchID").asText(), "match-GOE/AGA/01784-p36-46(5)37-45(2)38-42");
-        assertEquals(node.at("/snippet").asText(), "<span class=\"context-left\"><span class=\"more\"></span></span><span class=\"match\"><mark>gefüttert; der Ort ist sehr zerschossen; dann über die Schiffbrücke</mark></span><span class=\"context-right\"><span class=\"more\"></span></span>");
+        assertEquals(node.at("/matchID").asText(),
+                "match-GOE/AGA/01784-p36-46(5)37-45(2)38-42");
+        assertEquals(node.at("/snippet").asText(),
+                "<span class=\"context-left\"><span class=\"more\"></span></span><span class=\"match\"><mark>gefüttert; der Ort ist sehr zerschossen; dann über die Schiffbrücke</mark></span><span class=\"context-right\"><span class=\"more\"></span></span>");
         assertEquals(node.at("/title").asText(), "Belagerung von Mainz");
     }
 
     @Test
-    public void testMatchInfoGetWithHighlights() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("corpus/GOE/AGA/01784/p36-46(5)37-45(2)38-42/matchInfo").queryParam("foundry", "xy").queryParam("spans", "false").queryParam("hls", "true").request().get();
+    public void testMatchInfoGetWithHighlights () throws KustvaktException {
+        Response response = target().path(API_VERSION)
+                .path("corpus/GOE/AGA/01784/p36-46(5)37-45(2)38-42/matchInfo")
+                .queryParam("foundry", "xy").queryParam("spans", "false")
+                .queryParam("hls", "true").request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         assertNotNull(node);
         assertEquals(node.at("/textSigle").asText(), "GOE/AGA/01784");
-        assertEquals("<span class=\"context-left\"></span><span class=\"match\">" + "der alte freie Weg nach Mainz war gesperrt, ich mußte über die " + "Schiffbrücke bei Rüsselsheim; in Ginsheim ward <mark>gefüttert; " + "<mark class=\"class-5 level-0\">der <mark class=\"class-2 level-1\">" + "Ort ist sehr zerschossen; dann</mark> über die Schiffbrücke</mark></mark> " + "auf die Nonnenaue, wo viele Bäume niedergehauen lagen, sofort auf dem " + "zweiten Teil der Schiffbrücke über den größern Arm des Rheins.</span>" + "<span class=\"context-right\"></span>", node.at("/snippet").asText());
-        assertEquals(node.at("/matchID").asText(), "match-GOE/AGA/01784-p36-46(5)37-45(2)38-42");
+        assertEquals(
+                "<span class=\"context-left\"></span><span class=\"match\">"
+                        + "der alte freie Weg nach Mainz war gesperrt, ich mußte über die "
+                        + "Schiffbrücke bei Rüsselsheim; in Ginsheim ward <mark>gefüttert; "
+                        + "<mark class=\"class-5 level-0\">der <mark class=\"class-2 level-1\">"
+                        + "Ort ist sehr zerschossen; dann</mark> über die Schiffbrücke</mark></mark> "
+                        + "auf die Nonnenaue, wo viele Bäume niedergehauen lagen, sofort auf dem "
+                        + "zweiten Teil der Schiffbrücke über den größern Arm des Rheins.</span>"
+                        + "<span class=\"context-right\"></span>",
+                node.at("/snippet").asText());
+        assertEquals(node.at("/matchID").asText(),
+                "match-GOE/AGA/01784-p36-46(5)37-45(2)38-42");
         assertEquals(node.at("/title").asText(), "Belagerung von Mainz");
     }
 
     @Test
-    public void testMatchInfoGet2() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("corpus/GOE/AGA/01784/p36-46/matchInfo").queryParam("foundry", "*").request().get();
+    public void testMatchInfoGet2 () throws KustvaktException {
+        Response response = target().path(API_VERSION)
+                .path("corpus/GOE/AGA/01784/p36-46/matchInfo")
+                .queryParam("foundry", "*").request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
@@ -210,16 +262,27 @@
     // EM: The API is disabled
     @Disabled
     @Test
-    public void testCollectionQueryParameter() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("query").queryParam("q", "[orth=das]").queryParam("ql", "poliqarp").queryParam("fields", "author, docSigle").queryParam("context", "sentence").queryParam("count", "13").queryParam("cq", "textClass=Politik & corpus=WPD").request().method("GET");
+    public void testCollectionQueryParameter () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("query")
+                .queryParam("q", "[orth=das]").queryParam("ql", "poliqarp")
+                .queryParam("fields", "author, docSigle")
+                .queryParam("context", "sentence").queryParam("count", "13")
+                .queryParam("cq", "textClass=Politik & corpus=WPD").request()
+                .method("GET");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String query = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(query);
         assertNotNull(node);
         assertEquals(node.at("/query/wrap/layer").asText(), "orth");
-        assertEquals(node.at("/collection/operands/0/value").asText(), "Politik");
+        assertEquals(node.at("/collection/operands/0/value").asText(),
+                "Politik");
         assertEquals(node.at("/collection/operands/1/value").asText(), "WPD");
-        response = target().path(API_VERSION).path("search").queryParam("q", "[orth=das]").queryParam("ql", "poliqarp").queryParam("fields", "author, docSigle").queryParam("context", "sentence").queryParam("count", "13").queryParam("cq", "textClass=Politik & corpus=WPD").request().get();
+        response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=das]").queryParam("ql", "poliqarp")
+                .queryParam("fields", "author, docSigle")
+                .queryParam("context", "sentence").queryParam("count", "13")
+                .queryParam("cq", "textClass=Politik & corpus=WPD").request()
+                .get();
         // String version =
         // LucenePackage.get().getImplementationVersion();;
         // System.out.println("VERSION "+ version);
@@ -229,22 +292,33 @@
         node = JsonUtils.readTree(query);
         assertNotNull(node);
         assertEquals(node.at("/query/wrap/layer").asText(), "orth");
-        assertEquals(node.at("/collection/operands/0/value").asText(), "Politik");
+        assertEquals(node.at("/collection/operands/0/value").asText(),
+                "Politik");
         assertEquals(node.at("/collection/operands/1/value").asText(), "WPD");
     }
 
     @Test
-    public void testTokenRetrieval() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("/corpus/GOE/AGA/01784/p104-105/").request().method("GET");
+    public void testTokenRetrieval () throws KustvaktException {
+        Response response = target().path(API_VERSION)
+                .path("/corpus/GOE/AGA/01784/p104-105/").request()
+                .method("GET");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String resp = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(resp);
         assertTrue(node.at("/hasSnippet").asBoolean());
         assertFalse(node.at("/hasTokens").asBoolean());
         assertTrue(node.at("/tokens").isMissingNode());
-        assertEquals("<span class=\"context-left\"><span class=\"more\"></span></span>" + "<span class=\"match\"><mark>die</mark></span>" + "<span class=\"context-right\"><span class=\"more\"></span></span>", node.at("/snippet").asText());
+        assertEquals(
+                "<span class=\"context-left\"><span class=\"more\"></span></span>"
+                        + "<span class=\"match\"><mark>die</mark></span>"
+                        + "<span class=\"context-right\"><span class=\"more\"></span></span>",
+                node.at("/snippet").asText());
         // Tokens
-        response = target().path(API_VERSION).path("/corpus/GOE/AGA/01784/p104-105").queryParam("show-snippet", "false").queryParam("show-tokens", "true").queryParam("expand", "false").request().method("GET");
+        response = target().path(API_VERSION)
+                .path("/corpus/GOE/AGA/01784/p104-105")
+                .queryParam("show-snippet", "false")
+                .queryParam("show-tokens", "true").queryParam("expand", "false")
+                .request().method("GET");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         resp = response.readEntity(String.class);
         node = JsonUtils.readTree(resp);
@@ -256,8 +330,9 @@
     }
 
     @Test
-    public void testMetaFields() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("/corpus/GOE/AGA/01784").request().method("GET");
+    public void testMetaFields () throws KustvaktException {
+        Response response = target().path(API_VERSION)
+                .path("/corpus/GOE/AGA/01784").request().method("GET");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String resp = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(resp);
@@ -276,7 +351,8 @@
                     break;
                 case "author":
                     assertEquals(field.at("/type").asText(), "type:text");
-                    assertEquals(field.at("/value").asText(), "Goethe, Johann Wolfgang von");
+                    assertEquals(field.at("/value").asText(),
+                            "Goethe, Johann Wolfgang von");
                     checkC++;
                     break;
                 case "docSigle":
@@ -286,7 +362,8 @@
                     break;
                 case "docTitle":
                     assertEquals(field.at("/type").asText(), "type:text");
-                    assertEquals(field.at("/value").asText(), "Goethe: Autobiographische Schriften II, (1817-1825, 1832)");
+                    assertEquals(field.at("/value").asText(),
+                            "Goethe: Autobiographische Schriften II, (1817-1825, 1832)");
                     checkC++;
                     break;
                 case "pubDate":
@@ -294,32 +371,37 @@
                     assertEquals(1982, field.at("/value").asInt());
                     checkC++;
                     break;
-            }
-            ;
-        }
-        ;
+            };
+        };
         assertEquals(5, checkC);
     }
 
     @Test
-    public void testSearchWithoutVersion() throws KustvaktException {
-        Response response = target().path("api").path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").request().accept(MediaType.APPLICATION_JSON).get();
+    public void testSearchWithoutVersion () throws KustvaktException {
+        Response response = target().path("api").path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .request().accept(MediaType.APPLICATION_JSON).get();
         assertEquals(HttpStatus.PERMANENT_REDIRECT_308, response.getStatus());
         URI location = response.getLocation();
         assertEquals(location.getPath(), "/api/v1.0/search");
     }
 
     @Test
-    public void testSearchWrongVersion() throws KustvaktException {
-        Response response = target().path("api").path("v0.2").path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").request().accept(MediaType.APPLICATION_JSON).get();
+    public void testSearchWrongVersion () throws KustvaktException {
+        Response response = target().path("api").path("v0.2").path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .request().accept(MediaType.APPLICATION_JSON).get();
         assertEquals(HttpStatus.PERMANENT_REDIRECT_308, response.getStatus());
         URI location = response.getLocation();
         assertEquals(location.getPath(), "/api/v1.0/search");
     }
 
     @Test
-    public void testSearchWithIP() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "Wasser").queryParam("ql", "poliqarp").request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
+    public void testSearchWithIP () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "Wasser").queryParam("ql", "poliqarp")
+                .request().header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -327,8 +409,13 @@
     }
 
     @Test
-    public void testSearchWithAuthorizationHeader() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "Wasser").queryParam("ql", "poliqarp").request().header(Attributes.AUTHORIZATION, HttpAuthorizationHandler.createBasicAuthorizationHeaderValue("test", "pwd")).header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
+    public void testSearchWithAuthorizationHeader () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "Wasser").queryParam("ql", "poliqarp")
+                .request()
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("test", "pwd"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32").get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -336,8 +423,10 @@
     }
 
     @Test
-    public void testSearchPublicMetadata() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=das]").queryParam("ql", "poliqarp").queryParam("access-rewrite-disabled", "true").request().get();
+    public void testSearchPublicMetadata () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=das]").queryParam("ql", "poliqarp")
+                .queryParam("access-rewrite-disabled", "true").request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String query = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(query);
@@ -345,45 +434,61 @@
     }
 
     @Test
-    public void testSearchPublicMetadataWithCustomFields() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "Sonne").queryParam("ql", "poliqarp").queryParam("fields", "author,title").queryParam("access-rewrite-disabled", "true").request().get();
+    public void testSearchPublicMetadataWithCustomFields ()
+            throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "Sonne").queryParam("ql", "poliqarp")
+                .queryParam("fields", "author,title")
+                .queryParam("access-rewrite-disabled", "true").request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertTrue(node.at("/matches/0/snippet").isMissingNode());
-        assertEquals(node.at("/matches/0/author").asText(), "Goethe, Johann Wolfgang von");
-        assertEquals(node.at("/matches/0/title").asText(), "Italienische Reise");
+        assertEquals(node.at("/matches/0/author").asText(),
+                "Goethe, Johann Wolfgang von");
+        assertEquals(node.at("/matches/0/title").asText(),
+                "Italienische Reise");
         // assertEquals(3, node.at("/matches/0").size());
     }
 
     @Test
-    public void testSearchPublicMetadataWithNonPublicField() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "Sonne").queryParam("ql", "poliqarp").queryParam("fields", "author,title,snippet").queryParam("access-rewrite-disabled", "true").request().get();
+    public void testSearchPublicMetadataWithNonPublicField ()
+            throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "Sonne").queryParam("ql", "poliqarp")
+                .queryParam("fields", "author,title,snippet")
+                .queryParam("access-rewrite-disabled", "true").request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.NON_PUBLIC_FIELD_IGNORED, node.at("/warnings/0/0").asInt());
-        assertEquals(node.at("/warnings/0/1").asText(), "The requested non public fields are ignored");
+        assertEquals(StatusCodes.NON_PUBLIC_FIELD_IGNORED,
+                node.at("/warnings/0/0").asInt());
+        assertEquals(node.at("/warnings/0/1").asText(),
+                "The requested non public fields are ignored");
         assertEquals(node.at("/warnings/0/2").asText(), "snippet");
     }
 
     @Test
-    public void testSearchWithInvalidPage() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=die]").queryParam("ql", "poliqarp").queryParam("page", "0").request().get();
+    public void testSearchWithInvalidPage () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=die]").queryParam("ql", "poliqarp")
+                .queryParam("page", "0").request().get();
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.INVALID_ARGUMENT, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.INVALID_ARGUMENT,
+                node.at("/errors/0/0").asInt());
         assertEquals(node.at("/errors/0/1").asText(), "page must start from 1");
     }
 
     @Test
-    public void testCloseIndex() throws IOException, KustvaktException {
+    public void testCloseIndex () throws IOException, KustvaktException {
         searchKrill.getStatistics(null);
         assertEquals(true, searchKrill.getIndex().isReaderOpen());
         Form form = new Form();
         form.param("token", "secret");
-        Response response = target().path(API_VERSION).path("index").path("close").request().post(Entity.form(form));
+        Response response = target().path(API_VERSION).path("index")
+                .path("close").request().post(Entity.form(form));
         assertEquals(HttpStatus.OK_200, response.getStatus());
         assertEquals(false, searchKrill.getIndex().isReaderOpen());
     }
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/lite/LiteSearchPipeTest.java b/full/src/test/java/de/ids_mannheim/korap/web/lite/LiteSearchPipeTest.java
index f747934..704ae5f 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/lite/LiteSearchPipeTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/lite/LiteSearchPipeTest.java
@@ -45,29 +45,43 @@
 
     private String glemmUri = "http://localhost:" + port + "/glemm";
 
-    public LiteSearchPipeTest() throws IOException {
-        pipeJson = IOUtils.toString(ClassLoader.getSystemResourceAsStream("pipe-output/test-pipes.jsonld"), StandardCharsets.UTF_8);
-        pipeWithParamJson = IOUtils.toString(ClassLoader.getSystemResourceAsStream("pipe-output/with-param.jsonld"), StandardCharsets.UTF_8);
+    public LiteSearchPipeTest () throws IOException {
+        pipeJson = IOUtils.toString(
+                ClassLoader.getSystemResourceAsStream(
+                        "pipe-output/test-pipes.jsonld"),
+                StandardCharsets.UTF_8);
+        pipeWithParamJson = IOUtils.toString(
+                ClassLoader.getSystemResourceAsStream(
+                        "pipe-output/with-param.jsonld"),
+                StandardCharsets.UTF_8);
     }
 
     @BeforeEach
-    public void startMockServer() {
+    public void startMockServer () {
         mockServer = startClientAndServer(port);
         mockClient = new MockServerClient("localhost", mockServer.getPort());
     }
 
     @AfterEach
-    public void stopMockServer() {
+    public void stopMockServer () {
         mockServer.stop();
     }
 
     @Test
-    public void testMockServer() throws IOException {
-        mockClient.reset().when(request().withMethod("POST").withPath("/test").withHeader(new Header("Content-Type", "application/json; charset=utf-8"))).respond(response().withHeader(new Header("Content-Type", "application/json; charset=utf-8")).withBody("{test}").withStatusCode(200));
+    public void testMockServer () throws IOException {
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/test")
+                        .withHeader(new Header("Content-Type",
+                                "application/json; charset=utf-8")))
+                .respond(response()
+                        .withHeader(new Header("Content-Type",
+                                "application/json; charset=utf-8"))
+                        .withBody("{test}").withStatusCode(200));
         URL url = new URL("http://localhost:" + port + "/test");
         HttpURLConnection connection = (HttpURLConnection) url.openConnection();
         connection.setRequestMethod("POST");
-        connection.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
+        connection.setRequestProperty("Content-Type",
+                "application/json; charset=UTF-8");
         connection.setRequestProperty("Accept", "application/json");
         connection.setDoOutput(true);
         String json = "{\"name\" : \"dory\"}";
@@ -76,14 +90,27 @@
             os.write(input, 0, input.length);
         }
         assertEquals(200, connection.getResponseCode());
-        BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream(), "utf-8"));
+        BufferedReader br = new BufferedReader(
+                new InputStreamReader(connection.getInputStream(), "utf-8"));
         assertEquals(br.readLine(), "{test}");
     }
 
     @Test
-    public void testSearchWithPipes() throws IOException, KustvaktException, URISyntaxException {
-        mockClient.reset().when(request().withMethod("POST").withPath("/glemm").withHeaders(new Header("Content-Type", "application/json; charset=utf-8"), new Header("Accept", "application/json"))).respond(response().withHeader(new Header("Content-Type", "application/json; charset=utf-8")).withBody(pipeJson).withStatusCode(200));
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("pipes", glemmUri).request().get();
+    public void testSearchWithPipes ()
+            throws IOException, KustvaktException, URISyntaxException {
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/glemm")
+                        .withHeaders(
+                                new Header("Content-Type",
+                                        "application/json; charset=utf-8"),
+                                new Header("Accept", "application/json")))
+                .respond(response()
+                        .withHeader(new Header("Content-Type",
+                                "application/json; charset=utf-8"))
+                        .withBody(pipeJson).withStatusCode(200));
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("pipes", glemmUri).request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -99,20 +126,44 @@
     }
 
     @Test
-    public void testSearchWithUrlEncodedPipes() throws IOException, KustvaktException {
-        mockClient.reset().when(request().withMethod("POST").withPath("/glemm").withHeaders(new Header("Content-Type", "application/json; charset=utf-8"), new Header("Accept", "application/json"))).respond(response().withHeader(new Header("Content-Type", "application/json; charset=utf-8")).withBody(pipeJson).withStatusCode(200));
+    public void testSearchWithUrlEncodedPipes ()
+            throws IOException, KustvaktException {
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/glemm")
+                        .withHeaders(
+                                new Header("Content-Type",
+                                        "application/json; charset=utf-8"),
+                                new Header("Accept", "application/json")))
+                .respond(response()
+                        .withHeader(new Header("Content-Type",
+                                "application/json; charset=utf-8"))
+                        .withBody(pipeJson).withStatusCode(200));
         glemmUri = URLEncoder.encode(glemmUri, "utf-8");
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("pipes", glemmUri).request().get();
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("pipes", glemmUri).request().get();
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(2, node.at("/query/wrap/key").size());
     }
 
     @Test
-    public void testSearchWithMultiplePipes() throws KustvaktException {
-        mockClient.reset().when(request().withMethod("POST").withPath("/glemm").withQueryStringParameter("param").withHeaders(new Header("Content-Type", "application/json; charset=utf-8"), new Header("Accept", "application/json"))).respond(response().withHeader(new Header("Content-Type", "application/json; charset=utf-8")).withBody(pipeWithParamJson).withStatusCode(200));
+    public void testSearchWithMultiplePipes () throws KustvaktException {
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/glemm")
+                        .withQueryStringParameter("param").withHeaders(
+                                new Header("Content-Type",
+                                        "application/json; charset=utf-8"),
+                                new Header("Accept", "application/json")))
+                .respond(response()
+                        .withHeader(new Header("Content-Type",
+                                "application/json; charset=utf-8"))
+                        .withBody(pipeWithParamJson).withStatusCode(200));
         String glemmUri2 = glemmUri + "?param=blah";
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("pipes", glemmUri + "," + glemmUri2).request().get();
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("pipes", glemmUri + "," + glemmUri2).request()
+                .get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -120,9 +171,13 @@
     }
 
     @Test
-    public void testSearchWithUnknownURL() throws IOException, KustvaktException {
-        String url = target().getUri().toString() + API_VERSION + "/test/tralala";
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("pipes", url).request().get();
+    public void testSearchWithUnknownURL ()
+            throws IOException, KustvaktException {
+        String url = target().getUri().toString() + API_VERSION
+                + "/test/tralala";
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("pipes", url).request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -131,8 +186,10 @@
     }
 
     @Test
-    public void testSearchWithUnknownHost() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("pipes", "http://glemm").request().get();
+    public void testSearchWithUnknownHost () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("pipes", "http://glemm").request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -141,21 +198,30 @@
     }
 
     @Test
-    public void testSearchUnsupportedMediaType() throws KustvaktException {
-        mockClient.reset().when(request().withMethod("POST").withPath("/non-json-pipe")).respond(response().withStatusCode(415));
+    public void testSearchUnsupportedMediaType () throws KustvaktException {
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/non-json-pipe"))
+                .respond(response().withStatusCode(415));
         String pipeUri = "http://localhost:" + port + "/non-json-pipe";
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("pipes", pipeUri).request().get();
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("pipes", pipeUri).request().get();
         String entity = response.readEntity(String.class);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(StatusCodes.PIPE_FAILED, node.at("/warnings/0/0").asInt());
-        assertEquals(node.at("/warnings/0/3").asText(), "415 Unsupported Media Type");
+        assertEquals(node.at("/warnings/0/3").asText(),
+                "415 Unsupported Media Type");
     }
 
     @Test
-    public void testSearchWithMultiplePipeWarnings() throws KustvaktException {
-        String url = target().getUri().toString() + API_VERSION + "/test/tralala";
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("pipes", url + "," + "http://glemm").request().get();
+    public void testSearchWithMultiplePipeWarnings () throws KustvaktException {
+        String url = target().getUri().toString() + API_VERSION
+                + "/test/tralala";
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("pipes", url + "," + "http://glemm").request()
+                .get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -169,37 +235,73 @@
     }
 
     @Test
-    public void testSearchWithInvalidJsonResponse() throws KustvaktException {
-        mockClient.reset().when(request().withMethod("POST").withPath("/invalid-response").withHeaders(new Header("Content-Type", "application/json; charset=utf-8"), new Header("Accept", "application/json"))).respond(response().withBody("{blah:}").withStatusCode(200).withHeaders(new Header("Content-Type", "application/json; charset=utf-8")));
+    public void testSearchWithInvalidJsonResponse () throws KustvaktException {
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/invalid-response")
+                        .withHeaders(
+                                new Header("Content-Type",
+                                        "application/json; charset=utf-8"),
+                                new Header("Accept", "application/json")))
+                .respond(response().withBody("{blah:}").withStatusCode(200)
+                        .withHeaders(new Header("Content-Type",
+                                "application/json; charset=utf-8")));
         String pipeUri = "http://localhost:" + port + "/invalid-response";
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("pipes", pipeUri).request().get();
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("pipes", pipeUri).request().get();
         String entity = response.readEntity(String.class);
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.DESERIALIZATION_FAILED, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.DESERIALIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
     }
 
     @Test
-    public void testSearchWithPlainTextResponse() throws KustvaktException {
-        mockClient.reset().when(request().withMethod("POST").withPath("/plain-text").withHeaders(new Header("Content-Type", "application/json; charset=utf-8"), new Header("Accept", "application/json"))).respond(response().withBody("blah").withStatusCode(200));
+    public void testSearchWithPlainTextResponse () throws KustvaktException {
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/plain-text")
+                        .withHeaders(
+                                new Header("Content-Type",
+                                        "application/json; charset=utf-8"),
+                                new Header("Accept", "application/json")))
+                .respond(response().withBody("blah").withStatusCode(200));
         String pipeUri = "http://localhost:" + port + "/plain-text";
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("pipes", pipeUri).request().get();
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("pipes", pipeUri).request().get();
         String entity = response.readEntity(String.class);
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.DESERIALIZATION_FAILED, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.DESERIALIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
     }
 
     @Test
-    public void testSearchWithMultipleAndUnknownPipes() throws KustvaktException {
-        mockClient.reset().when(request().withMethod("POST").withPath("/glemm").withHeaders(new Header("Content-Type", "application/json; charset=utf-8"), new Header("Accept", "application/json"))).respond(response().withHeader(new Header("Content-Type", "application/json; charset=utf-8")).withBody(pipeJson).withStatusCode(200));
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("pipes", "http://unknown" + "," + glemmUri).request().get();
+    public void testSearchWithMultipleAndUnknownPipes ()
+            throws KustvaktException {
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/glemm")
+                        .withHeaders(
+                                new Header("Content-Type",
+                                        "application/json; charset=utf-8"),
+                                new Header("Accept", "application/json")))
+                .respond(response()
+                        .withHeader(new Header("Content-Type",
+                                "application/json; charset=utf-8"))
+                        .withBody(pipeJson).withStatusCode(200));
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("pipes", "http://unknown" + "," + glemmUri)
+                .request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(2, node.at("/query/wrap/key").size());
         assertTrue(node.at("/warnings").isMissingNode());
-        response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("pipes", glemmUri + ",http://unknown").request().get();
+        response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("pipes", glemmUri + ",http://unknown").request()
+                .get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         entity = response.readEntity(String.class);
         node = JsonUtils.readTree(entity);
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/lite/LiteSearchTokenSnippetTest.java b/full/src/test/java/de/ids_mannheim/korap/web/lite/LiteSearchTokenSnippetTest.java
index 75b9920..fb78508 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/lite/LiteSearchTokenSnippetTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/lite/LiteSearchTokenSnippetTest.java
@@ -18,8 +18,12 @@
 public class LiteSearchTokenSnippetTest extends LiteJerseyTest {
 
     @Test
-    public void testSearchWithTokens() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=das]").queryParam("ql", "poliqarp").queryParam("show-tokens", "true").queryParam("context", "sentence").queryParam("count", "13").request().get();
+    public void testSearchWithTokens () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=das]").queryParam("ql", "poliqarp")
+                .queryParam("show-tokens", "true")
+                .queryParam("context", "sentence").queryParam("count", "13")
+                .request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
@@ -31,8 +35,12 @@
     }
 
     @Test
-    public void testSearchWithoutTokens() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=das]").queryParam("ql", "poliqarp").queryParam("show-tokens", "false").queryParam("context", "sentence").queryParam("count", "13").request().get();
+    public void testSearchWithoutTokens () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=das]").queryParam("ql", "poliqarp")
+                .queryParam("show-tokens", "false")
+                .queryParam("context", "sentence").queryParam("count", "13")
+                .request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
@@ -42,8 +50,13 @@
     }
 
     @Test
-    public void testSearchPublicMetadataWithTokens() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=das]").queryParam("ql", "poliqarp").queryParam("access-rewrite-disabled", "true").queryParam("show-tokens", "true").queryParam("context", "sentence").queryParam("count", "13").request().get();
+    public void testSearchPublicMetadataWithTokens () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=das]").queryParam("ql", "poliqarp")
+                .queryParam("access-rewrite-disabled", "true")
+                .queryParam("show-tokens", "true")
+                .queryParam("context", "sentence").queryParam("count", "13")
+                .request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/lite/LiteStatisticControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/lite/LiteStatisticControllerTest.java
index 65e57c3..4314ef0 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/lite/LiteStatisticControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/lite/LiteStatisticControllerTest.java
@@ -21,10 +21,13 @@
 public class LiteStatisticControllerTest extends LiteJerseyTest {
 
     @Test
-    public void testStatisticsWithCq() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("statistics").queryParam("cq", "textType=Abhandlung & corpusSigle=GOE").request().method("GET");
+    public void testStatisticsWithCq () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("statistics")
+                .queryParam("cq", "textType=Abhandlung & corpusSigle=GOE")
+                .request().method("GET");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
-        assertEquals(response.getHeaders().getFirst("X-Index-Revision"), "Wes8Bd4h1OypPqbWF5njeQ==");
+        assertEquals(response.getHeaders().getFirst("X-Index-Revision"),
+                "Wes8Bd4h1OypPqbWF5njeQ==");
         String query = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(query);
         assertEquals(2, node.at("/documents").asInt());
@@ -35,8 +38,12 @@
     }
 
     @Test
-    public void testStatisticsWithCqAndCorpusQuery() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("statistics").queryParam("cq", "textType=Abhandlung & corpusSigle=GOE").queryParam("corpusQuery", "textType=Autobiographie & corpusSigle=GOE").request().method("GET");
+    public void testStatisticsWithCqAndCorpusQuery () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("statistics")
+                .queryParam("cq", "textType=Abhandlung & corpusSigle=GOE")
+                .queryParam("corpusQuery",
+                        "textType=Autobiographie & corpusSigle=GOE")
+                .request().method("GET");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String query = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(query);
@@ -48,8 +55,11 @@
     }
 
     @Test
-    public void testStatisticsWithCorpusQuery() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("statistics").queryParam("corpusQuery", "textType=Autobiographie & corpusSigle=GOE").request().method("GET");
+    public void testStatisticsWithCorpusQuery () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("statistics")
+                .queryParam("corpusQuery",
+                        "textType=Autobiographie & corpusSigle=GOE")
+                .request().method("GET");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String query = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(query);
@@ -58,12 +68,14 @@
         assertEquals(19387, node.at("/sentences").asInt());
         assertEquals(514, node.at("/paragraphs").asInt());
         assertEquals(StatusCodes.DEPRECATED, node.at("/warnings/0/0").asInt());
-        assertEquals(node.at("/warnings/0/1").asText(), "Parameter corpusQuery is deprecated in favor of cq.");
+        assertEquals(node.at("/warnings/0/1").asText(),
+                "Parameter corpusQuery is deprecated in favor of cq.");
     }
 
     @Test
-    public void testEmptyStatistics() throws KustvaktException {
-        Response response = target().path(API_VERSION).path("statistics").queryParam("corpusQuery", "").request().method("GET");
+    public void testEmptyStatistics () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("statistics")
+                .queryParam("corpusQuery", "").request().method("GET");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String query = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(query);
@@ -71,7 +83,8 @@
         assertEquals(665842, node.at("/tokens").asInt());
         assertEquals(25074, node.at("/sentences").asInt());
         assertEquals(772, node.at("/paragraphs").asInt());
-        response = target().path(API_VERSION).path("statistics").request().method("GET");
+        response = target().path(API_VERSION).path("statistics").request()
+                .method("GET");
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         query = response.readEntity(String.class);
         node = JsonUtils.readTree(query);
@@ -82,11 +95,19 @@
     }
 
     @Test
-    public void testGetStatisticsWithKoralQuery() throws IOException, KustvaktException {
-        Response response = target().path(API_VERSION).path("statistics").request().header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON).post(Entity.json("{ \"collection\" : {\"@type\": " + "\"koral:doc\", \"key\": \"availability\", \"match\": " + "\"match:eq\", \"type\": \"type:regex\", \"value\": " + "\"CC-BY.*\"} }"));
+    public void testGetStatisticsWithKoralQuery ()
+            throws IOException, KustvaktException {
+        Response response = target().path(API_VERSION).path("statistics")
+                .request()
+                .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
+                .post(Entity.json("{ \"collection\" : {\"@type\": "
+                        + "\"koral:doc\", \"key\": \"availability\", \"match\": "
+                        + "\"match:eq\", \"type\": \"type:regex\", \"value\": "
+                        + "\"CC-BY.*\"} }"));
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
-        assertEquals(response.getHeaders().getFirst("X-Index-Revision"), "Wes8Bd4h1OypPqbWF5njeQ==");
+        assertEquals(response.getHeaders().getFirst("X-Index-Revision"),
+                "Wes8Bd4h1OypPqbWF5njeQ==");
         JsonNode node = JsonUtils.readTree(ent);
         assertEquals(2, node.at("/documents").asInt());
         assertEquals(72770, node.at("/tokens").asInt());
@@ -95,28 +116,42 @@
     }
 
     @Test
-    public void testGetStatisticsWithEmptyCollection() throws IOException, KustvaktException {
-        Response response = target().path(API_VERSION).path("statistics").request().header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON).post(Entity.json("{}"));
+    public void testGetStatisticsWithEmptyCollection ()
+            throws IOException, KustvaktException {
+        Response response = target().path(API_VERSION).path("statistics")
+                .request()
+                .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
+                .post(Entity.json("{}"));
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
-        assertEquals(node.at("/errors/0/0").asInt(), de.ids_mannheim.korap.util.StatusCodes.MISSING_COLLECTION);
-        assertEquals(node.at("/errors/0/1").asText(), "Collection is not found");
+        assertEquals(node.at("/errors/0/0").asInt(),
+                de.ids_mannheim.korap.util.StatusCodes.MISSING_COLLECTION);
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Collection is not found");
     }
 
     @Test
-    public void testGetStatisticsWithIncorrectJson() throws IOException, KustvaktException {
-        Response response = target().path(API_VERSION).path("statistics").request().header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON).post(Entity.json("{ \"collection\" : }"));
+    public void testGetStatisticsWithIncorrectJson ()
+            throws IOException, KustvaktException {
+        Response response = target().path(API_VERSION).path("statistics")
+                .request()
+                .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
+                .post(Entity.json("{ \"collection\" : }"));
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
         String ent = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
-        assertEquals(StatusCodes.DESERIALIZATION_FAILED, node.at("/errors/0/0").asInt());
-        assertEquals(node.at("/errors/0/1").asText(), "Failed deserializing json object: { \"collection\" : }");
+        assertEquals(StatusCodes.DESERIALIZATION_FAILED,
+                node.at("/errors/0/0").asInt());
+        assertEquals(node.at("/errors/0/1").asText(),
+                "Failed deserializing json object: { \"collection\" : }");
     }
 
     @Test
-    public void testGetStatisticsWithoutKoralQuery() throws IOException, KustvaktException {
-        Response response = target().path(API_VERSION).path("statistics").request().post(Entity.json(""));
+    public void testGetStatisticsWithoutKoralQuery ()
+            throws IOException, KustvaktException {
+        Response response = target().path(API_VERSION).path("statistics")
+                .request().post(Entity.json(""));
         String ent = response.readEntity(String.class);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         JsonNode node = JsonUtils.readTree(ent);
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/lite/SearchNetworkEndpointTest.java b/full/src/test/java/de/ids_mannheim/korap/web/lite/SearchNetworkEndpointTest.java
index fa72cee..81c2430 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/lite/SearchNetworkEndpointTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/lite/SearchNetworkEndpointTest.java
@@ -42,26 +42,41 @@
 
     private String endpointURL = "http://localhost:" + port + "/searchEndpoint";
 
-    public SearchNetworkEndpointTest() throws IOException {
-        searchResult = IOUtils.toString(ClassLoader.getSystemResourceAsStream("network-output/search-result.jsonld"), StandardCharsets.UTF_8);
+    public SearchNetworkEndpointTest () throws IOException {
+        searchResult = IOUtils.toString(
+                ClassLoader.getSystemResourceAsStream(
+                        "network-output/search-result.jsonld"),
+                StandardCharsets.UTF_8);
     }
 
     @BeforeEach
-    public void startMockServer() {
+    public void startMockServer () {
         mockServer = startClientAndServer(port);
         mockClient = new MockServerClient("localhost", mockServer.getPort());
     }
 
     @AfterEach
-    public void stopMockServer() {
+    public void stopMockServer () {
         mockServer.stop();
     }
 
     @Test
-    public void testSearchNetwork() throws IOException, KustvaktException, URISyntaxException {
+    public void testSearchNetwork ()
+            throws IOException, KustvaktException, URISyntaxException {
         config.setNetworkEndpointURL(endpointURL);
-        mockClient.reset().when(request().withMethod("POST").withPath("/searchEndpoint").withHeaders(new Header("Content-Type", "application/json; charset=utf-8"), new Header("Accept", "application/json"))).respond(response().withHeader(new Header("Content-Type", "application/json; charset=utf-8")).withBody(searchResult).withStatusCode(200));
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("engine", "network").request().get();
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/searchEndpoint")
+                        .withHeaders(
+                                new Header("Content-Type",
+                                        "application/json; charset=utf-8"),
+                                new Header("Accept", "application/json")))
+                .respond(response()
+                        .withHeader(new Header("Content-Type",
+                                "application/json; charset=utf-8"))
+                        .withBody(searchResult).withStatusCode(200));
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("engine", "network").request().get();
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
@@ -69,22 +84,29 @@
     }
 
     @Test
-    public void testSearchWithUnknownURL() throws IOException, KustvaktException {
+    public void testSearchWithUnknownURL ()
+            throws IOException, KustvaktException {
         config.setNetworkEndpointURL("http://localhost:1040/search");
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("engine", "network").request().get();
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("engine", "network").request().get();
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.SEARCH_NETWORK_ENDPOINT_FAILED, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.SEARCH_NETWORK_ENDPOINT_FAILED,
+                node.at("/errors/0/0").asInt());
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
     }
 
     @Test
-    public void testSearchWithUnknownHost() throws KustvaktException {
+    public void testSearchWithUnknownHost () throws KustvaktException {
         config.setNetworkEndpointURL("http://search.com");
-        Response response = target().path(API_VERSION).path("search").queryParam("q", "[orth=der]").queryParam("ql", "poliqarp").queryParam("engine", "network").request().get();
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("engine", "network").request().get();
         String entity = response.readEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.SEARCH_NETWORK_ENDPOINT_FAILED, node.at("/errors/0/0").asInt());
+        assertEquals(StatusCodes.SEARCH_NETWORK_ENDPOINT_FAILED,
+                node.at("/errors/0/0").asInt());
         assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
     }
 }
diff --git a/full/src/test/resources/test-config-icc.xml b/full/src/test/resources/test-config-icc.xml
index 9d65017..d418f05 100644
--- a/full/src/test/resources/test-config-icc.xml
+++ b/full/src/test/resources/test-config-icc.xml
@@ -1,8 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xmlns:p="http://www.springframework.org/schema/p" xmlns:util="http://www.springframework.org/schema/util"
-	xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
-	xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context"
+	xmlns:p="http://www.springframework.org/schema/p"
+	xmlns:util="http://www.springframework.org/schema/util"
+	xmlns:aop="http://www.springframework.org/schema/aop"
+	xmlns:tx="http://www.springframework.org/schema/tx"
+	xmlns="http://www.springframework.org/schema/beans"
+	xmlns:context="http://www.springframework.org/schema/context"
 	xmlns:cache="http://www.springframework.org/schema/cache"
 	xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans.xsd
@@ -15,7 +18,8 @@
            http://www.springframework.org/schema/util
            http://www.springframework.org/schema/util/spring-util.xsd">
 
-	<context:component-scan base-package="de.ids_mannheim.korap" />
+	<context:component-scan
+		base-package="de.ids_mannheim.korap" />
 	<context:annotation-config />
 
 	<bean id="props"
@@ -44,17 +48,12 @@
 			</array>
 		</property>
 	</bean>
-	
-	<!-- 
-	<bean id='cacheManager' class='org.springframework.cache.ehcache.EhCacheCacheManager'
-		p:cacheManager-ref='ehcache' />
 
-	<bean id='ehcache'
-		class='org.springframework.cache.ehcache.EhCacheManagerFactoryBean'
-		p:configLocation='classpath:ehcache.xml' p:shared='true' />
- 	-->
-	<bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource"
-		lazy-init="true">
+	<!-- <bean id='cacheManager' class='org.springframework.cache.ehcache.EhCacheCacheManager' 
+		p:cacheManager-ref='ehcache' /> <bean id='ehcache' class='org.springframework.cache.ehcache.EhCacheManagerFactoryBean' 
+		p:configLocation='classpath:ehcache.xml' p:shared='true' /> -->
+	<bean id="dataSource"
+		class="org.apache.commons.dbcp2.BasicDataSource" lazy-init="true">
 		<!-- <property name="driverClassName" value="${jdbc.driverClassName}" /> -->
 		<property name="url" value="${jdbc.url}" />
 		<property name="username" value="${jdbc.username}" />
@@ -86,7 +85,8 @@
 		</property>
 	</bean>
 
-	<bean id="c3p0DataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
+	<bean id="c3p0DataSource"
+		class="com.mchange.v2.c3p0.ComboPooledDataSource"
 		destroy-method="close">
 		<property name="driverClass" value="${jdbc.driverClassName}" />
 		<property name="jdbcUrl" value="${jdbc.url}" />
@@ -99,21 +99,24 @@
 	</bean>
 
 	<!-- to configure database for sqlite, mysql, etc. migrations -->
-	<bean id="flywayConfig" class="org.flywaydb.core.api.configuration.ClassicConfiguration">
+	<bean id="flywayConfig"
+		class="org.flywaydb.core.api.configuration.ClassicConfiguration">
 		<!-- drop existing tables and create new tables -->
 		<property name="validateOnMigrate" value="true" />
 		<property name="cleanOnValidationError" value="true" />
 		<property name="baselineOnMigrate" value="false" />
-		<property name="locations" value="#{'${jdbc.schemaPath}'.split(',')}"/>
+		<property name="locations"
+			value="#{'${jdbc.schemaPath}'.split(',')}" />
 		<property name="dataSource" ref="sqliteDataSource" />
 		<!-- <property name="dataSource" ref="dataSource" /> -->
 		<property name="outOfOrder" value="true" />
 	</bean>
-	
-	<bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate">
-	    <constructor-arg ref="flywayConfig"/>
+
+	<bean id="flyway" class="org.flywaydb.core.Flyway"
+		init-method="migrate">
+		<constructor-arg ref="flywayConfig" />
 	</bean>
-	
+
 
 	<bean id="entityManagerFactory"
 		class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
@@ -129,7 +132,8 @@
 		<property name="jpaVendorAdapter">
 			<bean id="jpaVendorAdapter"
 				class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
-				<property name="databasePlatform" value="${hibernate.dialect}" />
+				<property name="databasePlatform"
+					value="${hibernate.dialect}" />
 			</bean>
 		</property>
 		<property name="jpaProperties">
@@ -150,8 +154,10 @@
 
 	<tx:annotation-driven proxy-target-class="true"
 		transaction-manager="transactionManager" />
-	<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
-		<property name="entityManagerFactory" ref="entityManagerFactory" />
+	<bean id="transactionManager"
+		class="org.springframework.orm.jpa.JpaTransactionManager">
+		<property name="entityManagerFactory"
+			ref="entityManagerFactory" />
 	</bean>
 
 	<bean id="transactionTemplate"
@@ -161,75 +167,95 @@
 
 	<!-- Data access objects -->
 	<bean id="adminDao" class="de.ids_mannheim.korap.dao.AdminDaoImpl" />
-	<bean id="resourceDao" class="de.ids_mannheim.korap.dao.ResourceDao" />
-	<bean id="accessScopeDao" class="de.ids_mannheim.korap.oauth2.dao.AccessScopeDao" />
-	<bean id="authorizationDao" class="de.ids_mannheim.korap.oauth2.dao.CachedAuthorizationDaoImpl" />
-	
+	<bean id="resourceDao"
+		class="de.ids_mannheim.korap.dao.ResourceDao" />
+	<bean id="accessScopeDao"
+		class="de.ids_mannheim.korap.oauth2.dao.AccessScopeDao" />
+	<bean id="authorizationDao"
+		class="de.ids_mannheim.korap.oauth2.dao.CachedAuthorizationDaoImpl" />
+
 	<!-- Services -->
-	<bean id="scopeService" class="de.ids_mannheim.korap.oauth2.service.OAuth2ScopeServiceImpl" />
-	
-	
+	<bean id="scopeService"
+		class="de.ids_mannheim.korap.oauth2.service.OAuth2ScopeServiceImpl" />
+
+
 	<!-- Controller -->
-	
-	
+
+
 	<!-- props are injected from default-config.xml -->
-	<bean id="kustvakt_config" class="de.ids_mannheim.korap.config.FullConfiguration">
+	<bean id="kustvakt_config"
+		class="de.ids_mannheim.korap.config.FullConfiguration">
 		<constructor-arg name="properties" ref="props" />
 	</bean>
 
-	<bean id="initializator" class="de.ids_mannheim.korap.init.Initializator"
+	<bean id="initializator"
+		class="de.ids_mannheim.korap.init.Initializator"
 		init-method="initTest">
 	</bean>
 
 	<!-- Krill -->
-	<bean id="search_krill" class="de.ids_mannheim.korap.web.SearchKrill">
+	<bean id="search_krill"
+		class="de.ids_mannheim.korap.web.SearchKrill">
 		<constructor-arg value="${krill.indexDir}" />
 	</bean>
 
 	<!-- Validator -->
-	<bean id="validator" class="de.ids_mannheim.korap.validator.ApacheValidator"/>
-	
+	<bean id="validator"
+		class="de.ids_mannheim.korap.validator.ApacheValidator" />
+
 	<!-- URLValidator -->
-	<bean id="redirectURIValidator" class="org.apache.commons.validator.routines.UrlValidator">
+	<bean id="redirectURIValidator"
+		class="org.apache.commons.validator.routines.UrlValidator">
 		<constructor-arg value="http,https" index="0" />
-		<constructor-arg index="1" type="long" 
-		value="#{T(org.apache.commons.validator.routines.UrlValidator).ALLOW_LOCAL_URLS + 
-		T(org.apache.commons.validator.routines.UrlValidator).NO_FRAGMENTS}"/>
+		<constructor-arg index="1" type="long"
+			value="#{T(org.apache.commons.validator.routines.UrlValidator).ALLOW_LOCAL_URLS + 
+		T(org.apache.commons.validator.routines.UrlValidator).NO_FRAGMENTS}" />
 	</bean>
-	<bean id="urlValidator" class="org.apache.commons.validator.routines.UrlValidator">
+	<bean id="urlValidator"
+		class="org.apache.commons.validator.routines.UrlValidator">
 		<constructor-arg value="http,https" />
 	</bean>
 
 	<!-- Rewrite -->
-	<bean id="foundryRewrite" class="de.ids_mannheim.korap.rewrite.FoundryRewrite"/>
-	<bean id="collectionRewrite" class="de.ids_mannheim.korap.rewrite.CollectionRewrite"/>
-	<bean id="collectionCleanRewrite" class="de.ids_mannheim.korap.rewrite.CollectionCleanRewrite"/>
-	<bean id="virtualCorpusRewrite" class="de.ids_mannheim.korap.rewrite.VirtualCorpusRewrite"/>
-	<bean id="collectionConstraint" class="de.ids_mannheim.korap.rewrite.CollectionConstraint"/>
- 	<bean id="queryReferenceRewrite" class="de.ids_mannheim.korap.rewrite.QueryReferenceRewrite"/>
-	
+	<bean id="foundryRewrite"
+		class="de.ids_mannheim.korap.rewrite.FoundryRewrite" />
+	<bean id="collectionRewrite"
+		class="de.ids_mannheim.korap.rewrite.CollectionRewrite" />
+	<bean id="collectionCleanRewrite"
+		class="de.ids_mannheim.korap.rewrite.CollectionCleanRewrite" />
+	<bean id="virtualCorpusRewrite"
+		class="de.ids_mannheim.korap.rewrite.VirtualCorpusRewrite" />
+	<bean id="collectionConstraint"
+		class="de.ids_mannheim.korap.rewrite.CollectionConstraint" />
+	<bean id="queryReferenceRewrite"
+		class="de.ids_mannheim.korap.rewrite.QueryReferenceRewrite" />
+
 	<util:list id="rewriteTasks"
 		value-type="de.ids_mannheim.korap.rewrite.RewriteTask">
-		<!-- <ref bean="collectionConstraint" />
-		<ref bean="collectionCleanRewrite" /> -->
+		<!-- <ref bean="collectionConstraint" /> <ref bean="collectionCleanRewrite" 
+			/> -->
 		<ref bean="foundryRewrite" />
 		<!-- <ref bean="collectionRewrite" /> -->
 		<ref bean="virtualCorpusRewrite" />
 		<ref bean="queryReferenceRewrite" />
 	</util:list>
-	
-	<bean id="rewriteHandler" class="de.ids_mannheim.korap.rewrite.RewriteHandler">
-		<constructor-arg ref="rewriteTasks"/>
+
+	<bean id="rewriteHandler"
+		class="de.ids_mannheim.korap.rewrite.RewriteHandler">
+		<constructor-arg ref="rewriteTasks" />
 	</bean>
 
-	<bean id="kustvaktResponseHandler" class="de.ids_mannheim.korap.web.KustvaktResponseHandler">
+	<bean id="kustvaktResponseHandler"
+		class="de.ids_mannheim.korap.web.KustvaktResponseHandler">
 	</bean>
 
 	<!-- OAuth -->
-	<bean id="oauth2ResponseHandler" class="de.ids_mannheim.korap.web.OAuth2ResponseHandler">
+	<bean id="oauth2ResponseHandler"
+		class="de.ids_mannheim.korap.web.OAuth2ResponseHandler">
 	</bean>
 
-	<bean name="kustvakt_encryption" class="de.ids_mannheim.korap.encryption.KustvaktEncryption">
+	<bean name="kustvakt_encryption"
+		class="de.ids_mannheim.korap.encryption.KustvaktEncryption">
 		<constructor-arg ref="kustvakt_config" />
 	</bean>
 
@@ -251,7 +277,8 @@
 	<!-- specify type for constructor argument -->
 	<bean id="authenticationManager"
 		class="de.ids_mannheim.korap.authentication.KustvaktAuthenticationManager">
-		<constructor-arg type="de.ids_mannheim.korap.interfaces.EncryptionIface"
+		<constructor-arg
+			type="de.ids_mannheim.korap.interfaces.EncryptionIface"
 			ref="kustvakt_encryption" />
 		<constructor-arg ref="kustvakt_config" />
 		<!-- inject authentication providers to use -->
@@ -266,7 +293,8 @@
 		<!-- the transactional semantics... -->
 		<tx:attributes>
 			<!-- all methods starting with 'get' are read-only -->
-			<tx:method name="get*" read-only="true" rollback-for="KorAPException" />
+			<tx:method name="get*" read-only="true"
+				rollback-for="KorAPException" />
 			<!-- other methods use the default transaction settings (see below) -->
 			<tx:method name="*" rollback-for="KorAPException" />
 		</tx:attributes>
@@ -287,11 +315,13 @@
 	</bean>
 
 	<!-- mail -->
-	<bean id="authenticator" class="de.ids_mannheim.korap.service.MailAuthenticator">
+	<bean id="authenticator"
+		class="de.ids_mannheim.korap.service.MailAuthenticator">
 		<constructor-arg index="0" value="${mail.username}" />
 		<constructor-arg index="1" value="${mail.password}" />
 	</bean>
-	<bean id="smtpSession" class="jakarta.mail.Session" factory-method="getInstance">
+	<bean id="smtpSession" class="jakarta.mail.Session"
+		factory-method="getInstance">
 		<constructor-arg index="0">
 			<props>
 				<prop key="mail.smtp.submitter">${mail.username}</prop>
@@ -304,10 +334,12 @@
 		</constructor-arg>
 		<constructor-arg index="1" ref="authenticator" />
 	</bean>
-	<bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
+	<bean id="mailSender"
+		class="org.springframework.mail.javamail.JavaMailSenderImpl">
 		<property name="session" ref="smtpSession" />
 	</bean>
-	<bean id="velocityEngine" class="org.apache.velocity.app.VelocityEngine">
+	<bean id="velocityEngine"
+		class="org.apache.velocity.app.VelocityEngine">
 		<constructor-arg index="0">
 			<props>
 				<prop key="resource.loader">class</prop>
diff --git a/full/src/test/resources/test-config-lite.xml b/full/src/test/resources/test-config-lite.xml
index 96ac3bf..5de7bd6 100644
--- a/full/src/test/resources/test-config-lite.xml
+++ b/full/src/test/resources/test-config-lite.xml
@@ -1,7 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <beans xmlns="http://www.springframework.org/schema/beans"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
-	xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:util="http://www.springframework.org/schema/util"
+	xmlns:context="http://www.springframework.org/schema/context"
+	xmlns:tx="http://www.springframework.org/schema/tx"
 	xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans.xsd
            http://www.springframework.org/schema/tx
@@ -10,8 +12,9 @@
            http://www.springframework.org/schema/context/spring-context.xsd
            http://www.springframework.org/schema/util
            http://www.springframework.org/schema/util/spring-util.xsd">
-	
-	<context:component-scan base-package="
+
+	<context:component-scan
+		base-package="
 		de.ids_mannheim.korap.core.service,
 		de.ids_mannheim.korap.core.web,
 		de.ids_mannheim.korap.web.filter, 
@@ -44,14 +47,16 @@
 		</property>
 	</bean>
 
-	<bean id="config" class="de.ids_mannheim.korap.config.KustvaktConfiguration">
-		<constructor-arg index="0" name="properties" ref="properties" />
+	<bean id="config"
+		class="de.ids_mannheim.korap.config.KustvaktConfiguration">
+		<constructor-arg index="0" name="properties"
+			ref="properties" />
 	</bean>
 
 	<!-- Database -->
 
-	<bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource"
-		lazy-init="true">
+	<bean id="dataSource"
+		class="org.apache.commons.dbcp2.BasicDataSource" lazy-init="true">
 		<!-- <property name="driverClassName" value="${jdbc.driverClassName}" /> -->
 		<property name="url" value="${jdbc.url}" />
 		<property name="username" value="${jdbc.username}" />
@@ -66,7 +71,8 @@
 	<bean id="sqliteDataSource"
 		class="org.springframework.jdbc.datasource.SingleConnectionDataSource"
 		lazy-init="true">
-		<property name="driverClassName" value="${jdbc.driverClassName}" />
+		<property name="driverClassName"
+			value="${jdbc.driverClassName}" />
 		<property name="url" value="${jdbc.url}" />
 		<property name="username" value="${jdbc.username}" />
 		<property name="password" value="${jdbc.password}" />
@@ -82,17 +88,20 @@
 		</property>
 	</bean>
 
-	<bean id="flywayConfig" class="org.flywaydb.core.api.configuration.ClassicConfiguration">
-	    <property name="baselineOnMigrate" value="true" />
+	<bean id="flywayConfig"
+		class="org.flywaydb.core.api.configuration.ClassicConfiguration">
+		<property name="baselineOnMigrate" value="true" />
 		<!-- <property name="validateOnMigrate" value="false" /> -->
 		<!-- <property name="cleanOnValidationError" value="true" /> -->
-		<property name="locations" value="#{'${jdbc.schemaPath}'.split(',')}"/>
+		<property name="locations"
+			value="#{'${jdbc.schemaPath}'.split(',')}" />
 		<property name="dataSource" ref="dataSource" />
 		<property name="outOfOrder" value="true" />
 	</bean>
-	
-	<bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate">
-	    <constructor-arg ref="flywayConfig"/>
+
+	<bean id="flyway" class="org.flywaydb.core.Flyway"
+		init-method="migrate">
+		<constructor-arg ref="flywayConfig" />
 	</bean>
 
 	<bean id="entityManagerFactory"
@@ -107,7 +116,8 @@
 		<property name="jpaVendorAdapter">
 			<bean id="jpaVendorAdapter"
 				class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
-				<property name="databasePlatform" value="${hibernate.dialect}" />
+				<property name="databasePlatform"
+					value="${hibernate.dialect}" />
 			</bean>
 		</property>
 		<property name="jpaProperties">
@@ -127,8 +137,10 @@
 	<tx:annotation-driven proxy-target-class="true"
 		transaction-manager="transactionManager" />
 
-	<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
-		<property name="entityManagerFactory" ref="entityManagerFactory" />
+	<bean id="transactionManager"
+		class="org.springframework.orm.jpa.JpaTransactionManager">
+		<property name="entityManagerFactory"
+			ref="entityManagerFactory" />
 	</bean>
 
 	<bean id="transactionTemplate"
@@ -141,10 +153,11 @@
 	</bean>
 
 	<!-- Search Engine -->
-	<bean id="search_krill" class="de.ids_mannheim.korap.web.SearchKrill">
+	<bean id="search_krill"
+		class="de.ids_mannheim.korap.web.SearchKrill">
 		<constructor-arg value="${krill.indexDir}" />
 	</bean>
-	
+
 
 	<!-- Filters -->
 	<!-- <bean id="APIVersionFilter" class="de.ids_mannheim.korap.web.APIVersionFilter" 
@@ -154,37 +167,42 @@
 		class="de.ids_mannheim.korap.authentication.DummyAuthenticationManager" />
 
 	<!-- Response handler -->
-	<bean id="kustvaktResponseHandler" class="de.ids_mannheim.korap.web.KustvaktResponseHandler">
+	<bean id="kustvaktResponseHandler"
+		class="de.ids_mannheim.korap.web.KustvaktResponseHandler">
 	</bean>
 
 	<!-- Controllers -->
-	<!-- added via component-scan 
-	<bean id="annotationController"
-		class="de.ids_mannheim.korap.web.controller.AnnotationController" />
-	<bean id="searchController" class="de.ids_mannheim.korap.web.controller.SearchController" />
-	<bean id="statisticController"
-		class="de.ids_mannheim.korap.web.controller.StatisticController" />
- -->
+	<!-- added via component-scan <bean id="annotationController" class="de.ids_mannheim.korap.web.controller.AnnotationController" 
+		/> <bean id="searchController" class="de.ids_mannheim.korap.web.controller.SearchController" 
+		/> <bean id="statisticController" class="de.ids_mannheim.korap.web.controller.StatisticController" 
+		/> -->
 	<!-- Services -->
 	<bean id="scopeService"
 		class="de.ids_mannheim.korap.oauth2.service.DummyOAuth2ScopeServiceImpl" />
 
 	<!-- DAO -->
-	<bean id="adminDao" class="de.ids_mannheim.korap.dao.DummyAdminDaoImpl" />
-	<bean id="annotationDao" class="de.ids_mannheim.korap.dao.AnnotationDao" />
+	<bean id="adminDao"
+		class="de.ids_mannheim.korap.dao.DummyAdminDaoImpl" />
+	<bean id="annotationDao"
+		class="de.ids_mannheim.korap.dao.AnnotationDao" />
 
 	<!-- DTO Converter -->
-	<bean id="annotationConverter" class="de.ids_mannheim.korap.dto.converter.AnnotationConverter" />
+	<bean id="annotationConverter"
+		class="de.ids_mannheim.korap.dto.converter.AnnotationConverter" />
 
 	<!-- Rewrite -->
-	<bean id="layerMapper" class="de.ids_mannheim.korap.rewrite.LayerMapper" />
-	<bean id="foundryInject" class="de.ids_mannheim.korap.rewrite.FoundryInject" />
+	<bean id="layerMapper"
+		class="de.ids_mannheim.korap.rewrite.LayerMapper" />
+	<bean id="foundryInject"
+		class="de.ids_mannheim.korap.rewrite.FoundryInject" />
 
-	<util:list id="rewriteTasks" value-type="de.ids_mannheim.korap.rewrite.RewriteTask">
+	<util:list id="rewriteTasks"
+		value-type="de.ids_mannheim.korap.rewrite.RewriteTask">
 		<ref bean="foundryInject" />
 	</util:list>
 
-	<bean id="rewriteHandler" class="de.ids_mannheim.korap.rewrite.RewriteHandler">
+	<bean id="rewriteHandler"
+		class="de.ids_mannheim.korap.rewrite.RewriteHandler">
 		<constructor-arg ref="rewriteTasks" />
 	</bean>
 </beans>
\ No newline at end of file
diff --git a/full/src/test/resources/test-config.xml b/full/src/test/resources/test-config.xml
index b3ae6f3..d1dd61c 100644
--- a/full/src/test/resources/test-config.xml
+++ b/full/src/test/resources/test-config.xml
@@ -1,8 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xmlns:p="http://www.springframework.org/schema/p" xmlns:util="http://www.springframework.org/schema/util"
-	xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
-	xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context"
+	xmlns:p="http://www.springframework.org/schema/p"
+	xmlns:util="http://www.springframework.org/schema/util"
+	xmlns:aop="http://www.springframework.org/schema/aop"
+	xmlns:tx="http://www.springframework.org/schema/tx"
+	xmlns="http://www.springframework.org/schema/beans"
+	xmlns:context="http://www.springframework.org/schema/context"
 	xmlns:cache="http://www.springframework.org/schema/cache"
 	xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans.xsd
@@ -15,7 +18,8 @@
            http://www.springframework.org/schema/util
            http://www.springframework.org/schema/util/spring-util.xsd">
 
-	<context:component-scan base-package="de.ids_mannheim.korap" />
+	<context:component-scan
+		base-package="de.ids_mannheim.korap" />
 	<context:annotation-config />
 
 	<bean id="props"
@@ -45,15 +49,12 @@
 		</property>
 	</bean>
 
-	<!-- <bean id='cacheManager' class='org.springframework.cache.ehcache.EhCacheCacheManager'
-		p:cacheManager-ref='ehcache' />
-
-	<bean id='ehcache'
-		class='org.springframework.cache.ehcache.EhCacheManagerFactoryBean'
+	<!-- <bean id='cacheManager' class='org.springframework.cache.ehcache.EhCacheCacheManager' 
+		p:cacheManager-ref='ehcache' /> <bean id='ehcache' class='org.springframework.cache.ehcache.EhCacheManagerFactoryBean' 
 		p:configLocation='classpath:ehcache.xml' p:shared='true' /> -->
 
-	<bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource"
-		lazy-init="true">
+	<bean id="dataSource"
+		class="org.apache.commons.dbcp2.BasicDataSource" lazy-init="true">
 		<!-- <property name="driverClassName" value="${jdbc.driverClassName}" /> -->
 		<property name="url" value="${jdbc.url}" />
 		<property name="username" value="${jdbc.username}" />
@@ -85,7 +86,8 @@
 		</property>
 	</bean>
 
-	<bean id="c3p0DataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
+	<bean id="c3p0DataSource"
+		class="com.mchange.v2.c3p0.ComboPooledDataSource"
 		destroy-method="close">
 		<property name="driverClass" value="${jdbc.driverClassName}" />
 		<property name="jdbcUrl" value="${jdbc.url}" />
@@ -98,21 +100,24 @@
 	</bean>
 
 	<!-- to configure database for sqlite, mysql, etc. migrations -->
-	<bean id="flywayConfig" class="org.flywaydb.core.api.configuration.ClassicConfiguration">
+	<bean id="flywayConfig"
+		class="org.flywaydb.core.api.configuration.ClassicConfiguration">
 		<!-- drop existing tables and create new tables -->
 		<property name="validateOnMigrate" value="true" />
 		<property name="cleanOnValidationError" value="true" />
 		<property name="baselineOnMigrate" value="false" />
-		<property name="locations" value="#{'${jdbc.schemaPath}'.split(',')}"/>
+		<property name="locations"
+			value="#{'${jdbc.schemaPath}'.split(',')}" />
 		<!-- <property name="dataSource" ref="sqliteDataSource" /> -->
 		<property name="dataSource" ref="dataSource" />
 		<property name="outOfOrder" value="true" />
 	</bean>
-	
-	<bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate">
-	    <constructor-arg ref="flywayConfig"/>
+
+	<bean id="flyway" class="org.flywaydb.core.Flyway"
+		init-method="migrate">
+		<constructor-arg ref="flywayConfig" />
 	</bean>
-	
+
 
 	<bean id="entityManagerFactory"
 		class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
@@ -128,7 +133,8 @@
 		<property name="jpaVendorAdapter">
 			<bean id="jpaVendorAdapter"
 				class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
-				<property name="databasePlatform" value="${hibernate.dialect}" />
+				<property name="databasePlatform"
+					value="${hibernate.dialect}" />
 			</bean>
 		</property>
 		<property name="jpaProperties">
@@ -149,8 +155,10 @@
 
 	<tx:annotation-driven proxy-target-class="true"
 		transaction-manager="transactionManager" />
-	<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
-		<property name="entityManagerFactory" ref="entityManagerFactory" />
+	<bean id="transactionManager"
+		class="org.springframework.orm.jpa.JpaTransactionManager">
+		<property name="entityManagerFactory"
+			ref="entityManagerFactory" />
 	</bean>
 
 	<bean id="transactionTemplate"
@@ -160,71 +168,91 @@
 
 	<!-- Data access objects -->
 	<bean id="adminDao" class="de.ids_mannheim.korap.dao.AdminDaoImpl" />
-	<bean id="resourceDao" class="de.ids_mannheim.korap.dao.ResourceDao" />
-	<bean id="accessScopeDao" class="de.ids_mannheim.korap.oauth2.dao.AccessScopeDao" />
-	<bean id="authorizationDao" class="de.ids_mannheim.korap.oauth2.dao.CachedAuthorizationDaoImpl" />
-	
+	<bean id="resourceDao"
+		class="de.ids_mannheim.korap.dao.ResourceDao" />
+	<bean id="accessScopeDao"
+		class="de.ids_mannheim.korap.oauth2.dao.AccessScopeDao" />
+	<bean id="authorizationDao"
+		class="de.ids_mannheim.korap.oauth2.dao.CachedAuthorizationDaoImpl" />
+
 	<!-- Services -->
-	<bean id="scopeService" class="de.ids_mannheim.korap.oauth2.service.OAuth2ScopeServiceImpl" />
-	
+	<bean id="scopeService"
+		class="de.ids_mannheim.korap.oauth2.service.OAuth2ScopeServiceImpl" />
+
 	<!-- props are injected from default-config.xml -->
-	<bean id="kustvakt_config" class="de.ids_mannheim.korap.config.FullConfiguration">
+	<bean id="kustvakt_config"
+		class="de.ids_mannheim.korap.config.FullConfiguration">
 		<constructor-arg name="properties" ref="props" />
 	</bean>
 
-	<bean id="initializator" class="de.ids_mannheim.korap.init.Initializator"
+	<bean id="initializator"
+		class="de.ids_mannheim.korap.init.Initializator"
 		init-method="initTest">
 	</bean>
 
 	<!-- Krill -->
-	<bean id="search_krill" class="de.ids_mannheim.korap.web.SearchKrill">
+	<bean id="search_krill"
+		class="de.ids_mannheim.korap.web.SearchKrill">
 		<constructor-arg value="${krill.indexDir}" />
 	</bean>
 
 	<!-- Validator -->
-	<bean id="validator" class="de.ids_mannheim.korap.validator.ApacheValidator"/>
-	
+	<bean id="validator"
+		class="de.ids_mannheim.korap.validator.ApacheValidator" />
+
 	<!-- URLValidator -->
-	<bean id="redirectURIValidator" class="org.apache.commons.validator.routines.UrlValidator">
+	<bean id="redirectURIValidator"
+		class="org.apache.commons.validator.routines.UrlValidator">
 		<constructor-arg value="http,https" index="0" />
-		<constructor-arg index="1" type="long" 
-		value="#{T(org.apache.commons.validator.routines.UrlValidator).ALLOW_LOCAL_URLS + 
-		T(org.apache.commons.validator.routines.UrlValidator).NO_FRAGMENTS}"/>
+		<constructor-arg index="1" type="long"
+			value="#{T(org.apache.commons.validator.routines.UrlValidator).ALLOW_LOCAL_URLS + 
+		T(org.apache.commons.validator.routines.UrlValidator).NO_FRAGMENTS}" />
 	</bean>
-	<bean id="urlValidator" class="org.apache.commons.validator.routines.UrlValidator">
+	<bean id="urlValidator"
+		class="org.apache.commons.validator.routines.UrlValidator">
 		<constructor-arg value="http,https" />
 	</bean>
 
 	<!-- Rewrite -->
-	<bean id="foundryRewrite" class="de.ids_mannheim.korap.rewrite.FoundryRewrite"/>
-	<bean id="collectionRewrite" class="de.ids_mannheim.korap.rewrite.CollectionRewrite"/>
-	<bean id="collectionCleanRewrite" class="de.ids_mannheim.korap.rewrite.CollectionCleanRewrite"/>
-	<bean id="virtualCorpusRewrite" class="de.ids_mannheim.korap.rewrite.VirtualCorpusRewrite"/>
-	<bean id="collectionConstraint" class="de.ids_mannheim.korap.rewrite.CollectionConstraint"/>
- 	<bean id="queryReferenceRewrite" class="de.ids_mannheim.korap.rewrite.QueryReferenceRewrite"/>
-	
+	<bean id="foundryRewrite"
+		class="de.ids_mannheim.korap.rewrite.FoundryRewrite" />
+	<bean id="collectionRewrite"
+		class="de.ids_mannheim.korap.rewrite.CollectionRewrite" />
+	<bean id="collectionCleanRewrite"
+		class="de.ids_mannheim.korap.rewrite.CollectionCleanRewrite" />
+	<bean id="virtualCorpusRewrite"
+		class="de.ids_mannheim.korap.rewrite.VirtualCorpusRewrite" />
+	<bean id="collectionConstraint"
+		class="de.ids_mannheim.korap.rewrite.CollectionConstraint" />
+	<bean id="queryReferenceRewrite"
+		class="de.ids_mannheim.korap.rewrite.QueryReferenceRewrite" />
+
 	<util:list id="rewriteTasks"
 		value-type="de.ids_mannheim.korap.rewrite.RewriteTask">
-		<!-- <ref bean="collectionConstraint" />
-		<ref bean="collectionCleanRewrite" /> -->
+		<!-- <ref bean="collectionConstraint" /> <ref bean="collectionCleanRewrite" 
+			/> -->
 		<ref bean="foundryRewrite" />
 		<ref bean="collectionRewrite" />
 		<ref bean="virtualCorpusRewrite" />
 		<ref bean="queryReferenceRewrite" />
 	</util:list>
-	
-	<bean id="rewriteHandler" class="de.ids_mannheim.korap.rewrite.RewriteHandler">
-		<constructor-arg ref="rewriteTasks"/>
+
+	<bean id="rewriteHandler"
+		class="de.ids_mannheim.korap.rewrite.RewriteHandler">
+		<constructor-arg ref="rewriteTasks" />
 	</bean>
 
-	<bean id="kustvaktResponseHandler" class="de.ids_mannheim.korap.web.KustvaktResponseHandler">
+	<bean id="kustvaktResponseHandler"
+		class="de.ids_mannheim.korap.web.KustvaktResponseHandler">
 	</bean>
 
 	<!-- OAuth -->
-	<bean id="oauth2ResponseHandler" class="de.ids_mannheim.korap.web.OAuth2ResponseHandler">
+	<bean id="oauth2ResponseHandler"
+		class="de.ids_mannheim.korap.web.OAuth2ResponseHandler">
 	</bean>
 
-	<bean name="kustvakt_encryption" class="de.ids_mannheim.korap.encryption.KustvaktEncryption">
+	<bean name="kustvakt_encryption"
+		class="de.ids_mannheim.korap.encryption.KustvaktEncryption">
 		<constructor-arg ref="kustvakt_config" />
 	</bean>
 
@@ -235,9 +263,11 @@
 
 	<bean id="session_auth"
 		class="de.ids_mannheim.korap.authentication.SessionAuthentication">
-		<constructor-arg type="de.ids_mannheim.korap.config.KustvaktConfiguration"
+		<constructor-arg
+			type="de.ids_mannheim.korap.config.KustvaktConfiguration"
 			ref="kustvakt_config" />
-		<constructor-arg type="de.ids_mannheim.korap.interfaces.EncryptionIface"
+		<constructor-arg
+			type="de.ids_mannheim.korap.interfaces.EncryptionIface"
 			ref="kustvakt_encryption" />
 	</bean>
 
@@ -255,7 +285,8 @@
 	<!-- specify type for constructor argument -->
 	<bean id="authenticationManager"
 		class="de.ids_mannheim.korap.authentication.KustvaktAuthenticationManager">
-		<constructor-arg type="de.ids_mannheim.korap.interfaces.EncryptionIface"
+		<constructor-arg
+			type="de.ids_mannheim.korap.interfaces.EncryptionIface"
 			ref="kustvakt_encryption" />
 		<constructor-arg ref="kustvakt_config" />
 		<!-- inject authentication providers to use -->
@@ -270,7 +301,8 @@
 		<!-- the transactional semantics... -->
 		<tx:attributes>
 			<!-- all methods starting with 'get' are read-only -->
-			<tx:method name="get*" read-only="true" rollback-for="KorAPException" />
+			<tx:method name="get*" read-only="true"
+				rollback-for="KorAPException" />
 			<!-- other methods use the default transaction settings (see below) -->
 			<tx:method name="*" rollback-for="KorAPException" />
 		</tx:attributes>
@@ -291,11 +323,13 @@
 	</bean>
 
 	<!-- mail -->
-	<bean id="authenticator" class="de.ids_mannheim.korap.service.MailAuthenticator">
+	<bean id="authenticator"
+		class="de.ids_mannheim.korap.service.MailAuthenticator">
 		<constructor-arg index="0" value="${mail.username}" />
 		<constructor-arg index="1" value="${mail.password}" />
 	</bean>
-	<bean id="smtpSession" class="jakarta.mail.Session" factory-method="getInstance">
+	<bean id="smtpSession" class="jakarta.mail.Session"
+		factory-method="getInstance">
 		<constructor-arg index="0">
 			<props>
 				<prop key="mail.smtp.submitter">${mail.username}</prop>
@@ -308,10 +342,12 @@
 		</constructor-arg>
 		<constructor-arg index="1" ref="authenticator" />
 	</bean>
-	<bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
+	<bean id="mailSender"
+		class="org.springframework.mail.javamail.JavaMailSenderImpl">
 		<property name="session" ref="smtpSession" />
 	</bean>
-	<bean id="velocityEngine" class="org.apache.velocity.app.VelocityEngine">
+	<bean id="velocityEngine"
+		class="org.apache.velocity.app.VelocityEngine">
 		<constructor-arg index="0">
 			<props>
 				<prop key="resource.loader">class</prop>
diff --git a/full/src/test/resources/test-resource-config.xml b/full/src/test/resources/test-resource-config.xml
index 28eea3e..f26182c 100644
--- a/full/src/test/resources/test-resource-config.xml
+++ b/full/src/test/resources/test-resource-config.xml
@@ -1,8 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xmlns:p="http://www.springframework.org/schema/p" xmlns:util="http://www.springframework.org/schema/util"
-	xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
-	xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context"
+	xmlns:p="http://www.springframework.org/schema/p"
+	xmlns:util="http://www.springframework.org/schema/util"
+	xmlns:aop="http://www.springframework.org/schema/aop"
+	xmlns:tx="http://www.springframework.org/schema/tx"
+	xmlns="http://www.springframework.org/schema/beans"
+	xmlns:context="http://www.springframework.org/schema/context"
 	xmlns:cache="http://www.springframework.org/schema/cache"
 	xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans.xsd
@@ -15,8 +18,9 @@
            http://www.springframework.org/schema/util
            http://www.springframework.org/schema/util/spring-util.xsd">
 
-	<import resource="classpath:test-config.xml"/>
-	<bean id="initializator" class="de.ids_mannheim.korap.init.Initializator"
+	<import resource="classpath:test-config.xml" />
+	<bean id="initializator"
+		class="de.ids_mannheim.korap.init.Initializator"
 		init-method="initResourceTest">
 	</bean>
 
