james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adup...@apache.org
Subject [02/13] james-project git commit: JAMES-1733 Remove generics from mailbox API
Date Tue, 17 May 2016 08:14:48 GMT
http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMessagesDestructionProcessor.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMessagesDestructionProcessor.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMessagesDestructionProcessor.java
index 9424fff..eac8707 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMessagesDestructionProcessor.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMessagesDestructionProcessor.java
@@ -36,7 +36,6 @@ import org.apache.james.mailbox.store.MailboxSessionMapperFactory;
 import org.apache.james.mailbox.store.mail.MailboxMapperFactory;
 import org.apache.james.mailbox.store.mail.MessageMapper;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -44,25 +43,25 @@ import org.slf4j.LoggerFactory;
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Throwables;
 
-public class SetMessagesDestructionProcessor<Id extends MailboxId> implements SetMessagesProcessor<Id> {
+public class SetMessagesDestructionProcessor implements SetMessagesProcessor {
 
     private static final Logger LOGGER = LoggerFactory.getLogger(SetMessagesCreationProcessor.class);
     private static final int LIMIT_BY_ONE = 1;
 
-    private final MailboxMapperFactory<Id> mailboxMapperFactory;
-    private final MailboxSessionMapperFactory<Id> mailboxSessionMapperFactory;
+    private final MailboxMapperFactory mailboxMapperFactory;
+    private final MailboxSessionMapperFactory mailboxSessionMapperFactory;
 
     @Inject
     @VisibleForTesting
-    SetMessagesDestructionProcessor(MailboxMapperFactory<Id> mailboxMapperFactory,
-                                           MailboxSessionMapperFactory<Id> mailboxSessionMapperFactory) {
+    SetMessagesDestructionProcessor(MailboxMapperFactory mailboxMapperFactory,
+                                           MailboxSessionMapperFactory mailboxSessionMapperFactory) {
         this.mailboxMapperFactory = mailboxMapperFactory;
         this.mailboxSessionMapperFactory = mailboxSessionMapperFactory;
     }
 
     @Override
     public SetMessagesResponse process(SetMessagesRequest request, MailboxSession mailboxSession) {
-        MessageMapper<Id> messageMapper;
+        MessageMapper messageMapper;
         try {
             messageMapper = mailboxSessionMapperFactory.createMessageMapper(mailboxSession);
         } catch (MailboxException e) {
@@ -74,14 +73,14 @@ public class SetMessagesDestructionProcessor<Id extends MailboxId> implements Se
                 .build();
     }
 
-    private Function<? super MessageId, SetMessagesResponse> delete(MessageMapper<Id> messageMapper, MailboxSession mailboxSession) {
+    private Function<? super MessageId, SetMessagesResponse> delete(MessageMapper messageMapper, MailboxSession mailboxSession) {
         return (messageId) -> {
             try {
-                Mailbox<Id> mailbox = mailboxMapperFactory
+                Mailbox mailbox = mailboxMapperFactory
                         .getMailboxMapper(mailboxSession)
                         .findMailboxByPath(messageId.getMailboxPath());
 
-                MailboxMessage<Id> mailboxMessage = getMailboxMessage(messageMapper, messageId, mailbox);
+                MailboxMessage mailboxMessage = getMailboxMessage(messageMapper, messageId, mailbox);
 
                 messageMapper.delete(mailbox, mailboxMessage);
                 return SetMessagesResponse.builder().destroyed(messageId).build();
@@ -104,10 +103,10 @@ public class SetMessagesDestructionProcessor<Id extends MailboxId> implements Se
         };
     }
 
-    private MailboxMessage<Id> getMailboxMessage(MessageMapper<Id> messageMapper, MessageId messageId, Mailbox<Id> mailbox)
+    private MailboxMessage getMailboxMessage(MessageMapper messageMapper, MessageId messageId, Mailbox mailbox)
             throws MailboxException, MessageNotFoundException {
 
-        Iterator<MailboxMessage<Id>> mailboxMessage = messageMapper.findInMailbox(mailbox, MessageRange.one(messageId.getUid()), MessageMapper.FetchType.Metadata, LIMIT_BY_ONE);
+        Iterator<MailboxMessage> mailboxMessage = messageMapper.findInMailbox(mailbox, MessageRange.one(messageId.getUid()), MessageMapper.FetchType.Metadata, LIMIT_BY_ONE);
         if (!mailboxMessage.hasNext()) {
             throw new MessageNotFoundException();
         }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMessagesMethod.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMessagesMethod.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMessagesMethod.java
index 76c97ee..52cb1a9 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMessagesMethod.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMessagesMethod.java
@@ -29,20 +29,19 @@ import org.apache.james.jmap.model.SetMessagesRequest;
 import org.apache.james.jmap.model.SetMessagesResponse;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Preconditions;
 
-public class SetMessagesMethod<Id extends MailboxId> implements Method {
+public class SetMessagesMethod implements Method {
 
     private static final Method.Request.Name METHOD_NAME = Method.Request.name("setMessages");
     private static final Method.Response.Name RESPONSE_NAME = Method.Response.name("messagesSet");
 
-    private final Set<SetMessagesProcessor<Id>> messagesProcessors;
+    private final Set<SetMessagesProcessor> messagesProcessors;
 
     @Inject
-    @VisibleForTesting SetMessagesMethod(Set<SetMessagesProcessor<Id>> messagesProcessors) {
+    @VisibleForTesting SetMessagesMethod(Set<SetMessagesProcessor> messagesProcessors) {
         this.messagesProcessors = messagesProcessors;
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMessagesProcessor.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMessagesProcessor.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMessagesProcessor.java
index 4c7e00d..7600544 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMessagesProcessor.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMessagesProcessor.java
@@ -22,8 +22,7 @@ package org.apache.james.jmap.methods;
 import org.apache.james.jmap.model.SetMessagesRequest;
 import org.apache.james.jmap.model.SetMessagesResponse;
 import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 
-public interface SetMessagesProcessor<Id extends MailboxId> {
+public interface SetMessagesProcessor {
     SetMessagesResponse process(SetMessagesRequest request, MailboxSession mailboxSession);
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMessagesUpdateProcessor.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMessagesUpdateProcessor.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMessagesUpdateProcessor.java
index ed7e219..11c9c99 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMessagesUpdateProcessor.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMessagesUpdateProcessor.java
@@ -24,6 +24,7 @@ import java.util.List;
 import java.util.NoSuchElementException;
 import java.util.Set;
 import java.util.stream.Collectors;
+
 import javax.inject.Inject;
 import javax.mail.Flags;
 
@@ -42,30 +43,29 @@ import org.apache.james.mailbox.store.MailboxSessionMapperFactory;
 import org.apache.james.mailbox.store.mail.MailboxMapperFactory;
 import org.apache.james.mailbox.store.mail.MessageMapper;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.MailboxMessage;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableSet;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
-public class SetMessagesUpdateProcessor<Id extends MailboxId> implements SetMessagesProcessor<Id> {
+public class SetMessagesUpdateProcessor implements SetMessagesProcessor {
 
     private static final int LIMIT_BY_ONE = 1;
     private static final Logger LOGGER = LoggerFactory.getLogger(SetMessagesUpdateProcessor.class);
 
     private final UpdateMessagePatchConverter updatePatchConverter;
-    private final MailboxMapperFactory<Id> mailboxMapperFactory;
-    private final MailboxSessionMapperFactory<Id> mailboxSessionMapperFactory;
+    private final MailboxMapperFactory mailboxMapperFactory;
+    private final MailboxSessionMapperFactory mailboxSessionMapperFactory;
 
     @Inject
     @VisibleForTesting SetMessagesUpdateProcessor(
             UpdateMessagePatchConverter updatePatchConverter,
-            MailboxMapperFactory<Id> mailboxMapperFactory,
-            MailboxSessionMapperFactory<Id> mailboxSessionMapperFactory) {
+            MailboxMapperFactory mailboxMapperFactory,
+            MailboxSessionMapperFactory mailboxSessionMapperFactory) {
         this.updatePatchConverter = updatePatchConverter;
         this.mailboxMapperFactory = mailboxMapperFactory;
         this.mailboxSessionMapperFactory = mailboxSessionMapperFactory;
@@ -85,12 +85,12 @@ public class SetMessagesUpdateProcessor<Id extends MailboxId> implements SetMess
     private void update(MessageId messageId, UpdateMessagePatch updateMessagePatch, MailboxSession mailboxSession,
                         SetMessagesResponse.Builder builder) {
         try {
-            MessageMapper<Id> messageMapper = mailboxSessionMapperFactory.createMessageMapper(mailboxSession);
-            Mailbox<Id> mailbox = mailboxMapperFactory.getMailboxMapper(mailboxSession)
+            MessageMapper messageMapper = mailboxSessionMapperFactory.createMessageMapper(mailboxSession);
+            Mailbox mailbox = mailboxMapperFactory.getMailboxMapper(mailboxSession)
                     .findMailboxByPath(messageId.getMailboxPath());
-            Iterator<MailboxMessage<Id>> mailboxMessage = messageMapper.findInMailbox(
+            Iterator<MailboxMessage> mailboxMessage = messageMapper.findInMailbox(
                     mailbox, MessageRange.one(messageId.getUid()), MessageMapper.FetchType.Metadata, LIMIT_BY_ONE);
-            MailboxMessage<Id> messageWithUpdatedFlags = applyMessagePatch(messageId, mailboxMessage.next(), updateMessagePatch, builder);
+            MailboxMessage messageWithUpdatedFlags = applyMessagePatch(messageId, mailboxMessage.next(), updateMessagePatch, builder);
             savePatchedMessage(mailbox, messageId, messageWithUpdatedFlags, messageMapper);
         } catch (NoSuchElementException e) {
             addMessageIdNotFoundToResponse(messageId, builder);
@@ -99,9 +99,9 @@ public class SetMessagesUpdateProcessor<Id extends MailboxId> implements SetMess
         }
     }
 
-    private boolean savePatchedMessage(Mailbox<Id> mailbox, MessageId messageId,
-                                       MailboxMessage<Id> message,
-                                       MessageMapper<Id> messageMapper) throws MailboxException {
+    private boolean savePatchedMessage(Mailbox mailbox, MessageId messageId,
+                                       MailboxMessage message,
+                                       MessageMapper messageMapper) throws MailboxException {
         return messageMapper.updateFlags(mailbox, new FlagsUpdateCalculator(message.createFlags(),
                         MessageManager.FlagsUpdateMode.REPLACE),
                 MessageRange.one(messageId.getUid()))
@@ -117,7 +117,7 @@ public class SetMessagesUpdateProcessor<Id extends MailboxId> implements SetMess
                         .build()));
     }
 
-    private MailboxMessage<Id> applyMessagePatch(MessageId messageId, MailboxMessage<Id> message,
+    private MailboxMessage applyMessagePatch(MessageId messageId, MailboxMessage message,
                                                  UpdateMessagePatch updatePatch, SetMessagesResponse.Builder builder) {
         Flags newStateFlags = updatePatch.applyToState(message.isSeen(), message.isAnswered(), message.isFlagged());
         message.setFlags(newStateFlags);

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap/src/main/java/org/apache/james/jmap/model/Message.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/model/Message.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/model/Message.java
index cbe60cb..d299489 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/model/Message.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/model/Message.java
@@ -28,15 +28,15 @@ import java.util.Set;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
-import com.fasterxml.jackson.annotation.JsonFilter;
 import org.apache.commons.lang.NotImplementedException;
 import org.apache.james.jmap.methods.GetMessagesMethod;
 import org.apache.james.jmap.methods.JmapResponseWriterImpl;
 import org.apache.james.jmap.model.message.EMailer;
 import org.apache.james.jmap.model.message.IndexableMessage;
 import org.apache.james.mailbox.store.extractor.DefaultTextExtractor;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
+import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 
+import com.fasterxml.jackson.annotation.JsonFilter;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
 import com.google.common.annotations.VisibleForTesting;
@@ -47,8 +47,6 @@ import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Multimap;
 import com.google.common.net.MediaType;
 
-import org.apache.james.mailbox.store.mail.model.MailboxMessage;
-
 @JsonDeserialize(builder = Message.Builder.class)
 @JsonFilter(JmapResponseWriterImpl.PROPERTIES_FILTER)
 public class Message {
@@ -61,7 +59,7 @@ public class Message {
         return new Builder();
     }
 
-    public static Message fromMailboxMessage(MailboxMessage<? extends MailboxId> mailboxMessage,
+    public static Message fromMailboxMessage(MailboxMessage mailboxMessage,
             Function<Long, MessageId> uidToMessageId) {
         IndexableMessage im = IndexableMessage.from(mailboxMessage, new DefaultTextExtractor(), UTC_ZONE_ID);
         if (im.getHasAttachment()) {
@@ -154,7 +152,7 @@ public class Message {
         return String.join(MULTIVALUED_HEADERS_SEPARATOR, iterable);
     }
     
-    private static ZonedDateTime getInternalDate(MailboxMessage<? extends MailboxId> mailboxMessage, IndexableMessage im) {
+    private static ZonedDateTime getInternalDate(MailboxMessage mailboxMessage, IndexableMessage im) {
         return ZonedDateTime.ofInstant(mailboxMessage.getInternalDate().toInstant(), UTC_ZONE_ID);
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap/src/main/java/org/apache/james/jmap/model/message/IndexableMessage.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/model/message/IndexableMessage.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/model/message/IndexableMessage.java
index da5b41c..055533a 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/model/message/IndexableMessage.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/model/message/IndexableMessage.java
@@ -19,29 +19,28 @@
 
 package org.apache.james.jmap.model.message;
 
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.google.common.base.Preconditions;
-import com.google.common.base.Throwables;
-import com.google.common.collect.Multimap;
-import org.apache.james.mailbox.store.extractor.TextExtractor;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
-import org.apache.james.mailbox.store.mail.model.MailboxMessage;
-import org.apache.james.mailbox.store.mail.model.Property;
-import org.apache.james.mime4j.MimeException;
-
 import java.io.IOException;
 import java.time.Instant;
 import java.time.ZoneId;
 import java.time.ZonedDateTime;
-
 import java.util.List;
 import java.util.Optional;
 import java.util.Set;
 import java.util.stream.Collectors;
 
+import org.apache.james.mailbox.store.extractor.TextExtractor;
+import org.apache.james.mailbox.store.mail.model.MailboxMessage;
+import org.apache.james.mailbox.store.mail.model.Property;
+import org.apache.james.mime4j.MimeException;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.common.base.Preconditions;
+import com.google.common.base.Throwables;
+import com.google.common.collect.Multimap;
+
 public class IndexableMessage {
 
-    public static IndexableMessage from(MailboxMessage<? extends MailboxId> message, TextExtractor textExtractor, ZoneId zoneId) {
+    public static IndexableMessage from(MailboxMessage message, TextExtractor textExtractor, ZoneId zoneId) {
         Preconditions.checkNotNull(message.getMailboxId());
         IndexableMessage indexableMessage = new IndexableMessage();
         try {
@@ -72,7 +71,7 @@ public class IndexableMessage {
         this.sentDate = DateResolutionFormater.DATE_TIME_FOMATTER.format(headerCollection.getSentDate().orElse(internalDate));
     }
 
-    private void copyMessageFields(MailboxMessage<? extends MailboxId> message, ZoneId zoneId) {
+    private void copyMessageFields(MailboxMessage message, ZoneId zoneId) {
         this.id = message.getUid();
         this.mailboxId = message.getMailboxId().serialize();
         this.modSeq = message.getModSeq();
@@ -90,7 +89,7 @@ public class IndexableMessage {
         this.properties = message.getProperties();
     }
 
-    private static ZonedDateTime getSanitizedInternalDate(MailboxMessage<? extends MailboxId> message, ZoneId zoneId) {
+    private static ZonedDateTime getSanitizedInternalDate(MailboxMessage message, ZoneId zoneId) {
         if (message.getInternalDate() == null) {
             return ZonedDateTime.now();
         }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap/src/main/java/org/apache/james/jmap/send/MailFactory.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/send/MailFactory.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/send/MailFactory.java
index 4de9c1c..a128007 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/send/MailFactory.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/send/MailFactory.java
@@ -30,7 +30,6 @@ import javax.mail.internet.AddressException;
 import org.apache.james.core.MailImpl;
 import org.apache.james.jmap.model.Emailer;
 import org.apache.james.jmap.model.Message;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 import org.apache.mailet.Mail;
 import org.apache.mailet.MailAddress;
@@ -42,13 +41,13 @@ import com.google.common.base.Throwables;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Sets;
 
-public class MailFactory<Id extends MailboxId> {
+public class MailFactory {
     private static final Logger LOGGER = LoggerFactory.getLogger(MailFactory.class);
     
     @VisibleForTesting MailFactory() {
     }
 
-    public Mail build(MailboxMessage<Id> mailboxMessage, Message jmapMessage) throws MessagingException, IOException {
+    public Mail build(MailboxMessage mailboxMessage, Message jmapMessage) throws MessagingException, IOException {
         MailAddress sender = jmapMessage.getFrom()
                 .map(this::emailerToMailAddress)
                 .orElseThrow(() -> new RuntimeException("Sender is mandatory"));

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap/src/main/java/org/apache/james/jmap/send/PostDequeueDecorator.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/send/PostDequeueDecorator.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/send/PostDequeueDecorator.java
index 38e49f0..6d7f083 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/send/PostDequeueDecorator.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/send/PostDequeueDecorator.java
@@ -37,7 +37,6 @@ import org.apache.james.mailbox.store.mail.MailboxMapperFactory;
 import org.apache.james.mailbox.store.mail.MessageMapper;
 import org.apache.james.mailbox.store.mail.MessageMapperFactory;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 import org.apache.james.queue.api.MailQueue.MailQueueException;
 import org.apache.james.queue.api.MailQueue.MailQueueItem;
@@ -47,17 +46,17 @@ import org.javatuples.Pair;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class PostDequeueDecorator<Id extends MailboxId> extends MailQueueItemDecorator {
+public class PostDequeueDecorator extends MailQueueItemDecorator {
     private static final Logger LOG = LoggerFactory.getLogger(PostDequeueDecorator.class);
 
     private final MailboxManager mailboxManager;
-    private final MessageMapperFactory<Id> messageMapperFactory;
-    private final MailboxMapperFactory<Id> mailboxMapperFactory;
+    private final MessageMapperFactory messageMapperFactory;
+    private final MailboxMapperFactory mailboxMapperFactory;
 
     public PostDequeueDecorator(MailQueueItem mailQueueItem,
             MailboxManager mailboxManager,
-            MessageMapperFactory<Id> messageMapperFactory,
-            MailboxMapperFactory<Id> mailboxMapperFactory) {
+            MessageMapperFactory messageMapperFactory,
+            MailboxMapperFactory mailboxMapperFactory) {
         super(mailQueueItem);
         this.mailboxManager = mailboxManager;
         this.messageMapperFactory = messageMapperFactory;
@@ -77,7 +76,7 @@ public class PostDequeueDecorator<Id extends MailboxId> extends MailQueueItemDec
             String username = (String) getMail().getAttribute(MailMetadata.MAIL_METADATA_USERNAME_ATTRIBUTE);
             try {
                 MailboxSession mailboxSession = mailboxManager.createSystemSession(username, LOG);
-                Pair<MailboxMessage<Id>, MailboxPath> mailboxMessageAndMailboxPath = getMailboxMessageAndMailboxPath(messageId, mailboxSession);
+                Pair<MailboxMessage, MailboxPath> mailboxMessageAndMailboxPath = getMailboxMessageAndMailboxPath(messageId, mailboxSession);
                 moveFromOutboxToSent(mailboxMessageAndMailboxPath, mailboxSession);
             } catch (MailboxException e) {
                 throw new MailQueueException(e.getMessage(), e);
@@ -109,11 +108,11 @@ public class PostDequeueDecorator<Id extends MailboxId> extends MailQueueItemDec
         return (username != null && username instanceof String);
     }
 
-    public Pair<MailboxMessage<Id>, MailboxPath> getMailboxMessageAndMailboxPath(MessageId messageId, MailboxSession mailboxSession) throws MailQueueException, MailboxException {
+    public Pair<MailboxMessage, MailboxPath> getMailboxMessageAndMailboxPath(MessageId messageId, MailboxSession mailboxSession) throws MailQueueException, MailboxException {
         MailboxPath mailboxPath = messageId.getMailboxPath();
-        MessageMapper<Id> messageMapper = messageMapperFactory.getMessageMapper(mailboxSession);
-        Mailbox<Id> mailbox = mailboxMapperFactory.getMailboxMapper(mailboxSession).findMailboxByPath(mailboxPath);
-        Iterator<MailboxMessage<Id>> resultIterator = messageMapper.findInMailbox(mailbox, MessageRange.one(messageId.getUid()), MessageMapper.FetchType.Full, 1);
+        MessageMapper messageMapper = messageMapperFactory.getMessageMapper(mailboxSession);
+        Mailbox mailbox = mailboxMapperFactory.getMailboxMapper(mailboxSession).findMailboxByPath(mailboxPath);
+        Iterator<MailboxMessage> resultIterator = messageMapper.findInMailbox(mailbox, MessageRange.one(messageId.getUid()), MessageMapper.FetchType.Full, 1);
         if (resultIterator.hasNext()) {
             return Pair.with(resultIterator.next(), mailboxPath);
         } else {
@@ -121,8 +120,8 @@ public class PostDequeueDecorator<Id extends MailboxId> extends MailQueueItemDec
         }
     }
 
-    private void moveFromOutboxToSent(Pair<MailboxMessage<Id>, MailboxPath> mailboxMessageAndMailboxPath, MailboxSession mailboxSession) throws MailQueueException, MailboxException {
-        MailboxMessage<Id> mailboxMessage = mailboxMessageAndMailboxPath.getValue0();
+    private void moveFromOutboxToSent(Pair<MailboxMessage, MailboxPath> mailboxMessageAndMailboxPath, MailboxSession mailboxSession) throws MailQueueException, MailboxException {
+        MailboxMessage mailboxMessage = mailboxMessageAndMailboxPath.getValue0();
         MailboxPath outboxMailboxPath = mailboxMessageAndMailboxPath.getValue1();
         ensureMailboxPathIsOutbox(outboxMailboxPath);
         MailboxPath sentMailboxPath = getSentMailboxPath(mailboxSession);

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap/src/main/java/org/apache/james/jmap/send/PostDequeueDecoratorFactory.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/send/PostDequeueDecoratorFactory.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/send/PostDequeueDecoratorFactory.java
index 24797fc..9d0fdef 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/send/PostDequeueDecoratorFactory.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/send/PostDequeueDecoratorFactory.java
@@ -19,25 +19,23 @@
 
 package org.apache.james.jmap.send;
 
-import org.apache.james.queue.api.MailQueue.MailQueueItem;
-
 import javax.inject.Inject;
 
 import org.apache.james.mailbox.MailboxManager;
 import org.apache.james.mailbox.store.mail.MailboxMapperFactory;
 import org.apache.james.mailbox.store.mail.MessageMapperFactory;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
+import org.apache.james.queue.api.MailQueue.MailQueueItem;
 import org.apache.james.queue.api.MailQueueItemDecoratorFactory;
 
-public class PostDequeueDecoratorFactory<Id extends MailboxId> implements MailQueueItemDecoratorFactory {
+public class PostDequeueDecoratorFactory implements MailQueueItemDecoratorFactory {
     private final MailboxManager mailboxManager;
-    private final MessageMapperFactory<Id> messageMapperFactory;
-    private final MailboxMapperFactory<Id> mailboxMapperFactory;
+    private final MessageMapperFactory messageMapperFactory;
+    private final MailboxMapperFactory mailboxMapperFactory;
 
     @Inject
     public PostDequeueDecoratorFactory(MailboxManager mailboxManager,
-            MessageMapperFactory<Id> messageMapperFactory,
-            MailboxMapperFactory<Id> mailboxMapperFactory) {
+            MessageMapperFactory messageMapperFactory,
+            MailboxMapperFactory mailboxMapperFactory) {
                 this.mailboxManager = mailboxManager;
                 this.messageMapperFactory = messageMapperFactory;
                 this.mailboxMapperFactory = mailboxMapperFactory;
@@ -45,7 +43,7 @@ public class PostDequeueDecoratorFactory<Id extends MailboxId> implements MailQu
 
     @Override
     public MailQueueItemDecorator decorate(MailQueueItem mailQueueItem) {
-        return new PostDequeueDecorator<Id>(mailQueueItem, mailboxManager, messageMapperFactory, mailboxMapperFactory);
+        return new PostDequeueDecorator(mailQueueItem, mailboxManager, messageMapperFactory, mailboxMapperFactory);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap/src/main/java/org/apache/james/jmap/utils/MailboxUtils.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/utils/MailboxUtils.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/utils/MailboxUtils.java
index 0591409..1e38f44 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/utils/MailboxUtils.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/utils/MailboxUtils.java
@@ -33,7 +33,6 @@ import org.apache.james.mailbox.MessageManager;
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.store.mail.MailboxMapperFactory;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -43,17 +42,17 @@ import com.google.common.base.Preconditions;
 import com.google.common.base.Splitter;
 import com.google.common.base.Strings;
 
-public class MailboxUtils<Id extends MailboxId> {
+public class MailboxUtils {
 
     private static final boolean DONT_RESET_RECENT = false;
     private static final Logger LOGGER = LoggerFactory.getLogger(MailboxUtils.class);
 
     private final MailboxManager mailboxManager;
-    private final MailboxMapperFactory<Id> mailboxMapperFactory;
+    private final MailboxMapperFactory mailboxMapperFactory;
 
     @Inject
     @VisibleForTesting
-    public MailboxUtils(MailboxManager mailboxManager, MailboxMapperFactory<Id> mailboxMapperFactory) {
+    public MailboxUtils(MailboxManager mailboxManager, MailboxMapperFactory mailboxMapperFactory) {
         this.mailboxManager = mailboxManager;
         this.mailboxMapperFactory = mailboxMapperFactory;
     }
@@ -104,7 +103,7 @@ public class MailboxUtils<Id extends MailboxId> {
                 .map(org.apache.james.mailbox.store.mail.model.Mailbox::getName);
     }
 
-    private Optional<org.apache.james.mailbox.store.mail.model.Mailbox<Id>> getMailboxFromId(String mailboxId, MailboxSession mailboxSession) throws MailboxException {
+    private Optional<org.apache.james.mailbox.store.mail.model.Mailbox> getMailboxFromId(String mailboxId, MailboxSession mailboxSession) throws MailboxException {
         return mailboxMapperFactory.getMailboxMapper(mailboxSession)
                 .list().stream()
                 .filter(mailbox -> mailbox.getMailboxId().serialize().equals(mailboxId))

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap/src/main/java/org/apache/james/jmap/utils/SortToComparatorConvertor.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/utils/SortToComparatorConvertor.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/utils/SortToComparatorConvertor.java
index d222e8f..9ba867b 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/utils/SortToComparatorConvertor.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/utils/SortToComparatorConvertor.java
@@ -40,18 +40,18 @@ public class SortToComparatorConvertor {
     }
 
     @SuppressWarnings("rawtypes")
-    private static final Map<String, Function<MailboxMessage<?>, Comparable>> fieldsMessageFunctionMap = ImmutableMap.of(
+    private static final Map<String, Function<MailboxMessage, Comparable>> fieldsMessageFunctionMap = ImmutableMap.of(
             "date", MailboxMessage::getInternalDate,
             "id", MailboxMessage::getUid);
 
-    public static <M extends MailboxMessage<Id>, Id extends MailboxId> Comparator<M> comparatorFor(List<String> sort) {
+    public static <M extends MailboxMessage, Id extends MailboxId> Comparator<M> comparatorFor(List<String> sort) {
         return sort.stream()
             .map(SortToComparatorConvertor::<M, Id> comparatorForField)
             .reduce(new EmptyComparator<>(), (x, y) -> x.thenComparing(y));
     }
 
     @SuppressWarnings("unchecked")
-    private static <M extends MailboxMessage<Id>, Id extends MailboxId> Comparator<M> comparatorForField(String field) {
+    private static <M extends MailboxMessage, Id extends MailboxId> Comparator<M> comparatorForField(String field) {
         List<String> splitToList = Splitter.on(SEPARATOR).splitToList(field);
         checkField(splitToList);
         Comparator<M> fieldComparator = Comparator.comparing(functionForField(splitToList.get(0)));
@@ -62,7 +62,7 @@ public class SortToComparatorConvertor {
     }
 
     @SuppressWarnings("rawtypes")
-    private static Function<MailboxMessage<?>, Comparable> functionForField(String field) {
+    private static Function<MailboxMessage, Comparable> functionForField(String field) {
         if (!fieldsMessageFunctionMap.containsKey(field)) {
             throw new IllegalArgumentException("Unknown sorting field");
         }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMailboxesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMailboxesMethodTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMailboxesMethodTest.java
index fbbcaf1..230f7ce 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMailboxesMethodTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMailboxesMethodTest.java
@@ -46,7 +46,6 @@ import org.apache.james.mailbox.acl.MailboxACLResolver;
 import org.apache.james.mailbox.acl.SimpleGroupMembershipResolver;
 import org.apache.james.mailbox.acl.UnionMailboxACLResolver;
 import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.inmemory.InMemoryId;
 import org.apache.james.mailbox.inmemory.InMemoryMailboxSessionMapperFactory;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.store.MockAuthenticator;
@@ -66,11 +65,11 @@ public class GetMailboxesMethodTest {
     private static final String USERNAME = "username@domain.tld";
     private static final String USERNAME2 = "username2@domain.tld";
 
-    private StoreMailboxManager<InMemoryId> mailboxManager;
-    private GetMailboxesMethod<InMemoryId> getMailboxesMethod;
+    private StoreMailboxManager mailboxManager;
+    private GetMailboxesMethod getMailboxesMethod;
     private ClientId clientId;
     private InMemoryMailboxSessionMapperFactory mailboxMapperFactory;
-    private MailboxUtils<InMemoryId> mailboxUtils;
+    private MailboxUtils mailboxUtils;
 
     @Before
     public void setup() throws Exception {
@@ -78,11 +77,11 @@ public class GetMailboxesMethodTest {
         mailboxMapperFactory = new InMemoryMailboxSessionMapperFactory();
         MailboxACLResolver aclResolver = new UnionMailboxACLResolver();
         GroupMembershipResolver groupMembershipResolver = new SimpleGroupMembershipResolver();
-        mailboxManager = new StoreMailboxManager<>(mailboxMapperFactory, new MockAuthenticator(), aclResolver, groupMembershipResolver);
+        mailboxManager = new StoreMailboxManager(mailboxMapperFactory, new MockAuthenticator(), aclResolver, groupMembershipResolver);
         mailboxManager.init();
-        mailboxUtils = new MailboxUtils<>(mailboxManager, mailboxMapperFactory);
+        mailboxUtils = new MailboxUtils(mailboxManager, mailboxMapperFactory);
 
-        getMailboxesMethod = new GetMailboxesMethod<>(mailboxManager, mailboxUtils);
+        getMailboxesMethod = new GetMailboxesMethod(mailboxManager, mailboxUtils);
     }
 
     @Test
@@ -110,7 +109,7 @@ public class GetMailboxesMethodTest {
             .thenReturn(ImmutableList.of(new MailboxPath("namespace", "user", "name")));
         when(mockedMailboxManager.getMailbox(any(), any()))
             .thenThrow(new MailboxException());
-        GetMailboxesMethod<InMemoryId> testee = new GetMailboxesMethod<>(mockedMailboxManager, mailboxUtils);
+        GetMailboxesMethod testee = new GetMailboxesMethod(mockedMailboxManager, mailboxUtils);
         
         GetMailboxesRequest getMailboxesRequest = GetMailboxesRequest.builder()
                 .build();

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMessagesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMessagesMethodTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMessagesMethodTest.java
index adcfb36..506da37 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMessagesMethodTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMessagesMethodTest.java
@@ -44,7 +44,6 @@ import org.apache.james.mailbox.MessageManager;
 import org.apache.james.mailbox.acl.SimpleGroupMembershipResolver;
 import org.apache.james.mailbox.acl.UnionMailboxACLResolver;
 import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.inmemory.InMemoryId;
 import org.apache.james.mailbox.inmemory.InMemoryMailboxSessionMapperFactory;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.store.MockAuthenticator;
@@ -96,7 +95,7 @@ public class GetMessagesMethodTest {
     
     private static final User ROBERT = new User("robert", "secret");
 
-    private StoreMailboxManager<InMemoryId> mailboxManager;
+    private StoreMailboxManager mailboxManager;
     private InMemoryMailboxSessionMapperFactory mailboxSessionMapperFactory;
 
     private MailboxSession session;
@@ -111,7 +110,7 @@ public class GetMessagesMethodTest {
         authenticator.addUser(ROBERT.username, ROBERT.password);
         UnionMailboxACLResolver aclResolver = new UnionMailboxACLResolver();
         SimpleGroupMembershipResolver groupMembershipResolver = new SimpleGroupMembershipResolver();
-        mailboxManager = new StoreMailboxManager<>(mailboxSessionMapperFactory, authenticator, aclResolver, groupMembershipResolver);
+        mailboxManager = new StoreMailboxManager(mailboxSessionMapperFactory, authenticator, aclResolver, groupMembershipResolver);
         mailboxManager.init();
         
 
@@ -122,28 +121,28 @@ public class GetMessagesMethodTest {
     
     @Test
     public void processShouldThrowWhenNullRequest() {
-        GetMessagesMethod<InMemoryId> testee = new GetMessagesMethod<>(mailboxSessionMapperFactory, mailboxSessionMapperFactory);
+        GetMessagesMethod testee = new GetMessagesMethod(mailboxSessionMapperFactory, mailboxSessionMapperFactory);
         GetMessagesRequest request = null;
         assertThatThrownBy(() -> testee.process(request, mock(ClientId.class), mock(MailboxSession.class))).isInstanceOf(NullPointerException.class);
     }
 
     @Test
     public void processShouldThrowWhenNullSession() {
-        GetMessagesMethod<InMemoryId> testee = new GetMessagesMethod<>(mailboxSessionMapperFactory, mailboxSessionMapperFactory);
+        GetMessagesMethod testee = new GetMessagesMethod(mailboxSessionMapperFactory, mailboxSessionMapperFactory);
         MailboxSession mailboxSession = null;
         assertThatThrownBy(() -> testee.process(mock(GetMessagesRequest.class), mock(ClientId.class), mailboxSession)).isInstanceOf(NullPointerException.class);
     }
 
     @Test
     public void processShouldThrowWhenNullClientId() {
-        GetMessagesMethod<InMemoryId> testee = new GetMessagesMethod<>(mailboxSessionMapperFactory, mailboxSessionMapperFactory);
+        GetMessagesMethod testee = new GetMessagesMethod(mailboxSessionMapperFactory, mailboxSessionMapperFactory);
         ClientId clientId = null;
         assertThatThrownBy(() -> testee.process(mock(GetMessagesRequest.class), clientId, mock(MailboxSession.class))).isInstanceOf(NullPointerException.class);
     }
 
     @Test
     public void processShouldThrowWhenRequestHasAccountId() {
-        GetMessagesMethod<InMemoryId> testee = new GetMessagesMethod<>(mailboxSessionMapperFactory, mailboxSessionMapperFactory);
+        GetMessagesMethod testee = new GetMessagesMethod(mailboxSessionMapperFactory, mailboxSessionMapperFactory);
         assertThatThrownBy(() -> testee.process(
                 GetMessagesRequest.builder().accountId("abc").build(), mock(ClientId.class), mock(MailboxSession.class))).isInstanceOf(NotImplementedException.class);
     }
@@ -165,7 +164,7 @@ public class GetMessagesMethodTest {
                           new MessageId(ROBERT, inboxPath, message3Uid)))
                 .build();
 
-        GetMessagesMethod<InMemoryId> testee = new GetMessagesMethod<>(mailboxSessionMapperFactory, mailboxSessionMapperFactory);
+        GetMessagesMethod testee = new GetMessagesMethod(mailboxSessionMapperFactory, mailboxSessionMapperFactory);
         List<JmapResponse> result = testee.process(request, clientId, session).collect(Collectors.toList());
         
         assertThat(result).hasSize(1)
@@ -194,7 +193,7 @@ public class GetMessagesMethodTest {
                 .ids(ImmutableList.of(new MessageId(ROBERT, inboxPath, messageUid)))
                 .build();
 
-        GetMessagesMethod<InMemoryId> testee = new GetMessagesMethod<>(mailboxSessionMapperFactory, mailboxSessionMapperFactory);
+        GetMessagesMethod testee = new GetMessagesMethod(mailboxSessionMapperFactory, mailboxSessionMapperFactory);
         List<JmapResponse> result = testee.process(request, clientId, session).collect(Collectors.toList());
         
         assertThat(result).hasSize(1)
@@ -218,7 +217,7 @@ public class GetMessagesMethodTest {
                 .properties(ImmutableList.of())
                 .build();
 
-        GetMessagesMethod<InMemoryId> testee = new GetMessagesMethod<>(mailboxSessionMapperFactory, mailboxSessionMapperFactory);
+        GetMessagesMethod testee = new GetMessagesMethod(mailboxSessionMapperFactory, mailboxSessionMapperFactory);
         List<JmapResponse> result = testee.process(request, clientId, session).collect(Collectors.toList());
 
         assertThat(result).hasSize(1)
@@ -239,7 +238,7 @@ public class GetMessagesMethodTest {
                 .ids(ImmutableList.of(new MessageId(ROBERT, inboxPath, message1Uid)))
                 .build();
 
-        GetMessagesMethod<InMemoryId> testee = new GetMessagesMethod<>(mailboxSessionMapperFactory, mailboxSessionMapperFactory);
+        GetMessagesMethod testee = new GetMessagesMethod(mailboxSessionMapperFactory, mailboxSessionMapperFactory);
         Stream<JmapResponse> result = testee.process(request, clientId, session);
 
         assertThat(result).hasSize(1)
@@ -263,7 +262,7 @@ public class GetMessagesMethodTest {
 
         Set<MessageProperty> expected = Sets.newHashSet(MessageProperty.id, MessageProperty.subject);
 
-        GetMessagesMethod<InMemoryId> testee = new GetMessagesMethod<>(mailboxSessionMapperFactory, mailboxSessionMapperFactory);
+        GetMessagesMethod testee = new GetMessagesMethod(mailboxSessionMapperFactory, mailboxSessionMapperFactory);
         List<JmapResponse> result = testee.process(request, clientId, session).collect(Collectors.toList());
 
         assertThat(result).hasSize(1)
@@ -287,7 +286,7 @@ public class GetMessagesMethodTest {
 
         Set<MessageProperty> expected = Sets.newHashSet(MessageProperty.id, MessageProperty.textBody);
 
-        GetMessagesMethod<InMemoryId> testee = new GetMessagesMethod<>(mailboxSessionMapperFactory, mailboxSessionMapperFactory);
+        GetMessagesMethod testee = new GetMessagesMethod(mailboxSessionMapperFactory, mailboxSessionMapperFactory);
         List<JmapResponse> result = testee.process(request, clientId, session).collect(Collectors.toList());
 
         assertThat(result).hasSize(1)
@@ -314,7 +313,7 @@ public class GetMessagesMethodTest {
 
         Set<MessageProperty> expected = Sets.newHashSet(MessageProperty.id, MessageProperty.headers);
 
-        GetMessagesMethod<InMemoryId> testee = new GetMessagesMethod<>(mailboxSessionMapperFactory, mailboxSessionMapperFactory);
+        GetMessagesMethod testee = new GetMessagesMethod(mailboxSessionMapperFactory, mailboxSessionMapperFactory);
         List<JmapResponse> result = testee.process(request, clientId, session).collect(Collectors.toList());
 
         assertThat(result)
@@ -340,7 +339,7 @@ public class GetMessagesMethodTest {
                 .properties(ImmutableList.of("headers.from", "headers.heADER2"))
                 .build();
 
-        GetMessagesMethod<InMemoryId> testee = new GetMessagesMethod<>(mailboxSessionMapperFactory, mailboxSessionMapperFactory);
+        GetMessagesMethod testee = new GetMessagesMethod(mailboxSessionMapperFactory, mailboxSessionMapperFactory);
         List<JmapResponse> result = testee.process(request, clientId, session).collect(Collectors.toList());
 
         assertThat(result)

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMailboxesCreationProcessorTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMailboxesCreationProcessorTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMailboxesCreationProcessorTest.java
index acbe5b0..d90bd63 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMailboxesCreationProcessorTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMailboxesCreationProcessorTest.java
@@ -32,20 +32,18 @@ import org.apache.james.jmap.utils.MailboxUtils;
 import org.apache.james.mailbox.MailboxManager;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.store.TestId;
 import org.junit.Before;
 import org.junit.Test;
 
 public class SetMailboxesCreationProcessorTest {
 
-    private MailboxUtils<TestId> mailboxUtils;
-    private SetMailboxesCreationProcessor<TestId> sut;
+    private MailboxUtils mailboxUtils;
+    private SetMailboxesCreationProcessor sut;
 
     @Before
-    @SuppressWarnings("unchecked")
     public void setup() {
         mailboxUtils = mock(MailboxUtils.class);
-        sut = new SetMailboxesCreationProcessor<>(mock(MailboxManager.class), mailboxUtils);
+        sut = new SetMailboxesCreationProcessor(mock(MailboxManager.class), mailboxUtils);
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMailboxesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMailboxesMethodTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMailboxesMethodTest.java
index c2f83b6..831b70c 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMailboxesMethodTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMailboxesMethodTest.java
@@ -34,7 +34,6 @@ import org.apache.james.jmap.model.SetMailboxesResponse;
 import org.apache.james.jmap.model.mailbox.Mailbox;
 import org.apache.james.jmap.model.mailbox.MailboxCreateRequest;
 import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.mailbox.store.TestId;
 import org.junit.Test;
 
 import com.google.common.collect.ImmutableList;
@@ -42,23 +41,23 @@ import com.google.common.collect.ImmutableSet;
 
 public class SetMailboxesMethodTest {
 
-    private static final ImmutableSet<SetMailboxesProcessor<TestId>> NO_PROCESSOR = ImmutableSet.of();
+    private static final ImmutableSet<SetMailboxesProcessor> NO_PROCESSOR = ImmutableSet.of();
 
     @Test
     public void requestHandledShouldBeSetMailboxes() {
-        assertThat(new SetMailboxesMethod<>(NO_PROCESSOR).requestHandled().getName()).isEqualTo("setMailboxes");
+        assertThat(new SetMailboxesMethod(NO_PROCESSOR).requestHandled().getName()).isEqualTo("setMailboxes");
     }
 
     @Test
     public void requestTypeShouldBeSetMailboxes() {
-        assertThat(new SetMailboxesMethod<>(NO_PROCESSOR).requestType()).isEqualTo(SetMailboxesRequest.class);
+        assertThat(new SetMailboxesMethod(NO_PROCESSOR).requestType()).isEqualTo(SetMailboxesRequest.class);
     }
 
     @Test
     public void processShouldThrowWhenNullJmapRequest() {
         MailboxSession session = mock(MailboxSession.class);
         JmapRequest nullJmapRequest = null;
-        assertThatThrownBy(() -> new SetMailboxesMethod<>(NO_PROCESSOR).process(nullJmapRequest, ClientId.of("clientId"), session))
+        assertThatThrownBy(() -> new SetMailboxesMethod(NO_PROCESSOR).process(nullJmapRequest, ClientId.of("clientId"), session))
             .isInstanceOf(NullPointerException.class);
     }
 
@@ -67,7 +66,7 @@ public class SetMailboxesMethodTest {
         MailboxSession session = mock(MailboxSession.class);
         JmapRequest jmapRequest = mock(JmapRequest.class);
         ClientId nullClientId = null;
-        assertThatThrownBy(() -> new SetMailboxesMethod<>(NO_PROCESSOR).process(jmapRequest, nullClientId, session))
+        assertThatThrownBy(() -> new SetMailboxesMethod(NO_PROCESSOR).process(jmapRequest, nullClientId, session))
             .isInstanceOf(NullPointerException.class);
     }
 
@@ -75,7 +74,7 @@ public class SetMailboxesMethodTest {
     public void processShouldThrowWhenNullMailboxSession() {
         MailboxSession nullMailboxSession = null;
         JmapRequest jmapRequest = mock(JmapRequest.class);
-        assertThatThrownBy(() -> new SetMailboxesMethod<>(NO_PROCESSOR).process(jmapRequest, ClientId.of("clientId"), nullMailboxSession))
+        assertThatThrownBy(() -> new SetMailboxesMethod(NO_PROCESSOR).process(jmapRequest, ClientId.of("clientId"), nullMailboxSession))
             .isInstanceOf(NullPointerException.class);
     }
 
@@ -83,7 +82,7 @@ public class SetMailboxesMethodTest {
     public void processShouldThrowWhenJmapRequestTypeMismatch() {
         MailboxSession session = mock(MailboxSession.class);
         JmapRequest getMailboxesRequest = GetMailboxesRequest.builder().build();
-        assertThatThrownBy(() -> new SetMailboxesMethod<>(NO_PROCESSOR).process(getMailboxesRequest, ClientId.of("clientId"), session))
+        assertThatThrownBy(() -> new SetMailboxesMethod(NO_PROCESSOR).process(getMailboxesRequest, ClientId.of("clientId"), session))
             .isInstanceOf(IllegalArgumentException.class);
     }
 
@@ -102,12 +101,11 @@ public class SetMailboxesMethodTest {
             .build();
 
         MailboxSession session = mock(MailboxSession.class);
-        @SuppressWarnings("unchecked")
-        SetMailboxesProcessor<TestId> creatorProcessor = mock(SetMailboxesProcessor.class);
+        SetMailboxesProcessor creatorProcessor = mock(SetMailboxesProcessor.class);
         when(creatorProcessor.process(creationRequest, session)).thenReturn(creationResponse);
 
         Stream<JmapResponse> actual =
-            new SetMailboxesMethod<>(ImmutableSet.of(creatorProcessor))
+            new SetMailboxesMethod(ImmutableSet.of(creatorProcessor))
                     .process(creationRequest, ClientId.of("clientId"), session);
 
         assertThat(actual).contains(jmapResponse);
@@ -126,12 +124,11 @@ public class SetMailboxesMethodTest {
             .build();
 
         MailboxSession session = mock(MailboxSession.class);
-        @SuppressWarnings("unchecked")
-        SetMailboxesProcessor<TestId> destructorProcessor = mock(SetMailboxesProcessor.class);
+        SetMailboxesProcessor destructorProcessor = mock(SetMailboxesProcessor.class);
         when(destructorProcessor.process(destructionRequest, session)).thenReturn(destructionResponse);
 
         Stream<JmapResponse> actual =
-            new SetMailboxesMethod<>(ImmutableSet.of(destructorProcessor))
+            new SetMailboxesMethod(ImmutableSet.of(destructorProcessor))
                     .process(destructionRequest, ClientId.of("clientId"), session);
 
         assertThat(actual).contains(jmapResponse);

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMailboxesUpdateProcessorTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMailboxesUpdateProcessorTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMailboxesUpdateProcessorTest.java
index 6fc0f9e..204365f 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMailboxesUpdateProcessorTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMailboxesUpdateProcessorTest.java
@@ -35,24 +35,22 @@ import org.apache.james.mailbox.MailboxManager;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.model.MailboxPath;
-import org.apache.james.mailbox.store.TestId;
 import org.junit.Before;
 import org.junit.Test;
 
 public class SetMailboxesUpdateProcessorTest {
 
     private MailboxManager mockedMailboxManager;
-    private MailboxUtils<TestId> mockedMailboxUtils;
+    private MailboxUtils mockedMailboxUtils;
     private MailboxSession mockedMailboxSession;
-    private SetMailboxesUpdateProcessor<TestId> sut;
+    private SetMailboxesUpdateProcessor sut;
 
     @Before
-    @SuppressWarnings("unchecked")
     public void setup() {
         mockedMailboxManager = mock(MailboxManager.class);
         mockedMailboxUtils = mock(MailboxUtils.class);
         mockedMailboxSession = mock(MailboxSession.class);
-        sut = new SetMailboxesUpdateProcessor<>(mockedMailboxUtils, mockedMailboxManager);
+        sut = new SetMailboxesUpdateProcessor(mockedMailboxUtils, mockedMailboxManager);
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMessagesCreationProcessorTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMessagesCreationProcessorTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMessagesCreationProcessorTest.java
index 4c73ca8..db7b0ec 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMessagesCreationProcessorTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMessagesCreationProcessorTest.java
@@ -70,11 +70,10 @@ public class SetMessagesCreationProcessorTest {
 
     @Test
     public void processShouldReturnEmptyCreatedWhenRequestHasEmptyCreate() {
-        SetMessagesCreationProcessor<TestId> sut = new SetMessagesCreationProcessor<TestId>(null, null, null, null, null, null) {
+        SetMessagesCreationProcessor sut = new SetMessagesCreationProcessor(null, null, null, null, null, null) {
             @Override
-            protected Optional<Mailbox<TestId>> getOutbox(MailboxSession session) throws MailboxException {
-                @SuppressWarnings("unchecked")
-				Mailbox<TestId> fakeOutbox = (Mailbox<TestId>) mock(Mailbox.class);
+            protected Optional<Mailbox> getOutbox(MailboxSession session) throws MailboxException {
+				Mailbox fakeOutbox = (Mailbox) mock(Mailbox.class);
                 when(fakeOutbox.getName()).thenReturn("outbox");
                 return Optional.of(fakeOutbox);
             }
@@ -98,22 +97,21 @@ public class SetMessagesCreationProcessorTest {
     }
 
     @Test
-    @SuppressWarnings("unchecked")
     public void processShouldReturnNonEmptyCreatedWhenRequestHasNonEmptyCreate() throws MailboxException {
         // Given
-        MessageMapper<TestId> stubMapper = mock(MessageMapper.class);
-        MailboxSessionMapperFactory<TestId> mockSessionMapperFactory = mock(MailboxSessionMapperFactory.class);
+        MessageMapper stubMapper = mock(MessageMapper.class);
+        MailboxSessionMapperFactory mockSessionMapperFactory = mock(MailboxSessionMapperFactory.class);
         when(mockSessionMapperFactory.createMessageMapper(any(MailboxSession.class)))
                 .thenReturn(stubMapper);
 
-        SetMessagesCreationProcessor<TestId> sut = new SetMessagesCreationProcessor<TestId>(null, null, mockSessionMapperFactory, null, null, null) {
+        SetMessagesCreationProcessor sut = new SetMessagesCreationProcessor(null, null, mockSessionMapperFactory, null, null, null) {
             @Override
-            protected MessageWithId<Message> createMessageInOutboxAndSend(MessageWithId.CreationMessageEntry createdEntry, MailboxSession session, Mailbox<TestId> outbox, Function<Long, MessageId> buildMessageIdFromUid) {
+            protected MessageWithId<Message> createMessageInOutboxAndSend(MessageWithId.CreationMessageEntry createdEntry, MailboxSession session, Mailbox outbox, Function<Long, MessageId> buildMessageIdFromUid) {
                 return new MessageWithId<>(createdEntry.getCreationId(), FAKE_MESSAGE);
             }
             @Override
-            protected Optional<Mailbox<TestId>> getOutbox(MailboxSession session) throws MailboxException {
-                Mailbox<TestId> fakeOutbox = mock(Mailbox.class);
+            protected Optional<Mailbox> getOutbox(MailboxSession session) throws MailboxException {
+                Mailbox fakeOutbox = mock(Mailbox.class);
                 when(fakeOutbox.getName()).thenReturn("outbox");
                 return Optional.of(fakeOutbox);
             }
@@ -129,9 +127,9 @@ public class SetMessagesCreationProcessorTest {
     @Test(expected = MailboxRoleNotFoundException.class)
     public void processShouldThrowWhenOutboxNotFound() {
         // Given
-        SetMessagesCreationProcessor<TestId> sut = new SetMessagesCreationProcessor<TestId>(null, null, null, null, null, null) {
+        SetMessagesCreationProcessor sut = new SetMessagesCreationProcessor(null, null, null, null, null, null) {
             @Override
-            protected Optional<Mailbox<TestId>> getOutbox(MailboxSession session) throws MailboxException {
+            protected Optional<Mailbox> getOutbox(MailboxSession session) throws MailboxException {
                 return Optional.empty();
             }
         };
@@ -140,21 +138,20 @@ public class SetMessagesCreationProcessorTest {
     }
 
     @Test
-    @SuppressWarnings("unchecked")
     public void processShouldCallMessageMapperWhenRequestHasNonEmptyCreate() throws MailboxException {
         // Given
-        Mailbox<TestId> fakeOutbox = mock(Mailbox.class);
-        MessageMapper<TestId> mockMapper = mock(MessageMapper.class);
-        MailboxSessionMapperFactory<TestId> stubSessionMapperFactory = mock(MailboxSessionMapperFactory.class);
+        Mailbox fakeOutbox = mock(Mailbox.class);
+        MessageMapper mockMapper = mock(MessageMapper.class);
+        MailboxSessionMapperFactory stubSessionMapperFactory = mock(MailboxSessionMapperFactory.class);
         when(stubSessionMapperFactory.createMessageMapper(any(MailboxSession.class)))
                 .thenReturn(mockMapper);
         MailSpool mockedMailSpool = mock(MailSpool.class);
-        MailFactory<TestId> mockedMailFactory = mock(MailFactory.class);
+        MailFactory mockedMailFactory = mock(MailFactory.class);
 
-        SetMessagesCreationProcessor<TestId> sut = new SetMessagesCreationProcessor<TestId>(null, null,
+        SetMessagesCreationProcessor sut = new SetMessagesCreationProcessor(null, null,
                 stubSessionMapperFactory, new MIMEMessageConverter(), mockedMailSpool, mockedMailFactory) {
             @Override
-            protected Optional<Mailbox<TestId>> getOutbox(MailboxSession session) throws MailboxException {
+            protected Optional<Mailbox> getOutbox(MailboxSession session) throws MailboxException {
                 TestId stubMailboxId = mock(TestId.class);
                 when(stubMailboxId.serialize()).thenReturn("user|outbox|12345");
                 when(fakeOutbox.getMailboxId()).thenReturn(stubMailboxId);
@@ -170,21 +167,20 @@ public class SetMessagesCreationProcessorTest {
     }
 
     @Test
-    @SuppressWarnings("unchecked")
     public void processShouldSendMailWhenRequestHasNonEmptyCreate() throws Exception {
         // Given
-        Mailbox<TestId> fakeOutbox = mock(Mailbox.class);
-        MessageMapper<TestId> mockMapper = mock(MessageMapper.class);
-        MailboxSessionMapperFactory<TestId> stubSessionMapperFactory = mock(MailboxSessionMapperFactory.class);
+        Mailbox fakeOutbox = mock(Mailbox.class);
+        MessageMapper mockMapper = mock(MessageMapper.class);
+        MailboxSessionMapperFactory stubSessionMapperFactory = mock(MailboxSessionMapperFactory.class);
         when(stubSessionMapperFactory.createMessageMapper(any(MailboxSession.class)))
                 .thenReturn(mockMapper);
         MailSpool mockedMailSpool = mock(MailSpool.class);
-        MailFactory<TestId> mockedMailFactory = mock(MailFactory.class);
+        MailFactory mockedMailFactory = mock(MailFactory.class);
 
-        SetMessagesCreationProcessor<TestId> sut = new SetMessagesCreationProcessor<TestId>(null, null,
+        SetMessagesCreationProcessor sut = new SetMessagesCreationProcessor(null, null,
                 stubSessionMapperFactory, new MIMEMessageConverter(), mockedMailSpool, mockedMailFactory) {
             @Override
-            protected Optional<Mailbox<TestId>> getOutbox(MailboxSession session) throws MailboxException {
+            protected Optional<Mailbox> getOutbox(MailboxSession session) throws MailboxException {
                 TestId stubMailboxId = mock(TestId.class);
                 when(stubMailboxId.serialize()).thenReturn("user|outbox|12345");
                 when(fakeOutbox.getMailboxId()).thenReturn(stubMailboxId);

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMessagesUpdateProcessorTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMessagesUpdateProcessorTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMessagesUpdateProcessorTest.java
index 9a625c3..43a610a 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMessagesUpdateProcessorTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMessagesUpdateProcessorTest.java
@@ -29,7 +29,6 @@ import org.apache.james.jmap.model.MessageProperties;
 import org.apache.james.jmap.model.SetMessagesRequest;
 import org.apache.james.jmap.model.SetMessagesResponse;
 import org.apache.james.jmap.model.UpdateMessagePatch;
-import org.apache.james.mailbox.store.TestId;
 import org.junit.Test;
 
 import com.fasterxml.jackson.databind.node.JsonNodeFactory;
@@ -41,7 +40,7 @@ public class SetMessagesUpdateProcessorTest {
 
     @Test
     public void processShouldReturnEmptyUpdatedWhenRequestHasEmptyUpdate() {
-        SetMessagesUpdateProcessor<TestId> sut = new SetMessagesUpdateProcessor<>(null, null, null);
+        SetMessagesUpdateProcessor sut = new SetMessagesUpdateProcessor(null, null, null);
         SetMessagesRequest requestWithEmptyUpdate = SetMessagesRequest.builder().build();
 
         SetMessagesResponse result = sut.process(requestWithEmptyUpdate, null);
@@ -65,7 +64,7 @@ public class SetMessagesUpdateProcessorTest {
         when(mockConverter.fromJsonNode(any(ObjectNode.class)))
                 .thenReturn(mockInvalidPatch);
 
-        SetMessagesUpdateProcessor<TestId> sut = new SetMessagesUpdateProcessor<>(mockConverter, null, null);
+        SetMessagesUpdateProcessor sut = new SetMessagesUpdateProcessor(mockConverter, null, null);
         MessageId requestMessageId = MessageId.of("user|inbox|1");
         SetMessagesRequest requestWithInvalidUpdate = SetMessagesRequest.builder()
                 .update(ImmutableMap.of(requestMessageId, JsonNodeFactory.instance.objectNode()))

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap/src/test/java/org/apache/james/jmap/model/MailboxMessageTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/model/MailboxMessageTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/model/MailboxMessageTest.java
index bb68450..5bad5c5 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/model/MailboxMessageTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/model/MailboxMessageTest.java
@@ -233,7 +233,7 @@ public class MailboxMessageTest {
 
     @Test
     public void emptyMailShouldBeLoadedIntoMessage() throws Exception {
-        MailboxMessage<TestId> testMail = new SimpleMailboxMessage<>(
+        MailboxMessage testMail = new SimpleMailboxMessage(
                 INTERNAL_DATE,
                 0,
                 0,
@@ -255,7 +255,7 @@ public class MailboxMessageTest {
         flags.add(Flag.ANSWERED);
         flags.add(Flag.FLAGGED);
         flags.add(Flag.DRAFT);
-        MailboxMessage<TestId> testMail = new SimpleMailboxMessage<>(
+        MailboxMessage testMail = new SimpleMailboxMessage(
                 INTERNAL_DATE,
                 0,
                 0,
@@ -281,7 +281,7 @@ public class MailboxMessageTest {
                 + "Reply-To: \"user to reply to\" <user.reply.to@domain>\n"
                 + "In-Reply-To: <SNT124-W2664003139C1E520CF4F6787D30@phx.gbl>\n"
                 + "Other-header: other header value";
-        MailboxMessage<TestId> testMail = new SimpleMailboxMessage<>(
+        MailboxMessage testMail = new SimpleMailboxMessage(
                 INTERNAL_DATE,
                 headers.length(),
                 headers.length(),
@@ -333,7 +333,7 @@ public class MailboxMessageTest {
         String headers = "Subject: test subject\n";
         String body = "Mail body";
         String mail = headers + "\n" + body;
-        MailboxMessage<TestId> testMail = new SimpleMailboxMessage<>(
+        MailboxMessage testMail = new SimpleMailboxMessage(
                 INTERNAL_DATE,
                 mail.length(),
                 headers.length(),
@@ -381,7 +381,7 @@ public class MailboxMessageTest {
         assertThat(body300.length()).isEqualTo(300);
         assertThat(expectedPreview.length()).isEqualTo(256);
         String mail = headers + "\n" + body300;
-        MailboxMessage<TestId> testMail = new SimpleMailboxMessage<>(
+        MailboxMessage testMail = new SimpleMailboxMessage(
                 INTERNAL_DATE,
                 mail.length(),
                 headers.length(),
@@ -397,7 +397,7 @@ public class MailboxMessageTest {
     
     @Test(expected=NotImplementedException.class)
     public void attachmentsShouldNotBeHandledForNow() throws Exception {
-        MailboxMessage<TestId> testMail = new SimpleMailboxMessage<>(
+        MailboxMessage testMail = new SimpleMailboxMessage(
                 INTERNAL_DATE,
                 0,
                 0,

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap/src/test/java/org/apache/james/jmap/send/MailFactoryTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/send/MailFactoryTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/send/MailFactoryTest.java
index 59f09e2..84d00a6 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/send/MailFactoryTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/send/MailFactoryTest.java
@@ -42,13 +42,13 @@ import com.google.common.collect.ImmutableSet;
 
 public class MailFactoryTest {
 
-    private MailFactory<TestId> testee;
-    private MailboxMessage<TestId> mailboxMessage;
+    private MailFactory testee;
+    private MailboxMessage mailboxMessage;
     private Message jmapMessage;
 
     @Before
     public void init() {
-        testee = new MailFactory<TestId>();
+        testee = new MailFactory();
         String headers = "From: me@example.com\n"
                 + "To: 1@example.com\n"
                 + "Cc: 2@example.com, 3@example.com\n"
@@ -60,7 +60,7 @@ public class MailFactoryTest {
         propertyBuilder.setMediaType("plain");
         propertyBuilder.setSubType("text");
         propertyBuilder.setTextualLineCount(18L);
-        mailboxMessage = new SimpleMailboxMessage<>(
+        mailboxMessage = new SimpleMailboxMessage(
                 new Date(),
                 content.length(),
                 headers.length(),

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap/src/test/java/org/apache/james/jmap/send/PostDequeueDecoratorTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/send/PostDequeueDecoratorTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/send/PostDequeueDecoratorTest.java
index fff82f1..2aa47fb 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/send/PostDequeueDecoratorTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/send/PostDequeueDecoratorTest.java
@@ -39,7 +39,6 @@ import org.apache.james.mailbox.acl.GroupMembershipResolver;
 import org.apache.james.mailbox.acl.MailboxACLResolver;
 import org.apache.james.mailbox.acl.SimpleGroupMembershipResolver;
 import org.apache.james.mailbox.acl.UnionMailboxACLResolver;
-import org.apache.james.mailbox.inmemory.InMemoryId;
 import org.apache.james.mailbox.inmemory.InMemoryMailboxSessionMapperFactory;
 import org.apache.james.mailbox.model.MailboxConstants;
 import org.apache.james.mailbox.model.MailboxPath;
@@ -68,23 +67,23 @@ public class PostDequeueDecoratorTest {
     private static final String MESSAGE_ID = USERNAME + "|" + OUTBOX_MAILBOX_PATH.getName() + "|" + UID;
     
     private InMemoryMailboxSessionMapperFactory mailboxSessionMapperFactory;
-    private StoreMailboxManager<InMemoryId> mailboxManager;
+    private StoreMailboxManager mailboxManager;
     private MailQueueItem mockedMailQueueItem;
     private Mail mail;
-    private PostDequeueDecorator<InMemoryId> testee;
+    private PostDequeueDecorator testee;
 
     @Before
     public void init() throws Exception {
         mailboxSessionMapperFactory = new InMemoryMailboxSessionMapperFactory();
         MailboxACLResolver aclResolver = new UnionMailboxACLResolver();
         GroupMembershipResolver groupMembershipResolver = new SimpleGroupMembershipResolver();
-        mailboxManager = new StoreMailboxManager<>(mailboxSessionMapperFactory, new MockAuthenticator(), aclResolver, groupMembershipResolver);
+        mailboxManager = new StoreMailboxManager(mailboxSessionMapperFactory, new MockAuthenticator(), aclResolver, groupMembershipResolver);
         mailboxManager.init();
 
         mockedMailQueueItem = mock(MailQueueItem.class);
         mail = new FakeMail();
         when(mockedMailQueueItem.getMail()).thenReturn(mail);
-        testee = new PostDequeueDecorator<InMemoryId>(mockedMailQueueItem, mailboxManager, mailboxSessionMapperFactory, mailboxSessionMapperFactory);
+        testee = new PostDequeueDecorator(mockedMailQueueItem, mailboxManager, mailboxSessionMapperFactory, mailboxSessionMapperFactory);
     }
     
     @Test
@@ -145,9 +144,9 @@ public class PostDequeueDecoratorTest {
         
         testee.done(true);
         
-        Mailbox<InMemoryId> sentMailbox = mailboxSessionMapperFactory.getMailboxMapper(mailboxSession).findMailboxByPath(SENT_MAILBOX_PATH);
-        MessageMapper<InMemoryId> messageMapper = mailboxSessionMapperFactory.getMessageMapper(mailboxSession);
-        Iterator<MailboxMessage<InMemoryId>> resultIterator = messageMapper.findInMailbox(sentMailbox, MessageRange.one(UID), MessageMapper.FetchType.Full, 1);
+        Mailbox sentMailbox = mailboxSessionMapperFactory.getMailboxMapper(mailboxSession).findMailboxByPath(SENT_MAILBOX_PATH);
+        MessageMapper messageMapper = mailboxSessionMapperFactory.getMessageMapper(mailboxSession);
+        Iterator<MailboxMessage> resultIterator = messageMapper.findInMailbox(sentMailbox, MessageRange.one(UID), MessageMapper.FetchType.Full, 1);
         assertThat(resultIterator).hasSize(1);
     }
     
@@ -163,9 +162,9 @@ public class PostDequeueDecoratorTest {
         
         testee.done(true);
         
-        Mailbox<InMemoryId> mailbox = mailboxSessionMapperFactory.getMailboxMapper(mailboxSession).findMailboxByPath(OUTBOX_MAILBOX_PATH);
-        MessageMapper<InMemoryId> messageMapper = mailboxSessionMapperFactory.getMessageMapper(mailboxSession);
-        Iterator<MailboxMessage<InMemoryId>> resultIterator = messageMapper.findInMailbox(mailbox, MessageRange.one(UID), MessageMapper.FetchType.Full, 1);
+        Mailbox mailbox = mailboxSessionMapperFactory.getMailboxMapper(mailboxSession).findMailboxByPath(OUTBOX_MAILBOX_PATH);
+        MessageMapper messageMapper = mailboxSessionMapperFactory.getMessageMapper(mailboxSession);
+        Iterator<MailboxMessage> resultIterator = messageMapper.findInMailbox(mailbox, MessageRange.one(UID), MessageMapper.FetchType.Full, 1);
         assertThat(resultIterator).hasSize(0);
     }
     
@@ -181,9 +180,9 @@ public class PostDequeueDecoratorTest {
         
         testee.done(false);
         
-        Mailbox<InMemoryId> mailbox = mailboxSessionMapperFactory.getMailboxMapper(mailboxSession).findMailboxByPath(OUTBOX_MAILBOX_PATH);
-        MessageMapper<InMemoryId> messageMapper = mailboxSessionMapperFactory.getMessageMapper(mailboxSession);
-        Iterator<MailboxMessage<InMemoryId>> resultIterator = messageMapper.findInMailbox(mailbox, MessageRange.one(UID), MessageMapper.FetchType.Full, 1);
+        Mailbox mailbox = mailboxSessionMapperFactory.getMailboxMapper(mailboxSession).findMailboxByPath(OUTBOX_MAILBOX_PATH);
+        MessageMapper messageMapper = mailboxSessionMapperFactory.getMessageMapper(mailboxSession);
+        Iterator<MailboxMessage> resultIterator = messageMapper.findInMailbox(mailbox, MessageRange.one(UID), MessageMapper.FetchType.Full, 1);
         assertThat(resultIterator).hasSize(1);
     }
     
@@ -197,9 +196,9 @@ public class PostDequeueDecoratorTest {
         
         testee.done(true);
         
-        Mailbox<InMemoryId> mailbox = mailboxSessionMapperFactory.getMailboxMapper(mailboxSession).findMailboxByPath(OUTBOX_MAILBOX_PATH);
-        MessageMapper<InMemoryId> messageMapper = mailboxSessionMapperFactory.getMessageMapper(mailboxSession);
-        Iterator<MailboxMessage<InMemoryId>> resultIterator = messageMapper.findInMailbox(mailbox, MessageRange.one(UID), MessageMapper.FetchType.Full, 1);
+        Mailbox mailbox = mailboxSessionMapperFactory.getMailboxMapper(mailboxSession).findMailboxByPath(OUTBOX_MAILBOX_PATH);
+        MessageMapper messageMapper = mailboxSessionMapperFactory.getMessageMapper(mailboxSession);
+        Iterator<MailboxMessage> resultIterator = messageMapper.findInMailbox(mailbox, MessageRange.one(UID), MessageMapper.FetchType.Full, 1);
         assertThat(resultIterator).hasSize(1);
     }
     
@@ -214,9 +213,9 @@ public class PostDequeueDecoratorTest {
         
         testee.done(true);
         
-        Mailbox<InMemoryId> mailbox = mailboxSessionMapperFactory.getMailboxMapper(mailboxSession).findMailboxByPath(OUTBOX_MAILBOX_PATH);
-        MessageMapper<InMemoryId> messageMapper = mailboxSessionMapperFactory.getMessageMapper(mailboxSession);
-        Iterator<MailboxMessage<InMemoryId>> resultIterator = messageMapper.findInMailbox(mailbox, MessageRange.one(UID), MessageMapper.FetchType.Full, 1);
+        Mailbox mailbox = mailboxSessionMapperFactory.getMailboxMapper(mailboxSession).findMailboxByPath(OUTBOX_MAILBOX_PATH);
+        MessageMapper messageMapper = mailboxSessionMapperFactory.getMessageMapper(mailboxSession);
+        Iterator<MailboxMessage> resultIterator = messageMapper.findInMailbox(mailbox, MessageRange.one(UID), MessageMapper.FetchType.Full, 1);
         assertThat(resultIterator).hasSize(1);
     }
     
@@ -231,9 +230,9 @@ public class PostDequeueDecoratorTest {
         
         testee.done(true);
         
-        Mailbox<InMemoryId> mailbox = mailboxSessionMapperFactory.getMailboxMapper(mailboxSession).findMailboxByPath(OUTBOX_MAILBOX_PATH);
-        MessageMapper<InMemoryId> messageMapper = mailboxSessionMapperFactory.getMessageMapper(mailboxSession);
-        Iterator<MailboxMessage<InMemoryId>> resultIterator = messageMapper.findInMailbox(mailbox, MessageRange.one(UID), MessageMapper.FetchType.Full, 1);
+        Mailbox mailbox = mailboxSessionMapperFactory.getMailboxMapper(mailboxSession).findMailboxByPath(OUTBOX_MAILBOX_PATH);
+        MessageMapper messageMapper = mailboxSessionMapperFactory.getMessageMapper(mailboxSession);
+        Iterator<MailboxMessage> resultIterator = messageMapper.findInMailbox(mailbox, MessageRange.one(UID), MessageMapper.FetchType.Full, 1);
         assertThat(resultIterator).hasSize(1);
     }
     
@@ -249,9 +248,9 @@ public class PostDequeueDecoratorTest {
         
         testee.done(true);
         
-        Mailbox<InMemoryId> mailbox = mailboxSessionMapperFactory.getMailboxMapper(mailboxSession).findMailboxByPath(OUTBOX_MAILBOX_PATH);
-        MessageMapper<InMemoryId> messageMapper = mailboxSessionMapperFactory.getMessageMapper(mailboxSession);
-        Iterator<MailboxMessage<InMemoryId>> resultIterator = messageMapper.findInMailbox(mailbox, MessageRange.one(UID), MessageMapper.FetchType.Full, 1);
+        Mailbox mailbox = mailboxSessionMapperFactory.getMailboxMapper(mailboxSession).findMailboxByPath(OUTBOX_MAILBOX_PATH);
+        MessageMapper messageMapper = mailboxSessionMapperFactory.getMessageMapper(mailboxSession);
+        Iterator<MailboxMessage> resultIterator = messageMapper.findInMailbox(mailbox, MessageRange.one(UID), MessageMapper.FetchType.Full, 1);
         assertThat(resultIterator).hasSize(1);
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap/src/test/java/org/apache/james/jmap/utils/MailboxUtilsTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/utils/MailboxUtilsTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/utils/MailboxUtilsTest.java
index c13782c..a229b9d 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/utils/MailboxUtilsTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/utils/MailboxUtilsTest.java
@@ -26,11 +26,11 @@ import java.util.Optional;
 import org.apache.james.jmap.model.mailbox.Mailbox;
 import org.apache.james.mailbox.MailboxManager;
 import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.mailbox.inmemory.InMemoryId;
 import org.apache.james.mailbox.inmemory.InMemoryMailboxSessionMapperFactory;
 import org.apache.james.mailbox.inmemory.manager.InMemoryIntegrationResources;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.store.mail.MailboxMapperFactory;
+import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.junit.Before;
 import org.junit.Test;
 import org.slf4j.Logger;
@@ -41,10 +41,10 @@ public class MailboxUtilsTest {
     private static final Logger LOGGER = LoggerFactory.getLogger(MailboxUtilsTest.class);
 
     private MailboxManager mailboxManager;
-    private MailboxMapperFactory<InMemoryId> mailboxMapperFactory;
+    private MailboxMapperFactory mailboxMapperFactory;
     private MailboxSession mailboxSession;
     private String user;
-    private MailboxUtils<InMemoryId> sut;
+    private MailboxUtils sut;
 
     @Before
     public void setup() throws Exception {
@@ -53,7 +53,7 @@ public class MailboxUtilsTest {
         mailboxMapperFactory = new InMemoryMailboxSessionMapperFactory();
         user = "user@domain.org";
         mailboxSession = mailboxManager.login(user, "pass", LOGGER);
-        sut = new MailboxUtils<>(mailboxManager, mailboxMapperFactory);
+        sut = new MailboxUtils(mailboxManager, mailboxMapperFactory);
     }
 
     @Test
@@ -107,7 +107,7 @@ public class MailboxUtilsTest {
         String expected = "mailbox";
         MailboxPath mailboxPath = new MailboxPath("#private", user, expected);
         mailboxManager.createMailbox(mailboxPath, mailboxSession);
-        InMemoryId mailboxId = mailboxMapperFactory.getMailboxMapper(mailboxSession)
+        MailboxId mailboxId = mailboxMapperFactory.getMailboxMapper(mailboxSession)
             .findMailboxByPath(mailboxPath)
             .getMailboxId();
 
@@ -136,7 +136,7 @@ public class MailboxUtilsTest {
     public void getParentIdFromMailboxPathShouldReturnParentIdWhenChildMailbox() throws Exception {
         MailboxPath parentMailboxPath = new MailboxPath("#private", user, "inbox");
         mailboxManager.createMailbox(parentMailboxPath, mailboxSession);
-        InMemoryId parentId = mailboxMapperFactory.getMailboxMapper(mailboxSession)
+        MailboxId parentId = mailboxMapperFactory.getMailboxMapper(mailboxSession)
                 .findMailboxByPath(parentMailboxPath)
                 .getMailboxId();
 
@@ -154,7 +154,7 @@ public class MailboxUtilsTest {
 
         MailboxPath parentMailboxPath = new MailboxPath("#private", user, "inbox.children");
         mailboxManager.createMailbox(parentMailboxPath, mailboxSession);
-        InMemoryId parentId = mailboxMapperFactory.getMailboxMapper(mailboxSession)
+        MailboxId parentId = mailboxMapperFactory.getMailboxMapper(mailboxSession)
                 .findMailboxByPath(parentMailboxPath)
                 .getMailboxId();
 
@@ -168,7 +168,7 @@ public class MailboxUtilsTest {
     public void mailboxFromMailboxIdShouldReturnPresentWhenExists() throws Exception {
         MailboxPath mailboxPath = new MailboxPath("#private", user, "myBox");
         mailboxManager.createMailbox(mailboxPath, mailboxSession);
-        InMemoryId mailboxId = mailboxMapperFactory.getMailboxMapper(mailboxSession)
+        MailboxId mailboxId = mailboxMapperFactory.getMailboxMapper(mailboxSession)
                 .findMailboxByPath(mailboxPath)
                 .getMailboxId();
 
@@ -187,7 +187,7 @@ public class MailboxUtilsTest {
     public void mailboxPathFromMailboxIdShouldReturnPresentWhenExists() throws Exception {
         MailboxPath mailboxPath = new MailboxPath("#private", user, "myBox");
         mailboxManager.createMailbox(mailboxPath, mailboxSession);
-        InMemoryId mailboxId = mailboxMapperFactory.getMailboxMapper(mailboxSession)
+        MailboxId mailboxId = mailboxMapperFactory.getMailboxMapper(mailboxSession)
                 .findMailboxByPath(mailboxPath)
                 .getMailboxId();
 
@@ -226,7 +226,7 @@ public class MailboxUtilsTest {
     public void getMailboxPathShouldReturnThePathWhenRootMailbox() throws Exception {
         MailboxPath expected = new MailboxPath("#private", user, "myBox");
         mailboxManager.createMailbox(expected, mailboxSession);
-        InMemoryId mailboxId = mailboxMapperFactory.getMailboxMapper(mailboxSession)
+        MailboxId mailboxId = mailboxMapperFactory.getMailboxMapper(mailboxSession)
                 .findMailboxByPath(expected)
                 .getMailboxId();
 
@@ -243,13 +243,13 @@ public class MailboxUtilsTest {
     public void getMailboxPathShouldReturnThePathWhenChildMailbox() throws Exception {
         MailboxPath parentMailboxPath = new MailboxPath("#private", user, "inbox");
         mailboxManager.createMailbox(parentMailboxPath, mailboxSession);
-        InMemoryId parentId = mailboxMapperFactory.getMailboxMapper(mailboxSession)
+        MailboxId parentId = mailboxMapperFactory.getMailboxMapper(mailboxSession)
                 .findMailboxByPath(parentMailboxPath)
                 .getMailboxId();
 
         MailboxPath expected = new MailboxPath("#private", user, "inbox.myBox");
         mailboxManager.createMailbox(expected, mailboxSession);
-        InMemoryId mailboxId = mailboxMapperFactory.getMailboxMapper(mailboxSession)
+        MailboxId mailboxId = mailboxMapperFactory.getMailboxMapper(mailboxSession)
                 .findMailboxByPath(expected)
                 .getMailboxId();
 
@@ -270,13 +270,13 @@ public class MailboxUtilsTest {
 
         MailboxPath childMailboxPath = new MailboxPath("#private", user, "inbox.child");
         mailboxManager.createMailbox(childMailboxPath, mailboxSession);
-        InMemoryId childId = mailboxMapperFactory.getMailboxMapper(mailboxSession)
+        MailboxId childId = mailboxMapperFactory.getMailboxMapper(mailboxSession)
                 .findMailboxByPath(childMailboxPath)
                 .getMailboxId();
 
         MailboxPath expected = new MailboxPath("#private", user, "inbox.child.myBox");
         mailboxManager.createMailbox(expected, mailboxSession);
-        InMemoryId mailboxId = mailboxMapperFactory.getMailboxMapper(mailboxSession)
+        MailboxId mailboxId = mailboxMapperFactory.getMailboxMapper(mailboxSession)
                 .findMailboxByPath(expected)
                 .getMailboxId();
 
@@ -294,7 +294,7 @@ public class MailboxUtilsTest {
     public void hasChildrenShouldReturnFalseWhenNoChild() throws Exception {
         MailboxPath mailboxPath = new MailboxPath("#private", user, "myBox");
         mailboxManager.createMailbox(mailboxPath, mailboxSession);
-        InMemoryId mailboxId = mailboxMapperFactory.getMailboxMapper(mailboxSession)
+        MailboxId mailboxId = mailboxMapperFactory.getMailboxMapper(mailboxSession)
                 .findMailboxByPath(mailboxPath)
                 .getMailboxId();
 
@@ -305,7 +305,7 @@ public class MailboxUtilsTest {
     public void hasChildrenShouldReturnTrueWhenHasAChild() throws Exception {
         MailboxPath parentMailboxPath = new MailboxPath("#private", user, "inbox");
         mailboxManager.createMailbox(parentMailboxPath, mailboxSession);
-        InMemoryId parentId = mailboxMapperFactory.getMailboxMapper(mailboxSession)
+        MailboxId parentId = mailboxMapperFactory.getMailboxMapper(mailboxSession)
                 .findMailboxByPath(parentMailboxPath)
                 .getMailboxId();
 


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


Mime
View raw message