You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by ma...@apache.org on 2018/08/01 12:34:24 UTC

[06/14] james-project git commit: JAMES-2502 merge util and util-java8

http://git-wip-us.apache.org/repos/asf/james-project/blob/630dcab1/server/container/util/src/test/java/org/apache/james/util/mime/MessageContentExtractorTest.java
----------------------------------------------------------------------
diff --git a/server/container/util/src/test/java/org/apache/james/util/mime/MessageContentExtractorTest.java b/server/container/util/src/test/java/org/apache/james/util/mime/MessageContentExtractorTest.java
new file mode 100644
index 0000000..deae849
--- /dev/null
+++ b/server/container/util/src/test/java/org/apache/james/util/mime/MessageContentExtractorTest.java
@@ -0,0 +1,514 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.util.mime;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.io.IOException;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.util.Optional;
+
+import javax.mail.internet.MimeMessage;
+
+import org.apache.james.mime4j.dom.Message;
+import org.apache.james.mime4j.dom.Multipart;
+import org.apache.james.mime4j.field.Fields;
+import org.apache.james.mime4j.message.BasicBodyFactory;
+import org.apache.james.mime4j.message.BodyPart;
+import org.apache.james.mime4j.message.BodyPartBuilder;
+import org.apache.james.mime4j.message.HeaderImpl;
+import org.apache.james.mime4j.message.MultipartBuilder;
+import org.apache.james.mime4j.stream.Field;
+import org.apache.james.mime4j.util.ByteSequence;
+import org.apache.james.util.mime.MessageContentExtractor.MessageContent;
+import org.junit.Before;
+import org.junit.Test;
+
+public class MessageContentExtractorTest {
+    private static final String BINARY_CONTENT = "binary";
+    private static final String TEXT_CONTENT = "text content";
+    private static final String HTML_CONTENT = "<b>html</b> content";
+    private static final String TEXT_CONTENT2 = "other text content";
+    private static final String HTML_CONTENT2 = "other <b>html</b> content";
+    private static final String ATTACHMENT_CONTENT = "attachment content";
+    private static final String ANY_VALUE = "anyValue";
+    private static final Field CONTENT_ID_FIELD = new Field() {
+        @Override
+        public String getName() {
+            return MessageContentExtractor.CONTENT_ID;
+        }
+
+        @Override
+        public String getBody() {
+            return ANY_VALUE;
+        }
+
+        @Override
+        public ByteSequence getRaw() {
+            return ByteSequence.EMPTY;
+        }
+    };
+
+    private MessageContentExtractor testee;
+
+    private BodyPartBuilder htmlPart;
+    private BodyPartBuilder textPart;
+    private BodyPartBuilder textAttachment;
+    private BodyPartBuilder inlineText;
+    private BodyPartBuilder inlineImage;
+
+    @Before
+    public void setup() throws IOException {
+        testee = new MessageContentExtractor();
+        textPart = BodyPartBuilder.create().setBody(TEXT_CONTENT, "plain", StandardCharsets.UTF_8);
+        htmlPart = BodyPartBuilder.create().setBody(HTML_CONTENT, "html", StandardCharsets.UTF_8);
+        textAttachment = BodyPartBuilder.create()
+                .setBody(ATTACHMENT_CONTENT, "plain", StandardCharsets.UTF_8)
+                .setContentDisposition("attachment");
+        inlineText = BodyPartBuilder.create()
+                .setBody(ATTACHMENT_CONTENT, "plain", StandardCharsets.UTF_8)
+                .setContentDisposition("inline");
+        inlineImage = BodyPartBuilder.create()
+                .setBody(new byte[0], "image/png")
+                .setContentDisposition("inline");
+    }
+
+    @Test
+    public void extractShouldReturnEmptyWhenBinaryContentOnly() throws IOException {
+        Message message = Message.Builder.of()
+                .setBody(BasicBodyFactory.INSTANCE.binaryBody(BINARY_CONTENT, StandardCharsets.UTF_8))
+                .build();
+        MessageContent actual = testee.extract(message);
+        assertThat(actual.getTextBody()).isEmpty();
+        assertThat(actual.getHtmlBody()).isEmpty();
+    }
+
+    @Test
+    public void extractShouldReturnTextOnlyWhenTextOnlyBody() throws IOException {
+        Message message = Message.Builder.of()
+                .setBody(TEXT_CONTENT, StandardCharsets.UTF_8)
+                .build();
+        MessageContent actual = testee.extract(message);
+        assertThat(actual.getTextBody()).contains(TEXT_CONTENT);
+        assertThat(actual.getHtmlBody()).isEmpty();
+    }
+
+    @Test
+    public void extractShouldReturnHtmlOnlyWhenHtmlOnlyBody() throws IOException {
+        Message message = Message.Builder.of()
+                .setBody(HTML_CONTENT, "html", StandardCharsets.UTF_8)
+                .build();
+        MessageContent actual = testee.extract(message);
+        assertThat(actual.getTextBody()).isEmpty();
+        assertThat(actual.getHtmlBody()).contains(HTML_CONTENT);
+    }
+
+    @Test
+    public void extractShouldReturnHtmlAndTextWhenMultipartAlternative() throws IOException {
+        Multipart multipart = MultipartBuilder.create("alternative")
+                .addBodyPart(textPart)
+                .addBodyPart(htmlPart)
+                .build();
+        Message message = Message.Builder.of()
+                .setBody(multipart)
+                .build();
+        MessageContent actual = testee.extract(message);
+        assertThat(actual.getTextBody()).contains(TEXT_CONTENT);
+        assertThat(actual.getHtmlBody()).contains(HTML_CONTENT);
+    }
+
+    @Test
+    public void extractShouldReturnHtmlWhenMultipartAlternativeWithoutPlainPart() throws IOException {
+        Multipart multipart = MultipartBuilder.create("alternative")
+                .addBodyPart(htmlPart)
+                .build();
+        Message message = Message.Builder.of()
+                .setBody(multipart)
+                .build();
+        MessageContent actual = testee.extract(message);
+        assertThat(actual.getTextBody()).isEmpty();
+        assertThat(actual.getHtmlBody()).contains(HTML_CONTENT);
+    }
+
+    @Test
+    public void extractShouldReturnTextWhenMultipartAlternativeWithoutHtmlPart() throws IOException {
+        Multipart multipart = MultipartBuilder.create("alternative")
+                .addBodyPart(textPart)
+                .build();
+        Message message = Message.Builder.of()
+                .setBody(multipart)
+                .build();
+        MessageContent actual = testee.extract(message);
+        assertThat(actual.getTextBody()).contains(TEXT_CONTENT);
+        assertThat(actual.getHtmlBody()).isEmpty();
+    }
+
+    @Test
+    public void extractShouldReturnFirstNonAttachmentPartWhenMultipartMixed() throws IOException {
+        Multipart multipart = MultipartBuilder.create("mixed")
+                .addBodyPart(textAttachment)
+                .addBodyPart(htmlPart)
+                .addBodyPart(textPart)
+                .build();
+        Message message = Message.Builder.of()
+                .setBody(multipart)
+                .build();
+        MessageContent actual = testee.extract(message);
+        assertThat(actual.getHtmlBody()).contains(HTML_CONTENT);
+        assertThat(actual.getTextBody()).isEmpty();
+    }
+
+    @Test
+    public void extractShouldReturnInlinedTextBodyWithoutCIDWhenNoOtherValidParts() throws IOException {
+        String textBody = "body 1";
+        Multipart multipart = MultipartBuilder.create("report")
+            .addBodyPart(BodyPartBuilder.create()
+                .setBody(textBody, "plain", StandardCharsets.UTF_8)
+                .setContentDisposition("inline"))
+            .addBodyPart(BodyPartBuilder.create()
+                .setBody("body 2", "rfc822-headers", StandardCharsets.UTF_8)
+                .setContentDisposition("inline"))
+            .build();
+        Message message = Message.Builder.of()
+            .setBody(multipart)
+            .build();
+
+        MessageContent actual = testee.extract(message);
+
+        assertThat(actual.getTextBody()).contains(textBody);
+    }
+
+    @Test
+    public void extractShouldReturnEmptyWhenMultipartMixedAndFirstPartIsATextAttachment() throws IOException {
+        Multipart multipart = MultipartBuilder.create("mixed")
+                .addBodyPart(textAttachment)
+                .build();
+        Message message = Message.Builder.of()
+                .setBody(multipart)
+                .build();
+        MessageContent actual = testee.extract(message);
+        assertThat(actual.getTextBody()).isEmpty();
+        assertThat(actual.getHtmlBody()).isEmpty();
+    }
+
+    @Test
+    public void extractShouldReturnFirstPartOnlyWhenMultipartMixedAndFirstPartIsHtml() throws IOException {
+        Multipart multipart = MultipartBuilder.create("mixed")
+                .addBodyPart(htmlPart)
+                .addBodyPart(textPart)
+                .build();
+        Message message = Message.Builder.of()
+                .setBody(multipart)
+                .build();
+        MessageContent actual = testee.extract(message);
+        assertThat(actual.getTextBody()).isEmpty();
+        assertThat(actual.getHtmlBody()).contains(HTML_CONTENT);
+    }
+
+    @Test
+    public void extractShouldReturnHtmlAndTextWhenMultipartMixedAndFirstPartIsMultipartAlternative() throws IOException {
+        BodyPart multipartAlternative = BodyPartBuilder.create()
+            .setBody(MultipartBuilder.create("alternative")
+                    .addBodyPart(htmlPart)
+                    .addBodyPart(textPart)
+                    .build())
+            .build();
+        Multipart multipartMixed = MultipartBuilder.create("mixed")
+                .addBodyPart(multipartAlternative)
+                .build();
+        Message message = Message.Builder.of()
+                .setBody(multipartMixed)
+                .build();
+        MessageContent actual = testee.extract(message);
+        assertThat(actual.getTextBody()).contains(TEXT_CONTENT);
+        assertThat(actual.getHtmlBody()).contains(HTML_CONTENT);
+    }
+
+    @Test
+    public void extractShouldReturnHtmlWhenMultipartRelated() throws IOException {
+        Multipart multipart = MultipartBuilder.create("related")
+                .addBodyPart(htmlPart)
+                .build();
+        Message message = Message.Builder.of()
+                .setBody(multipart)
+                .build();
+        MessageContent actual = testee.extract(message);
+        assertThat(actual.getTextBody()).isEmpty();
+        assertThat(actual.getHtmlBody()).contains(HTML_CONTENT);
+    }
+
+    @Test
+    public void extractShouldReturnHtmlAndTextWhenMultipartAlternativeAndFirstPartIsMultipartRelated() throws IOException {
+        BodyPart multipartRelated = BodyPartBuilder.create()
+            .setBody(MultipartBuilder.create("related")
+                    .addBodyPart(htmlPart)
+                    .build())
+            .build();
+        Multipart multipartAlternative = MultipartBuilder.create("alternative")
+                .addBodyPart(multipartRelated)
+                .build();
+        Message message = Message.Builder.of()
+                .setBody(multipartAlternative)
+                .build();
+        MessageContent actual = testee.extract(message);
+        assertThat(actual.getHtmlBody()).contains(HTML_CONTENT);
+    }
+
+    @Test
+    public void extractShouldRetrieveHtmlBodyWithOneInlinedHTMLAttachmentWithoutCid() throws IOException {
+        //Given
+        BodyPart inlinedHTMLPart = BodyPartBuilder.create()
+            .setBody(HTML_CONTENT, "html", StandardCharsets.UTF_8)
+            .build();
+        HeaderImpl inlinedHeader = new HeaderImpl();
+        inlinedHeader.addField(Fields.contentDisposition(MimeMessage.INLINE));
+        inlinedHeader.addField(Fields.contentType("text/html; charset=utf-8"));
+        inlinedHTMLPart.setHeader(inlinedHeader);
+        Multipart multipartAlternative = MultipartBuilder.create("alternative")
+            .addBodyPart(inlinedHTMLPart)
+            .build();
+        Message message = Message.Builder.of()
+            .setBody(multipartAlternative)
+            .build();
+
+        //When
+        MessageContent actual = testee.extract(message);
+
+        //Then
+        assertThat(actual.getHtmlBody()).contains(HTML_CONTENT);
+    }
+
+    @Test
+    public void extractShouldNotRetrieveHtmlBodyWithOneInlinedHTMLAttachmentWithCid() throws IOException {
+        //Given
+        BodyPart inlinedHTMLPart = BodyPartBuilder.create()
+            .setBody(HTML_CONTENT, "html", StandardCharsets.UTF_8)
+            .build();
+        HeaderImpl inlinedHeader = new HeaderImpl();
+        inlinedHeader.addField(Fields.contentDisposition(MimeMessage.INLINE));
+        inlinedHeader.addField(Fields.contentType("text/html; charset=utf-8"));
+        inlinedHeader.addField(CONTENT_ID_FIELD);
+        inlinedHTMLPart.setHeader(inlinedHeader);
+        Multipart multipartAlternative = MultipartBuilder.create("alternative")
+            .addBodyPart(inlinedHTMLPart)
+            .build();
+        Message message = Message.Builder.of()
+            .setBody(multipartAlternative)
+            .build();
+
+        //When
+        MessageContent actual = testee.extract(message);
+
+        //Then
+        assertThat(actual.getHtmlBody()).isEmpty();
+    }
+
+
+    @Test
+    public void extractShouldRetrieveTextBodyWithOneInlinedTextAttachmentWithoutCid() throws IOException {
+        //Given
+        BodyPart inlinedTextPart = BodyPartBuilder.create()
+            .setBody(TEXT_CONTENT, "text", StandardCharsets.UTF_8)
+            .build();
+        HeaderImpl inlinedHeader = new HeaderImpl();
+        inlinedHeader.addField(Fields.contentDisposition(MimeMessage.INLINE));
+        inlinedHeader.addField(Fields.contentType("text/plain; charset=utf-8"));
+        inlinedTextPart.setHeader(inlinedHeader);
+        Multipart multipartAlternative = MultipartBuilder.create("alternative")
+            .addBodyPart(inlinedTextPart)
+            .build();
+        Message message = Message.Builder.of()
+            .setBody(multipartAlternative)
+            .build();
+
+        //When
+        MessageContent actual = testee.extract(message);
+
+        //Then
+        assertThat(actual.getTextBody()).contains(TEXT_CONTENT);
+    }
+
+    @Test
+    public void extractShouldNotRetrieveTextBodyWithOneInlinedTextAttachmentWithCid() throws IOException {
+        //Given
+        BodyPart inlinedTextPart = BodyPartBuilder.create()
+            .setBody(TEXT_CONTENT, "text", StandardCharsets.UTF_8)
+            .build();
+        HeaderImpl inlinedHeader = new HeaderImpl();
+        inlinedHeader.addField(Fields.contentDisposition(MimeMessage.INLINE));
+        inlinedHeader.addField(Fields.contentType("text/plain; charset=utf-8"));
+        inlinedHeader.addField(CONTENT_ID_FIELD);
+        inlinedTextPart.setHeader(inlinedHeader);
+        Multipart multipartAlternative = MultipartBuilder.create("alternative")
+            .addBodyPart(inlinedTextPart)
+            .build();
+        Message message = Message.Builder.of()
+            .setBody(multipartAlternative)
+            .build();
+
+        //When
+        MessageContent actual = testee.extract(message);
+
+        //Then
+        assertThat(actual.getTextBody()).isEmpty();
+    }
+
+    @Test
+    public void extractShouldRetrieveTextAndHtmlBodyWhenOneInlinedTextAttachmentAndMainContentInMultipart() throws IOException {
+        BodyPart multipartAlternative = BodyPartBuilder.create()
+                .setBody(MultipartBuilder.create("alternative")
+                        .addBodyPart(textPart)
+                        .addBodyPart(htmlPart)
+                        .build())
+                .build();
+
+        Multipart multipartMixed = MultipartBuilder.create("mixed")
+                .addBodyPart(multipartAlternative)
+                .addBodyPart(inlineText)
+                .build();
+
+        Message message = Message.Builder.of()
+                .setBody(multipartMixed)
+                .build();
+
+        MessageContent actual = testee.extract(message);
+        assertThat(actual.getTextBody()).contains(TEXT_CONTENT);
+        assertThat(actual.getHtmlBody()).contains(HTML_CONTENT);
+    }
+
+    @Test
+    public void extractShouldRetrieveTextBodyAndHtmlBodyWhenTextBodyInMainMultipartAndHtmlBodyInInnerMultipart() throws IOException {
+        BodyPart multipartRelated = BodyPartBuilder.create()
+                .setBody(MultipartBuilder.create("related")
+                        .addBodyPart(htmlPart)
+                        .addBodyPart(inlineImage)
+                        .build())
+                .build();
+
+        Multipart multipartAlternative = MultipartBuilder.create("alternative")
+                .addBodyPart(textPart)
+                .addBodyPart(multipartRelated)
+                .build();
+
+        Message message = Message.Builder.of()
+                .setBody(multipartAlternative)
+                .build();
+
+        MessageContent actual = testee.extract(message);
+        assertThat(actual.getTextBody()).contains(TEXT_CONTENT);
+        assertThat(actual.getHtmlBody()).contains(HTML_CONTENT);
+    }
+
+    @Test
+    public void mergeMessageContentShouldReturnEmptyWhenAllEmpty() {
+        MessageContent messageContent1 = MessageContent.empty();
+        MessageContent messageContent2 = MessageContent.empty();
+        MessageContent expected = MessageContent.empty();
+
+        MessageContent actual = messageContent1.merge(messageContent2);
+
+        assertThat(actual).isEqualTo(expected);
+    }
+
+    @Test
+    public void mergeMessageContentShouldReturnFirstWhenSecondEmpty() {
+        MessageContent messageContent1 = new MessageContent(Optional.of(TEXT_CONTENT), Optional.of(HTML_CONTENT));
+        MessageContent messageContent2 = MessageContent.empty();
+        MessageContent expected = messageContent1;
+
+        MessageContent actual = messageContent1.merge(messageContent2);
+
+        assertThat(actual).isEqualTo(expected);
+    }
+
+    @Test
+    public void mergeMessageContentShouldReturnSecondWhenFirstEmpty() {
+        MessageContent messageContent1 = MessageContent.empty();
+        MessageContent messageContent2 = new MessageContent(Optional.of(TEXT_CONTENT), Optional.of(HTML_CONTENT));
+        MessageContent expected = messageContent2;
+
+        MessageContent actual = messageContent1.merge(messageContent2);
+
+        assertThat(actual).isEqualTo(expected);
+    }
+
+    @Test
+    public void mergeMessageContentShouldReturnMixWhenFirstTextOnlyAndSecondHtmlOnly() {
+        MessageContent messageContent1 = MessageContent.ofTextOnly(Optional.of(TEXT_CONTENT));
+        MessageContent messageContent2 = MessageContent.ofHtmlOnly(Optional.of(HTML_CONTENT));
+        MessageContent expected = new MessageContent(Optional.of(TEXT_CONTENT), Optional.of(HTML_CONTENT));
+
+        MessageContent actual = messageContent1.merge(messageContent2);
+
+        assertThat(actual).isEqualTo(expected);
+    }
+
+    @Test
+    public void mergeMessageContentShouldReturnMixWhenFirstHtmlOnlyAndSecondTextOnly() {
+        MessageContent messageContent1 = MessageContent.ofHtmlOnly(Optional.of(HTML_CONTENT));
+        MessageContent messageContent2 = MessageContent.ofTextOnly(Optional.of(TEXT_CONTENT));
+        MessageContent expected = new MessageContent(Optional.of(TEXT_CONTENT), Optional.of(HTML_CONTENT));
+
+        MessageContent actual = messageContent1.merge(messageContent2);
+
+        assertThat(actual).isEqualTo(expected);
+    }
+
+    @Test
+    public void mergeMessageContentShouldReturnFirstWhenTwiceAreComplete() {
+        MessageContent messageContent1 = new MessageContent(Optional.of(TEXT_CONTENT), Optional.of(HTML_CONTENT));
+        MessageContent messageContent2 = new MessageContent(Optional.of(TEXT_CONTENT2), Optional.of(HTML_CONTENT2));
+        MessageContent expected = messageContent1;
+
+        MessageContent actual = messageContent1.merge(messageContent2);
+
+        assertThat(actual).isEqualTo(expected);
+    }
+
+    @Test
+    public void extractShouldRespectCharsetWhenOtherThanUTF8() throws IOException {
+        String text = "éééé\r\nèèèè\r\nàààà";
+        Message message = Message.Builder.of()
+                .setBody(text, Charset.forName("windows-1252"))
+                .build();
+        MessageContent actual = testee.extract(message);
+        assertThat(actual.getTextBody()).contains(text);
+    }
+
+    @Test
+    public void extractShouldRespectCharsetWhenUTF8() throws IOException {
+        String text = "éééé\r\nèèèè\r\nàààà";
+        Message message = Message.Builder.of()
+                .setBody(text, StandardCharsets.UTF_8)
+                .build();
+        MessageContent actual = testee.extract(message);
+        assertThat(actual.getTextBody()).contains(text);
+    }
+
+    @Test
+    public void extractShouldUseUSASCIIWhenNoCharset() throws IOException {
+        String text = "éééé\r\nèèèè\r\nàààà";
+        Message message = Message.Builder.of()
+                .setBody(text, null)
+                .build();
+        MessageContent actual = testee.extract(message);
+        assertThat(actual.getTextBody()).contains("????\r\n????\r\n????");
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/630dcab1/server/container/util/src/test/java/org/apache/james/util/streams/ImmutableCollectorsTest.java
----------------------------------------------------------------------
diff --git a/server/container/util/src/test/java/org/apache/james/util/streams/ImmutableCollectorsTest.java b/server/container/util/src/test/java/org/apache/james/util/streams/ImmutableCollectorsTest.java
new file mode 100644
index 0000000..8c9c98b
--- /dev/null
+++ b/server/container/util/src/test/java/org/apache/james/util/streams/ImmutableCollectorsTest.java
@@ -0,0 +1,123 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.util.streams;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.data.MapEntry.entry;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+
+import org.junit.Test;
+
+import com.github.steveash.guavate.Guavate;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
+
+public class ImmutableCollectorsTest {
+
+    @Test
+    public void immutableListCollectorShouldReturnEmptyImmutableListWhenEmptyStream() {
+        String[] data = {};
+        List<String> actual = Arrays.stream(data)
+            .collect(Guavate.toImmutableList());
+        assertThat(actual).isInstanceOf(ImmutableList.class);
+        assertThat(actual).isEmpty();
+    }
+    
+    @Test
+    public void immutableListCollectorShouldReturnImmutableListWhenOneElementStream() {
+        String[] data = {"a"};
+        List<String> actual = Arrays.stream(data)
+            .collect(Guavate.toImmutableList());
+        assertThat(actual).isInstanceOf(ImmutableList.class);
+        assertThat(actual).containsExactly("a");
+    }
+    
+    @Test
+    public void immutableListCollectorShouldReturnImmutableListWhen3ElementsStream() {
+        String[] data = {"a", "b", "c"};
+        List<String> actual = Arrays.stream(data)
+            .collect(Guavate.toImmutableList());
+        assertThat(actual).isInstanceOf(ImmutableList.class);
+        assertThat(actual).containsExactly("a", "b", "c");
+    }
+
+    @Test
+    public void immutableSetCollectorShouldReturnEmptyImmutableSetWhenEmptyStream() {
+        String[] data = {};
+        Set<String> actual = Arrays.stream(data)
+            .collect(Guavate.toImmutableSet());
+        assertThat(actual).isInstanceOf(ImmutableSet.class);
+        assertThat(actual).isEmpty();
+    }
+
+    @Test
+    public void immutableSetCollectorShouldReturnImmutableSetWhenOneElementStream() {
+        String[] data = {"a"};
+        Set<String> actual = Arrays.stream(data)
+            .collect(Guavate.toImmutableSet());
+        assertThat(actual).isInstanceOf(ImmutableSet.class);
+        assertThat(actual).containsExactly("a");
+    }
+
+    @Test
+    public void immutableSetCollectorShouldReturnImmutableSetWhen3ElementsStream() {
+        String[] data = {"a", "b", "c"};
+        Set<String> actual = Arrays.stream(data)
+            .collect(Guavate.toImmutableSet());
+        assertThat(actual).isInstanceOf(ImmutableSet.class);
+        assertThat(actual).containsExactly("a", "b", "c");
+    }
+
+
+    @Test
+    public void immutableMapCollectorShouldReturnEmptyImmutableMapWhenEmptyStream() {
+        String[] data = {};
+        Map<String, Integer> actual = Arrays.stream(data)
+                .collect(Guavate.toImmutableMap(x -> x.toUpperCase(Locale.US), String::length));
+        assertThat(actual).isInstanceOf(ImmutableMap.class);
+        assertThat(actual).isEmpty();
+    }
+    
+    @Test
+    public void immutableMapCollectorShouldReturnAppliedImmutableMapWhenOneElementStream() {
+        String[] data = {"a"};
+        Map<String, Integer> actual = Arrays.stream(data)
+                .collect(Guavate.toImmutableMap(x -> x.toUpperCase(Locale.US), String::length));
+        assertThat(actual).isInstanceOf(ImmutableMap.class);
+        assertThat(actual).containsExactly(entry("A", 1));
+    }
+    
+    @Test
+    public void immutableMapCollectorShouldReturnAppliedImmutableMapWhen3ElementsStream() {
+        String[] data = {"a", "bb", "ccc"};
+        Map<String, Integer> actual = Arrays.stream(data)
+                .collect(Guavate.toImmutableMap(x -> x.toUpperCase(Locale.US), String::length));
+        assertThat(actual).isInstanceOf(ImmutableMap.class);
+        assertThat(actual).containsExactly(entry("A", 1), entry("BB", 2), entry("CCC", 3));
+    }
+    
+}
+

http://git-wip-us.apache.org/repos/asf/james-project/blob/630dcab1/server/container/util/src/test/java/org/apache/james/util/streams/IteratorsTest.java
----------------------------------------------------------------------
diff --git a/server/container/util/src/test/java/org/apache/james/util/streams/IteratorsTest.java b/server/container/util/src/test/java/org/apache/james/util/streams/IteratorsTest.java
new file mode 100644
index 0000000..4c63f1a
--- /dev/null
+++ b/server/container/util/src/test/java/org/apache/james/util/streams/IteratorsTest.java
@@ -0,0 +1,58 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.util.streams;
+
+import static java.util.stream.Collectors.toList;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.stream.Stream;
+
+import org.junit.Test;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.UnmodifiableIterator;
+
+public class IteratorsTest {
+
+    @Test
+    public void toStreamShouldReturnEmptyStreamWhenEmptyIterator() {
+        //Given
+        UnmodifiableIterator<String> emptyIterator = ImmutableList.<String>of().iterator();
+
+        //When
+        Stream<String> actual = Iterators.toStream(emptyIterator);
+
+        //Then
+        assertThat(actual.count()).isEqualTo(0);
+    }
+
+    @Test
+    public void toStreamShouldReturnSameContent() {
+        //Given
+        UnmodifiableIterator<String> iterator = ImmutableList.of("a", "b", "c").iterator();
+
+        //When
+        Stream<String> actual = Iterators.toStream(iterator);
+
+        //Then
+        assertThat(actual.collect(toList())).containsExactly("a", "b", "c");
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/630dcab1/server/container/util/src/test/java/org/apache/james/util/streams/JamesCollectorsTest.java
----------------------------------------------------------------------
diff --git a/server/container/util/src/test/java/org/apache/james/util/streams/JamesCollectorsTest.java b/server/container/util/src/test/java/org/apache/james/util/streams/JamesCollectorsTest.java
new file mode 100644
index 0000000..52f1c3a
--- /dev/null
+++ b/server/container/util/src/test/java/org/apache/james/util/streams/JamesCollectorsTest.java
@@ -0,0 +1,121 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.util.streams;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.List;
+import java.util.stream.Stream;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+
+import com.github.steveash.guavate.Guavate;
+import com.google.common.collect.ImmutableList;
+
+public class JamesCollectorsTest {
+
+    @Rule
+    public ExpectedException expectedException = ExpectedException.none();
+
+    @Test
+    public void chunkerShouldAcceptEmptyStrem() {
+        Stream<Integer> emptyStream = Stream.of();
+
+        assertThat(emptyStream.collect(JamesCollectors.chunker(10))
+            .collect(Guavate.toImmutableList()))
+            .isEmpty();
+    }
+
+    @Test
+    public void chunkerShouldThrowOnZeroChunkSize() {
+        expectedException.expect(IllegalArgumentException.class);
+
+        JamesCollectors.chunker(0);
+    }
+
+    @Test
+    public void chunkerShouldThrowOnNegativeChunkSize() {
+        expectedException.expect(IllegalArgumentException.class);
+
+        JamesCollectors.chunker(-1);
+    }
+
+    @Test
+    public void chunkerShouldChunkMonoValueStreams() {
+        Stream<Integer> monoValueStream = Stream.of(1);
+
+        List<List<Integer>> values = monoValueStream.collect(JamesCollectors.chunker(10))
+            .map(ImmutableList::copyOf)
+            .collect(Guavate.toImmutableList());
+        assertThat(values)
+            .isEqualTo(ImmutableList.of(ImmutableList.of(1)));
+    }
+
+    @Test
+    public void chunkerShouldChunkStreamsSmallerThanChunkSize() {
+        Stream<Integer> stream = Stream.of(1, 2);
+
+        List<List<Integer>> values = stream.collect(JamesCollectors.chunker(3))
+            .map(ImmutableList::copyOf)
+            .collect(Guavate.toImmutableList());
+        assertThat(values)
+            .isEqualTo(ImmutableList.of(ImmutableList.of(1, 2)));
+    }
+
+    @Test
+    public void chunkerShouldChunkStreamsAsBigAsChunkSize() {
+        Stream<Integer> stream = Stream.of(1, 2, 3);
+
+        List<List<Integer>> values = stream.collect(JamesCollectors.chunker(3))
+            .map(ImmutableList::copyOf)
+            .collect(Guavate.toImmutableList());
+        assertThat(values)
+            .isEqualTo(ImmutableList.of(ImmutableList.of(1, 2, 3)));
+    }
+
+    @Test
+    public void chunkerShouldChunkStreamsBiggerThanChunkSize() {
+        Stream<Integer> stream = Stream.of(1, 2, 3, 4);
+
+        List<List<Integer>> values = stream.collect(JamesCollectors.chunker(3))
+            .map(ImmutableList::copyOf)
+            .collect(Guavate.toImmutableList());
+        assertThat(values)
+            .isEqualTo(ImmutableList.of(
+                ImmutableList.of(1, 2, 3),
+                ImmutableList.of(4)));
+    }
+
+    @Test
+    public void chunkerShouldChunkInSeveralBuckets() {
+        Stream<Integer> stream = Stream.of(1, 2, 3, 4, 5, 6, 7);
+
+        List<List<Integer>> values = stream.collect(JamesCollectors.chunker(3))
+            .map(ImmutableList::copyOf)
+            .collect(Guavate.toImmutableList());
+        assertThat(values)
+            .isEqualTo(ImmutableList.of(
+                ImmutableList.of(1, 2, 3),
+                ImmutableList.of(4, 5, 6),
+                ImmutableList.of(7)));
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/630dcab1/server/container/util/src/test/java/org/apache/james/util/streams/LimitTest.java
----------------------------------------------------------------------
diff --git a/server/container/util/src/test/java/org/apache/james/util/streams/LimitTest.java b/server/container/util/src/test/java/org/apache/james/util/streams/LimitTest.java
new file mode 100644
index 0000000..fcd92d8
--- /dev/null
+++ b/server/container/util/src/test/java/org/apache/james/util/streams/LimitTest.java
@@ -0,0 +1,115 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.util.streams;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.List;
+import java.util.Optional;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+
+import com.github.steveash.guavate.Guavate;
+import com.google.common.collect.ImmutableList;
+
+import nl.jqno.equalsverifier.EqualsVerifier;
+
+public class LimitTest {
+
+    private final List<Integer> aList = ImmutableList.of(1, 2, 3, 4, 5, 6);
+
+    @Rule
+    public final ExpectedException expectedException = ExpectedException.none();
+
+    @Test
+    public void unlimitedShouldCreateLimitWithNoLimit() {
+        Limit testee = Limit.unlimited();
+        assertThat(testee.getLimit()).isEqualTo(Optional.empty());
+    }
+
+    @Test
+    public void beanShouldRespectBeanContract() {
+        EqualsVerifier.forClass(Limit.class)
+            .verify();
+    }
+
+    @Test
+    public void unlimitedShouldCreateLimitThatDoesNotAffectStream() {
+
+        Limit testee = Limit.unlimited();
+        assertThat(
+            testee
+                .applyOnStream(aList.stream())
+                .collect(Guavate.toImmutableList())
+        ).isEqualTo(aList);
+    }
+
+    @Test
+    public void limitShouldCreateLimitWithNoLimit() {
+        int expected = 3;
+
+        Limit testee = Limit.limit(expected);
+        assertThat(testee.getLimit())
+            .isEqualTo(Optional.of(expected));
+    }
+
+    @Test
+    public void limitShouldCreateLimitThatCorrectlyTruncateStream() {
+        Limit testee = Limit.limit(3);
+
+        assertThat(testee
+            .applyOnStream(aList.stream())
+            .collect(Guavate.toImmutableList())
+        ).isEqualTo(ImmutableList.of(1, 2, 3));
+    }
+
+    @Test
+    public void limitShouldThrowAnErrorWhenCalledWithZero() {
+        expectedException.expect(IllegalArgumentException.class);
+        Limit.limit(0);
+    }
+
+
+    @Test
+    public void limitShouldThrowAnErrorWhenCalledWithNegativeValue() {
+        expectedException.expect(IllegalArgumentException.class);
+        Limit.limit(-1);
+    }
+
+    @Test
+    public void ofShouldTakePositiveValueAsLimit() {
+        assertThat(Limit.from(3))
+            .isEqualTo(Limit.limit(3));
+    }
+
+    @Test
+    public void ofShouldTakeNegativeValueAsUnlimited() {
+        assertThat(Limit.from(-1))
+            .isEqualTo(Limit.unlimited());
+    }
+
+    @Test
+    public void ofShouldTakeZeroValueAsUnlimited() {
+        assertThat(Limit.from(0))
+            .isEqualTo(Limit.unlimited());
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/james-project/blob/630dcab1/server/container/util/src/test/java/org/apache/james/util/streams/OffsetTest.java
----------------------------------------------------------------------
diff --git a/server/container/util/src/test/java/org/apache/james/util/streams/OffsetTest.java b/server/container/util/src/test/java/org/apache/james/util/streams/OffsetTest.java
new file mode 100644
index 0000000..45d8e6d
--- /dev/null
+++ b/server/container/util/src/test/java/org/apache/james/util/streams/OffsetTest.java
@@ -0,0 +1,58 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.util.streams;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.Optional;
+
+import org.junit.Test;
+
+import nl.jqno.equalsverifier.EqualsVerifier;
+
+public class OffsetTest {
+
+    public static final int VALUE = 18;
+
+    @Test
+    public void shouldMatchBeanContract() {
+        EqualsVerifier.forClass(Offset.class)
+            .verify();
+    }
+
+    @Test
+    public void fromZeroShouldBeEquivalentToNone() {
+        assertThat(Offset.from(0))
+            .isEqualTo(Offset.none());
+    }
+
+    @Test
+    public void getOffsetShouldReturnContainedValue() {
+        assertThat(Offset.from(VALUE).getOffset())
+            .isEqualTo(VALUE);
+    }
+
+    @Test
+    public void fromOptionalShouldBeEquivalentToFromValueWhenPresent() {
+        assertThat(Offset.from(Optional.of(VALUE)))
+            .isEqualTo(Offset.from(VALUE));
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/james-project/blob/630dcab1/server/data/data-jmap/pom.xml
----------------------------------------------------------------------
diff --git a/server/data/data-jmap/pom.xml b/server/data/data-jmap/pom.xml
index a859470..7c7f049 100644
--- a/server/data/data-jmap/pom.xml
+++ b/server/data/data-jmap/pom.xml
@@ -39,7 +39,7 @@
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-util-java8</artifactId>
+            <artifactId>james-server-util</artifactId>
         </dependency>
         <dependency>
             <groupId>ch.qos.logback</groupId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/630dcab1/server/data/data-ldap-integration-testing/pom.xml
----------------------------------------------------------------------
diff --git a/server/data/data-ldap-integration-testing/pom.xml b/server/data/data-ldap-integration-testing/pom.xml
index 4b5919c..1e4ba59 100644
--- a/server/data/data-ldap-integration-testing/pom.xml
+++ b/server/data/data-ldap-integration-testing/pom.xml
@@ -40,7 +40,7 @@
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-util-java8</artifactId>
+            <artifactId>james-server-util</artifactId>
             <scope>test</scope>
         </dependency>
         <dependency>

http://git-wip-us.apache.org/repos/asf/james-project/blob/630dcab1/server/mailet/integration-testing/pom.xml
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/pom.xml b/server/mailet/integration-testing/pom.xml
index 3a53ffc..5ddb093 100644
--- a/server/mailet/integration-testing/pom.xml
+++ b/server/mailet/integration-testing/pom.xml
@@ -94,7 +94,7 @@
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-util-java8</artifactId>
+            <artifactId>james-server-util</artifactId>
             <type>test-jar</type>
             <scope>test</scope>
         </dependency>

http://git-wip-us.apache.org/repos/asf/james-project/blob/630dcab1/server/mailet/mailetcontainer-camel/pom.xml
----------------------------------------------------------------------
diff --git a/server/mailet/mailetcontainer-camel/pom.xml b/server/mailet/mailetcontainer-camel/pom.xml
index cfe4148..044afc2 100644
--- a/server/mailet/mailetcontainer-camel/pom.xml
+++ b/server/mailet/mailetcontainer-camel/pom.xml
@@ -99,7 +99,7 @@
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-util-java8</artifactId>
+            <artifactId>james-server-util</artifactId>
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/630dcab1/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/pom.xml
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/pom.xml b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/pom.xml
index 0380b9c..576c1eb 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/pom.xml
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/pom.xml
@@ -125,12 +125,6 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-util-java8</artifactId>
-            <type>test-jar</type>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
             <!-- Force Memory JMAP integration tests to be played before Cassandra ones -->
             <groupId>${james.groupId}</groupId>
             <artifactId>memory-jmap-integration-testing</artifactId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/630dcab1/server/protocols/jmap-integration-testing/jmap-integration-testing-common/pom.xml
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/pom.xml b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/pom.xml
index b109376..26c1261 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/pom.xml
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/pom.xml
@@ -99,12 +99,6 @@
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-util-java8</artifactId>
-            <type>test-jar</type>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
             <artifactId>james-server-webadmin-core</artifactId>
             <type>test-jar</type>
         </dependency>

http://git-wip-us.apache.org/repos/asf/james-project/blob/630dcab1/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/pom.xml
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/pom.xml b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/pom.xml
index 180cab6..9b7c8ad 100644
--- a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/pom.xml
+++ b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/pom.xml
@@ -96,12 +96,6 @@
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-util-java8</artifactId>
-            <type>test-jar</type>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
             <artifactId>javax-mail-extension</artifactId>
             <type>test-jar</type>
             <scope>test</scope>

http://git-wip-us.apache.org/repos/asf/james-project/blob/630dcab1/server/protocols/jmap/pom.xml
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/pom.xml b/server/protocols/jmap/pom.xml
index f8eebce..83514ff 100644
--- a/server/protocols/jmap/pom.xml
+++ b/server/protocols/jmap/pom.xml
@@ -135,11 +135,7 @@
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-util-java8</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-util-java8</artifactId>
+            <artifactId>james-server-util</artifactId>
             <type>test-jar</type>
             <scope>test</scope>
         </dependency>

http://git-wip-us.apache.org/repos/asf/james-project/blob/630dcab1/server/protocols/protocols-imap4/pom.xml
----------------------------------------------------------------------
diff --git a/server/protocols/protocols-imap4/pom.xml b/server/protocols/protocols-imap4/pom.xml
index ec64dd9..da3d952 100644
--- a/server/protocols/protocols-imap4/pom.xml
+++ b/server/protocols/protocols-imap4/pom.xml
@@ -43,7 +43,7 @@
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-util-java8</artifactId>
+            <artifactId>james-server-util</artifactId>
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/630dcab1/server/protocols/protocols-managesieve/pom.xml
----------------------------------------------------------------------
diff --git a/server/protocols/protocols-managesieve/pom.xml b/server/protocols/protocols-managesieve/pom.xml
index 1b510ed..98e0227 100644
--- a/server/protocols/protocols-managesieve/pom.xml
+++ b/server/protocols/protocols-managesieve/pom.xml
@@ -43,7 +43,7 @@
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-util-java8</artifactId>
+            <artifactId>james-server-util</artifactId>
         </dependency>
         <dependency>
             <groupId>${james.protocols.groupId}</groupId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/630dcab1/server/protocols/webadmin/webadmin-core/pom.xml
----------------------------------------------------------------------
diff --git a/server/protocols/webadmin/webadmin-core/pom.xml b/server/protocols/webadmin/webadmin-core/pom.xml
index 2633e55..8df8461 100644
--- a/server/protocols/webadmin/webadmin-core/pom.xml
+++ b/server/protocols/webadmin/webadmin-core/pom.xml
@@ -43,7 +43,7 @@
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-util-java8</artifactId>
+            <artifactId>james-server-util</artifactId>
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/630dcab1/server/protocols/webadmin/webadmin-data/pom.xml
----------------------------------------------------------------------
diff --git a/server/protocols/webadmin/webadmin-data/pom.xml b/server/protocols/webadmin/webadmin-data/pom.xml
index f767608..7cca591 100644
--- a/server/protocols/webadmin/webadmin-data/pom.xml
+++ b/server/protocols/webadmin/webadmin-data/pom.xml
@@ -56,7 +56,7 @@
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-util-java8</artifactId>
+            <artifactId>james-server-util</artifactId>
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/630dcab1/server/protocols/webadmin/webadmin-mailbox/pom.xml
----------------------------------------------------------------------
diff --git a/server/protocols/webadmin/webadmin-mailbox/pom.xml b/server/protocols/webadmin/webadmin-mailbox/pom.xml
index 5c91f4a..8499f92 100644
--- a/server/protocols/webadmin/webadmin-mailbox/pom.xml
+++ b/server/protocols/webadmin/webadmin-mailbox/pom.xml
@@ -102,7 +102,7 @@
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-util-java8</artifactId>
+            <artifactId>james-server-util</artifactId>
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/630dcab1/server/protocols/webadmin/webadmin-mailrepository/pom.xml
----------------------------------------------------------------------
diff --git a/server/protocols/webadmin/webadmin-mailrepository/pom.xml b/server/protocols/webadmin/webadmin-mailrepository/pom.xml
index abc9d2f..4d120ec 100644
--- a/server/protocols/webadmin/webadmin-mailrepository/pom.xml
+++ b/server/protocols/webadmin/webadmin-mailrepository/pom.xml
@@ -62,7 +62,7 @@
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-util-java8</artifactId>
+            <artifactId>james-server-util</artifactId>
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/630dcab1/server/queue/queue-rabbitmq/pom.xml
----------------------------------------------------------------------
diff --git a/server/queue/queue-rabbitmq/pom.xml b/server/queue/queue-rabbitmq/pom.xml
index 7244a13..8d61023 100644
--- a/server/queue/queue-rabbitmq/pom.xml
+++ b/server/queue/queue-rabbitmq/pom.xml
@@ -35,7 +35,7 @@
     <dependencies>
         <dependency>
             <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-util-java8</artifactId>
+            <artifactId>james-server-util</artifactId>
             <scope>test</scope>
         </dependency>
         <dependency>

http://git-wip-us.apache.org/repos/asf/james-project/blob/630dcab1/server/task/pom.xml
----------------------------------------------------------------------
diff --git a/server/task/pom.xml b/server/task/pom.xml
index 10a0704..80534c6 100644
--- a/server/task/pom.xml
+++ b/server/task/pom.xml
@@ -33,7 +33,7 @@
     <dependencies>
         <dependency>
             <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-util-java8</artifactId>
+            <artifactId>james-server-util</artifactId>
         </dependency>
         <dependency>
             <groupId>junit</groupId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/630dcab1/server/testing/pom.xml
----------------------------------------------------------------------
diff --git a/server/testing/pom.xml b/server/testing/pom.xml
index c689d7b..f50652f 100644
--- a/server/testing/pom.xml
+++ b/server/testing/pom.xml
@@ -41,7 +41,7 @@
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-util-java8</artifactId>
+            <artifactId>james-server-util</artifactId>
             <type>test-jar</type>
         </dependency>
         <dependency>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org