james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adup...@apache.org
Subject [06/13] james-project git commit: JAMES-1733 Remove generics from mailbox API
Date Tue, 17 May 2016 08:14:52 GMT
http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/SimpleMessageSearchIndex.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/SimpleMessageSearchIndex.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/SimpleMessageSearchIndex.java
index a150cb3..6c43ddc 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/SimpleMessageSearchIndex.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/SimpleMessageSearchIndex.java
@@ -37,7 +37,6 @@ import org.apache.james.mailbox.model.SearchQuery.UidCriterion;
 import org.apache.james.mailbox.store.mail.MessageMapper;
 import org.apache.james.mailbox.store.mail.MessageMapper.FetchType;
 import org.apache.james.mailbox.store.mail.MessageMapperFactory;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 
@@ -48,15 +47,14 @@ import org.apache.james.mailbox.store.mail.model.MailboxMessage;
  * This works with every implementation but is SLOW.
  * 
  *
- * @param <Id>
  */
 @Singleton
-public class SimpleMessageSearchIndex<Id extends MailboxId> implements MessageSearchIndex<Id> {
+public class SimpleMessageSearchIndex implements MessageSearchIndex {
 
-    private final MessageMapperFactory<Id> factory;
+    private final MessageMapperFactory factory;
     
     @Inject
-    public SimpleMessageSearchIndex(MessageMapperFactory<Id> factory) {
+    public SimpleMessageSearchIndex(MessageMapperFactory factory) {
         this.factory = factory;
     }
     
@@ -80,10 +78,10 @@ public class SimpleMessageSearchIndex<Id extends MailboxId> implements MessageSe
 	}
     
     @Override
-    public Iterator<Long> search(MailboxSession session, Mailbox<Id> mailbox, SearchQuery query) throws MailboxException {
-        MessageMapper<Id> mapper = factory.getMessageMapper(session);
+    public Iterator<Long> search(MailboxSession session, Mailbox mailbox, SearchQuery query) throws MailboxException {
+        MessageMapper mapper = factory.getMessageMapper(session);
 
-        final SortedSet<MailboxMessage<?>> hitSet = new TreeSet<MailboxMessage<?>>();
+        final SortedSet<MailboxMessage> hitSet = new TreeSet<MailboxMessage>();
 
         UidCriterion uidCrit = findConjugatedUidCriterion(query.getCriterias());
         if (uidCrit != null) {
@@ -91,16 +89,16 @@ public class SimpleMessageSearchIndex<Id extends MailboxId> implements MessageSe
             // only fetching this uid range
             NumericRange[] ranges = uidCrit.getOperator().getRange();
             for (NumericRange r : ranges) {
-                Iterator<MailboxMessage<Id>> it = mapper.findInMailbox(mailbox, MessageRange.range(r.getLowValue(), r.getHighValue()), FetchType.Metadata, -1);
+                Iterator<MailboxMessage> it = mapper.findInMailbox(mailbox, MessageRange.range(r.getLowValue(), r.getHighValue()), FetchType.Metadata, -1);
                 while (it.hasNext()) {
                     hitSet.add(it.next());
                 }
             }
         } else {
         	// we have to fetch all messages
-            Iterator<MailboxMessage<Id>> messages = mapper.findInMailbox(mailbox, MessageRange.all(), FetchType.Full, -1);
+            Iterator<MailboxMessage> messages = mapper.findInMailbox(mailbox, MessageRange.all(), FetchType.Full, -1);
             while(messages.hasNext()) {
-            	MailboxMessage<Id> m = messages.next();
+            	MailboxMessage m = messages.next();
             	hitSet.add(m);
             }
         }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/AbstractHeaderComparator.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/AbstractHeaderComparator.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/AbstractHeaderComparator.java
index baa49c2..4462361 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/AbstractHeaderComparator.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/AbstractHeaderComparator.java
@@ -29,13 +29,13 @@ import org.apache.james.mailbox.store.ResultUtils;
 import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 
 
-public abstract class AbstractHeaderComparator implements Comparator<MailboxMessage<?>>{
+public abstract class AbstractHeaderComparator implements Comparator<MailboxMessage>{
 
     public final static String FROM ="from";
     public final static String TO ="to";
     public final static String CC ="cc";
 
-    protected String getHeaderValue(String headerName, MailboxMessage<?> message) {
+    protected String getHeaderValue(String headerName, MailboxMessage message) {
         try {
             final List<Header> headers = ResultUtils.createHeaders(message);
             for (Header header : headers) {

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/BaseSubjectComparator.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/BaseSubjectComparator.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/BaseSubjectComparator.java
index 827cb6a..2a02494 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/BaseSubjectComparator.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/BaseSubjectComparator.java
@@ -27,15 +27,15 @@ public class BaseSubjectComparator extends AbstractHeaderComparator{
 
 
 
-    private final static Comparator<MailboxMessage<?>> BASESUBJECT = new BaseSubjectComparator();
-    private final static Comparator<MailboxMessage<?>> REVERSE_BASESUBJECT = new ReverseComparator(BASESUBJECT);
+    private final static Comparator<MailboxMessage> BASESUBJECT = new BaseSubjectComparator();
+    private final static Comparator<MailboxMessage> REVERSE_BASESUBJECT = new ReverseComparator(BASESUBJECT);
 
     
     
     private final static String SUBJECT = "subject";
     
     @Override
-    public int compare(MailboxMessage<?> o1, MailboxMessage<?> o2) {
+    public int compare(MailboxMessage o1, MailboxMessage o2) {
         String baseSubject1 = SearchUtil.getBaseSubject(getHeaderValue(SUBJECT, o1));
         String baseSubject2 = SearchUtil.getBaseSubject(getHeaderValue(SUBJECT, o2));
 
@@ -43,7 +43,7 @@ public class BaseSubjectComparator extends AbstractHeaderComparator{
     }
 
 
-    public static Comparator<MailboxMessage<?>> baseSubject(boolean reverse){
+    public static Comparator<MailboxMessage> baseSubject(boolean reverse){
         if (reverse) {
             return REVERSE_BASESUBJECT;
         } else {

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/CombinedComparator.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/CombinedComparator.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/CombinedComparator.java
index 19e7bb4..002aea2 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/CombinedComparator.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/CombinedComparator.java
@@ -30,19 +30,19 @@ import org.apache.james.mailbox.store.mail.model.MailboxMessage;
  * return <> 0
  *
  */
-public class CombinedComparator implements Comparator<MailboxMessage<?>>{
+public class CombinedComparator implements Comparator<MailboxMessage>{
 
-    private final Comparator<MailboxMessage<?>>[] comparators;
-    public CombinedComparator(Comparator<MailboxMessage<?>>[] comparators) {
+    private final Comparator<MailboxMessage>[] comparators;
+    public CombinedComparator(Comparator<MailboxMessage>[] comparators) {
         if(comparators == null || comparators.length < 1) {
             throw new IllegalArgumentException();
         }
         this.comparators = comparators;
     }
     @Override
-    public int compare(MailboxMessage<?> o1, MailboxMessage<?> o2) {
+    public int compare(MailboxMessage o1, MailboxMessage o2) {
         int i = 0;
-        for (Comparator<MailboxMessage<?>> comparator : comparators) {
+        for (Comparator<MailboxMessage> comparator : comparators) {
             i = comparator.compare(o1, o2);
             if (i != 0) {
                 break;
@@ -52,11 +52,11 @@ public class CombinedComparator implements Comparator<MailboxMessage<?>>{
     }
     
     @SuppressWarnings("unchecked")
-    public static Comparator<MailboxMessage<?>> create(List<Sort> sorts) {
-        List<Comparator<?>> comps = new ArrayList<Comparator<?>>();
+    public static Comparator<MailboxMessage> create(List<Sort> sorts) {
+        List<Comparator<MailboxMessage>> comps = new ArrayList<Comparator<MailboxMessage>>();
         for (Sort sort : sorts) {
             boolean reverse = sort.isReverse();
-            Comparator<MailboxMessage<?>> comparator = null;
+            Comparator<MailboxMessage> comparator = null;
 
             switch (sort.getSortClause()) {
                 case Arrival:

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/HeaderDisplayComparator.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/HeaderDisplayComparator.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/HeaderDisplayComparator.java
index c17a2bb..81c474a 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/HeaderDisplayComparator.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/HeaderDisplayComparator.java
@@ -26,12 +26,12 @@ import org.apache.james.mailbox.store.search.SearchUtil;
 public class HeaderDisplayComparator extends AbstractHeaderComparator{
 
 
-    private final static Comparator<MailboxMessage<?>> FROM_COMPARATOR = new HeaderDisplayComparator(FROM);
-    private final static Comparator<MailboxMessage<?>> REVERSE_FROM_COMPARATOR = new ReverseComparator(FROM_COMPARATOR);
+    private final static Comparator<MailboxMessage> FROM_COMPARATOR = new HeaderDisplayComparator(FROM);
+    private final static Comparator<MailboxMessage> REVERSE_FROM_COMPARATOR = new ReverseComparator(FROM_COMPARATOR);
 
 
-    private final static Comparator<MailboxMessage<?>> TO_COMPARATOR = new HeaderDisplayComparator(TO);
-    private final static Comparator<MailboxMessage<?>> REVERSE_TO_COMPARATOR = new ReverseComparator(TO_COMPARATOR);
+    private final static Comparator<MailboxMessage> TO_COMPARATOR = new HeaderDisplayComparator(TO);
+    private final static Comparator<MailboxMessage> REVERSE_TO_COMPARATOR = new ReverseComparator(TO_COMPARATOR);
 
     
     private final String headerName;
@@ -41,14 +41,14 @@ public class HeaderDisplayComparator extends AbstractHeaderComparator{
     }
     
     @Override
-    public int compare(MailboxMessage<?> o1, MailboxMessage<?> o2) {
+    public int compare(MailboxMessage o1, MailboxMessage o2) {
         String display1 = SearchUtil.getDisplayAddress(getHeaderValue(headerName, o1));
         String display2 = SearchUtil.getDisplayAddress(getHeaderValue(headerName, o2));
         return display1.compareToIgnoreCase(display2);
     }
 
     
-    public static Comparator<MailboxMessage<?>> from(boolean reverse) {
+    public static Comparator<MailboxMessage> from(boolean reverse) {
         if (reverse) {
             return REVERSE_FROM_COMPARATOR;
         } else {
@@ -57,7 +57,7 @@ public class HeaderDisplayComparator extends AbstractHeaderComparator{
     }
 
     
-    public static Comparator<MailboxMessage<?>> to(boolean reverse) {
+    public static Comparator<MailboxMessage> to(boolean reverse) {
         if (reverse) {
             return REVERSE_TO_COMPARATOR;
         } else {

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/HeaderMailboxComparator.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/HeaderMailboxComparator.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/HeaderMailboxComparator.java
index 110ae1a..0acb052 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/HeaderMailboxComparator.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/HeaderMailboxComparator.java
@@ -27,16 +27,16 @@ public class HeaderMailboxComparator extends AbstractHeaderComparator{
 
     private final String headerName;
 
-    private final static Comparator<MailboxMessage<?>> FROM_COMPARATOR = new HeaderMailboxComparator(FROM);
-    private final static Comparator<MailboxMessage<?>> REVERSE_FROM_COMPARATOR = new ReverseComparator(FROM_COMPARATOR);
+    private final static Comparator<MailboxMessage> FROM_COMPARATOR = new HeaderMailboxComparator(FROM);
+    private final static Comparator<MailboxMessage> REVERSE_FROM_COMPARATOR = new ReverseComparator(FROM_COMPARATOR);
 
 
-    private final static Comparator<MailboxMessage<?>> TO_COMPARATOR = new HeaderMailboxComparator(TO);
-    private final static Comparator<MailboxMessage<?>> REVERSE_TO_COMPARATOR = new ReverseComparator(TO_COMPARATOR);
+    private final static Comparator<MailboxMessage> TO_COMPARATOR = new HeaderMailboxComparator(TO);
+    private final static Comparator<MailboxMessage> REVERSE_TO_COMPARATOR = new ReverseComparator(TO_COMPARATOR);
 
 
-    private final static Comparator<MailboxMessage<?>> CC_COMPARATOR = new HeaderMailboxComparator(CC);
-    private final static Comparator<MailboxMessage<?>> REVERSE_CC_COMPARATOR = new ReverseComparator(CC_COMPARATOR);
+    private final static Comparator<MailboxMessage> CC_COMPARATOR = new HeaderMailboxComparator(CC);
+    private final static Comparator<MailboxMessage> REVERSE_CC_COMPARATOR = new ReverseComparator(CC_COMPARATOR);
 
     
     public HeaderMailboxComparator(String headerName) {
@@ -44,7 +44,7 @@ public class HeaderMailboxComparator extends AbstractHeaderComparator{
     }
     
     @Override
-    public int compare(MailboxMessage<?> o1, MailboxMessage<?> o2) {
+    public int compare(MailboxMessage o1, MailboxMessage o2) {
         String mailbox1 = SearchUtil.getMailboxAddress(getHeaderValue(headerName, o1));
         String mailbox2 = SearchUtil.getMailboxAddress(getHeaderValue(headerName, o2));
 
@@ -53,7 +53,7 @@ public class HeaderMailboxComparator extends AbstractHeaderComparator{
     
 
     
-    public static Comparator<MailboxMessage<?>> from(boolean reverse) {
+    public static Comparator<MailboxMessage> from(boolean reverse) {
         if (reverse) {
             return REVERSE_FROM_COMPARATOR;
         } else {
@@ -61,7 +61,7 @@ public class HeaderMailboxComparator extends AbstractHeaderComparator{
         }
     }
     
-    public static Comparator<MailboxMessage<?>> cc(boolean reverse) {
+    public static Comparator<MailboxMessage> cc(boolean reverse) {
         if (reverse) {
             return REVERSE_CC_COMPARATOR;
         } else {
@@ -69,7 +69,7 @@ public class HeaderMailboxComparator extends AbstractHeaderComparator{
         }
     }
     
-    public static Comparator<MailboxMessage<?>> to(boolean reverse) {
+    public static Comparator<MailboxMessage> to(boolean reverse) {
         if (reverse) {
             return REVERSE_TO_COMPARATOR;
         } else {

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/InternalDateComparator.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/InternalDateComparator.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/InternalDateComparator.java
index 3fa227f..4f70337 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/InternalDateComparator.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/InternalDateComparator.java
@@ -26,19 +26,19 @@ import org.apache.james.mailbox.store.mail.model.MailboxMessage;
  * {@link Comparator} which compares {@link MailboxMessage}'s with their {@link MailboxMessage#getInternalDate()} value
  *
  */
-public class InternalDateComparator  implements Comparator<MailboxMessage<?>>{
+public class InternalDateComparator  implements Comparator<MailboxMessage>{
 
 
-    private final static Comparator<MailboxMessage<?>> INTERNALDATE = new InternalDateComparator();
-    private final static Comparator<MailboxMessage<?>> REVERSE_INTERNALDATE = new ReverseComparator(INTERNALDATE);
+    private final static Comparator<MailboxMessage> INTERNALDATE = new InternalDateComparator();
+    private final static Comparator<MailboxMessage> REVERSE_INTERNALDATE = new ReverseComparator(INTERNALDATE);
 
     
     @Override
-    public int compare(MailboxMessage<?> o1, MailboxMessage<?> o2) {
+    public int compare(MailboxMessage o1, MailboxMessage o2) {
         return (o1.getInternalDate().compareTo(o2.getInternalDate()));
     }
 
-    public static Comparator<MailboxMessage<?>> internalDate(boolean reverse){
+    public static Comparator<MailboxMessage> internalDate(boolean reverse){
         if (reverse) {
             return REVERSE_INTERNALDATE;
         } else {

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/ReverseComparator.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/ReverseComparator.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/ReverseComparator.java
index 55d1db0..5395482 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/ReverseComparator.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/ReverseComparator.java
@@ -26,14 +26,14 @@ import org.apache.james.mailbox.store.mail.model.MailboxMessage;
  * {@link Comparator} which wraps an other {@link Comparator} and reverse it
  *
  */
-public class ReverseComparator implements Comparator<MailboxMessage<?>>{
+public class ReverseComparator implements Comparator<MailboxMessage>{
 
-    private final Comparator<MailboxMessage<?>> comparator;
-    public ReverseComparator(Comparator<MailboxMessage<?>> comparator) {
+    private final Comparator<MailboxMessage> comparator;
+    public ReverseComparator(Comparator<MailboxMessage> comparator) {
         this.comparator = comparator;
     }
     @Override
-    public int compare(MailboxMessage<?> o1, MailboxMessage<?> o2) {
+    public int compare(MailboxMessage o1, MailboxMessage o2) {
         return comparator.compare(o2, o1);
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/SentDateComparator.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/SentDateComparator.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/SentDateComparator.java
index 6b5c2cd..1c4e759 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/SentDateComparator.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/SentDateComparator.java
@@ -35,8 +35,8 @@ public class SentDateComparator extends AbstractHeaderComparator {
 
 
 
-    private final static Comparator<MailboxMessage<?>> SENTDATE = new SentDateComparator(false);
-    private final static Comparator<MailboxMessage<?>> REVERSE_SENTDATE = new ReverseComparator(new SentDateComparator(true));
+    private final static Comparator<MailboxMessage> SENTDATE = new SentDateComparator(false);
+    private final static Comparator<MailboxMessage> REVERSE_SENTDATE = new ReverseComparator(new SentDateComparator(true));
     
     private final boolean reverse;
 
@@ -45,7 +45,7 @@ public class SentDateComparator extends AbstractHeaderComparator {
     }
     
     @Override
-    public int compare(MailboxMessage<?> o1, MailboxMessage<?> o2) {
+    public int compare(MailboxMessage o1, MailboxMessage o2) {
         Date date1 = getSentDate(o1);
         Date date2 = getSentDate(o2);
         int i = date1.compareTo(date2);
@@ -57,7 +57,7 @@ public class SentDateComparator extends AbstractHeaderComparator {
         return 0;
     }
     
-    private Date getSentDate(MailboxMessage<?> message) {
+    private Date getSentDate(MailboxMessage message) {
         final String value = getHeaderValue("Date", message);
         final StringReader reader = new StringReader(value);
         try {
@@ -69,7 +69,7 @@ public class SentDateComparator extends AbstractHeaderComparator {
         }
     }
     
-    public static Comparator<MailboxMessage<?>> sentDate(boolean reverse){
+    public static Comparator<MailboxMessage> sentDate(boolean reverse){
         if (reverse) {
             return REVERSE_SENTDATE;
         } else {

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/SizeComparator.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/SizeComparator.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/SizeComparator.java
index fa8a613..959383b 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/SizeComparator.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/SizeComparator.java
@@ -26,19 +26,19 @@ import org.apache.james.mailbox.store.mail.model.MailboxMessage;
  * {@link Comparator} which compares {@link MailboxMessage}'s with their {@link MailboxMessage#getFullContentOctets()} value
  *
  */
-public class SizeComparator implements Comparator<MailboxMessage<?>>{
+public class SizeComparator implements Comparator<MailboxMessage>{
 
 
-    private final static Comparator<MailboxMessage<?>> SIZE = new SizeComparator();
-    private final static Comparator<MailboxMessage<?>> REVERSE_SIZE = new ReverseComparator(SIZE);
+    private final static Comparator<MailboxMessage> SIZE = new SizeComparator();
+    private final static Comparator<MailboxMessage> REVERSE_SIZE = new ReverseComparator(SIZE);
 
     
     @Override
-    public int compare(MailboxMessage<?> o1, MailboxMessage<?> o2) {
+    public int compare(MailboxMessage o1, MailboxMessage o2) {
         return (int) (o1.getFullContentOctets() - o2.getFullContentOctets());
     }
 
-    public static Comparator<MailboxMessage<?>> size(boolean reverse) {
+    public static Comparator<MailboxMessage> size(boolean reverse) {
         if (reverse) {
             return REVERSE_SIZE;
         } else {

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/UidComparator.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/UidComparator.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/UidComparator.java
index 38f618a..0873a2f 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/UidComparator.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/UidComparator.java
@@ -26,19 +26,19 @@ import org.apache.james.mailbox.store.mail.model.MailboxMessage;
  * {@link Comparator} which compares {@link MailboxMessage}'s with their {@link MailboxMessage#getUid()} value
  *
  */
-public class UidComparator implements Comparator<MailboxMessage<?>>{
+public class UidComparator implements Comparator<MailboxMessage>{
 
 
-    private final static Comparator<MailboxMessage<?>> UID = new UidComparator();
-    private final static Comparator<MailboxMessage<?>> REVERSE_UID = new ReverseComparator(UID);
+    private final static Comparator<MailboxMessage> UID = new UidComparator();
+    private final static Comparator<MailboxMessage> REVERSE_UID = new ReverseComparator(UID);
 
     
     @Override
-    public int compare(MailboxMessage<?> o1, MailboxMessage<?> o2) {
+    public int compare(MailboxMessage o1, MailboxMessage o2) {
         return (int) (o1.getUid() - o2.getUid());
     }
 
-    public static Comparator<MailboxMessage<?>> uid(boolean reverse){
+    public static Comparator<MailboxMessage> uid(boolean reverse){
         if (reverse) {
             return REVERSE_UID;
         } else {

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/test/java/org/apache/james/mailbox/store/GroupFolderResolverTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/GroupFolderResolverTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/GroupFolderResolverTest.java
index c2f1b84..836bf4a 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/GroupFolderResolverTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/GroupFolderResolverTest.java
@@ -43,7 +43,7 @@ public class GroupFolderResolverTest {
         SimpleMailboxSession mailboxSession = new SimpleMailboxSession(1, "username", "password", log, localePreferences, sharedSpaces, null, pathSeparator, SessionType.User);
         GroupFolderResolver testee =  new GroupFolderResolver(mailboxSession);
         
-        SimpleMailbox<TestId> mailbox = new SimpleMailbox<TestId>(new MailboxPath(null, "user", "name"), UID_VALIDITY);
+        SimpleMailbox mailbox = new SimpleMailbox(new MailboxPath(null, "user", "name"), UID_VALIDITY);
         assertThat(testee.isGroupFolder(mailbox)).isFalse();
     }
     
@@ -52,7 +52,7 @@ public class GroupFolderResolverTest {
         SimpleMailboxSession mailboxSession = new SimpleMailboxSession(1, "username", "password", log, localePreferences, sharedSpaces, null, pathSeparator, SessionType.User);
         GroupFolderResolver testee =  new GroupFolderResolver(mailboxSession);
         
-        SimpleMailbox<TestId> mailbox = new SimpleMailbox<TestId>(new MailboxPath(MailboxConstants.USER_NAMESPACE, "user", "name"), UID_VALIDITY);
+        SimpleMailbox mailbox = new SimpleMailbox(new MailboxPath(MailboxConstants.USER_NAMESPACE, "user", "name"), UID_VALIDITY);
         assertThat(testee.isGroupFolder(mailbox)).isFalse();
     }
     
@@ -62,7 +62,7 @@ public class GroupFolderResolverTest {
         SimpleMailboxSession mailboxSession = new SimpleMailboxSession(1, "username", "password", log, localePreferences, sharedSpaces, otherUsersSpace, pathSeparator, SessionType.User);
         GroupFolderResolver testee =  new GroupFolderResolver(mailboxSession);
         
-        SimpleMailbox<TestId> mailbox = new SimpleMailbox<TestId>(new MailboxPath("other", "user", "name"), UID_VALIDITY);
+        SimpleMailbox mailbox = new SimpleMailbox(new MailboxPath("other", "user", "name"), UID_VALIDITY);
         assertThat(testee.isGroupFolder(mailbox)).isFalse();
     }
     
@@ -72,7 +72,7 @@ public class GroupFolderResolverTest {
         SimpleMailboxSession mailboxSession = new SimpleMailboxSession(1, "username", "password", log, localePreferences, sharedSpaces, otherUsersSpace, pathSeparator, SessionType.User);
         GroupFolderResolver testee =  new GroupFolderResolver(mailboxSession);
         
-        SimpleMailbox<TestId> mailbox = new SimpleMailbox<TestId>(new MailboxPath("namespace", "user", "name"), UID_VALIDITY);
+        SimpleMailbox mailbox = new SimpleMailbox(new MailboxPath("namespace", "user", "name"), UID_VALIDITY);
         assertThat(testee.isGroupFolder(mailbox)).isTrue();
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/test/java/org/apache/james/mailbox/store/MailboxEventDispatcherTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/MailboxEventDispatcherTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/MailboxEventDispatcherTest.java
index 8b8ba84..d34c3b2 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/MailboxEventDispatcherTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/MailboxEventDispatcherTest.java
@@ -19,7 +19,10 @@
 
 package org.apache.james.mailbox.store;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.util.Arrays;
 import java.util.Iterator;
@@ -47,7 +50,7 @@ import org.junit.runner.RunWith;
 @RunWith(JMock.class)
 public class MailboxEventDispatcherTest {
 
-    MailboxEventDispatcher<TestId> dispatcher;
+    MailboxEventDispatcher dispatcher;
 
     EventCollector collector;
 
@@ -65,7 +68,7 @@ public class MailboxEventDispatcherTest {
 
     private  Mockery mockery = new JUnit4Mockery();
 
-    private Mailbox<TestId> mailbox = new Mailbox<TestId>() {
+    private Mailbox mailbox = new Mailbox() {
 
         @Override
         public TestId getMailboxId() {
@@ -120,7 +123,7 @@ public class MailboxEventDispatcherTest {
     public void setUp() throws Exception {
         collector = new EventCollector();
 
-        dispatcher = new MailboxEventDispatcher<TestId>(collector);
+        dispatcher = new MailboxEventDispatcher(collector);
         result = mockery.mock(MessageResult.class);
         mockery.checking(new Expectations() {{
             allowing(result).getUid();will(returnValue(23L));

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/test/java/org/apache/james/mailbox/store/MailboxMessageResultImplTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/MailboxMessageResultImplTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/MailboxMessageResultImplTest.java
index 629506a..38b2132 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/MailboxMessageResultImplTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/MailboxMessageResultImplTest.java
@@ -42,9 +42,9 @@ public class MailboxMessageResultImplTest {
     public void initNames() throws Exception
     {
         Date dateAB = new Date();
-        MailboxMessage<TestId> msgA = buildMessage(100, dateAB);
-        MailboxMessage<TestId> msgB = buildMessage(100, dateAB);
-        MailboxMessage<TestId> msgC = buildMessage(200, new Date());
+        MailboxMessage msgA = buildMessage(100, dateAB);
+        MailboxMessage msgB = buildMessage(100, dateAB);
+        MailboxMessage msgC = buildMessage(200, new Date());
         
         msgResultA = new MessageResultImpl(msgA);
         msgResultACopy = new MessageResultImpl(msgA);
@@ -53,7 +53,7 @@ public class MailboxMessageResultImplTest {
     }
 
 
-    private MailboxMessage<TestId> buildMessage(int uid, Date aDate) throws Exception {
+    private MailboxMessage buildMessage(int uid, Date aDate) throws Exception {
         MessageBuilder builder = new MessageBuilder();
         builder.uid = uid;
         builder.internalDate = aDate;

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/test/java/org/apache/james/mailbox/store/MessageBuilder.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/MessageBuilder.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/MessageBuilder.java
index 9f2a318..f84b216 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/MessageBuilder.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/MessageBuilder.java
@@ -37,7 +37,7 @@ public class MessageBuilder {
     public final Map<String, String> headers = new HashMap<String, String>();
     public int lineNumber = 0;
     
-    public MailboxMessage<TestId> build() throws Exception {
+    public MailboxMessage build() throws Exception {
         return new SimpleMailboxMembership(mailboxId, uid, -1,  internalDate, size, flags, body, headers);
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsMultipartMixedTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsMultipartMixedTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsMultipartMixedTest.java
index a65246d..7b87e5c 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsMultipartMixedTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsMultipartMixedTest.java
@@ -19,7 +19,8 @@
 
 package org.apache.james.mailbox.store;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 import java.nio.charset.Charset;
 import java.util.ArrayList;
@@ -107,7 +108,7 @@ public class SearchUtilsMultipartMixedTest {
             + "  Than both your poets can in praise devise.\r\n"
             + "\r\n--2.50290787509--\r\n" + "\r\n--1729--\r\n";
 
-    MailboxMessage<TestId> row;
+    MailboxMessage row;
 
 
     Collection<Long> recent;

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsRFC822Test.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsRFC822Test.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsRFC822Test.java
index 657be71..d8c7e58 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsRFC822Test.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsRFC822Test.java
@@ -19,7 +19,8 @@
 
 package org.apache.james.mailbox.store;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 import java.nio.charset.Charset;
 import java.util.ArrayList;
@@ -47,7 +48,7 @@ public class SearchUtilsRFC822Test {
             + "It has " + RHUBARD + ".\r\n" + "It has " + CUSTARD + ".\r\n"
             + "It needs naught else.\r\n";
 
-    MailboxMessage<TestId> row;
+    MailboxMessage row;
 
     private Logger log = LoggerFactory.getLogger(getClass());
     Collection<Long> recent;

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsTest.java
index 52344ee..06703f1 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsTest.java
@@ -19,7 +19,8 @@
 
 package org.apache.james.mailbox.store;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 import java.util.ArrayList;
 import java.util.Calendar;
@@ -82,7 +83,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchSizeLessThan() throws Exception {
         builder.size = SIZE;
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.sizeLessThan(SIZE - 1), row,
                 recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.sizeLessThan(SIZE), row,
@@ -96,7 +97,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchSizeMoreThan() throws Exception {
         builder.size = SIZE;
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertTrue(new MessageSearches().isMatch(SearchQuery.sizeGreaterThan(SIZE - 1), row,
                 recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.sizeGreaterThan(SIZE), row,
@@ -110,7 +111,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchSizeEquals() throws Exception {
         builder.size = SIZE;
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.sizeEquals(SIZE - 1), row,
                 recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.sizeEquals(SIZE), row, recent, log));
@@ -123,7 +124,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchInternalDateEquals() throws Exception {
         builder.internalDate = SUN_SEP_9TH_2001;
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.internalDateOn(getDate(9, 9, 2000), DateResolution.Day),
                 row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.internalDateOn(getDate(8, 9, 2001), DateResolution.Day),
@@ -140,7 +141,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchInternalDateBefore() throws Exception {
         builder.internalDate = SUN_SEP_9TH_2001;
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertFalse(new MessageSearches().isMatch(
                 SearchQuery.internalDateBefore(getDate(9, 9, 2000), DateResolution.Day), row, recent, log));
         assertFalse(new MessageSearches().isMatch(
@@ -156,7 +157,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchInternalDateAfter() throws Exception {
         builder.internalDate = SUN_SEP_9TH_2001;
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertTrue(new MessageSearches().isMatch(SearchQuery.internalDateAfter(getDate(9, 9, 2000), DateResolution.Day),
                 row, recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.internalDateAfter(getDate(8, 9, 2001), DateResolution.Day),
@@ -172,7 +173,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchHeaderDateAfter() throws Exception {
         builder.header(DATE_FIELD, RFC822_SUN_SEP_9TH_2001);
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertTrue(new MessageSearches().isMatch(SearchQuery.headerDateAfter(DATE_FIELD, getDate(9,
                 9, 2000), DateResolution.Day), row, recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.headerDateAfter(DATE_FIELD, getDate(8,
@@ -190,7 +191,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchCapsHeaderDateAfter() throws Exception {
         builder.header(DATE_FIELD.toUpperCase(), RFC822_SUN_SEP_9TH_2001);
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertTrue(new MessageSearches().isMatch(SearchQuery.headerDateAfter(DATE_FIELD, getDate(9,
                 9, 2000), DateResolution.Day), row, recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.headerDateAfter(DATE_FIELD, getDate(8,
@@ -208,7 +209,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchLowersHeaderDateAfter() throws Exception {
         builder.header(DATE_FIELD.toLowerCase(), RFC822_SUN_SEP_9TH_2001);
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertTrue(new MessageSearches().isMatch(SearchQuery.headerDateAfter(DATE_FIELD, getDate(9,
                 9, 2000), DateResolution.Day), row, recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.headerDateAfter(DATE_FIELD, getDate(8,
@@ -226,7 +227,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchHeaderDateOn() throws Exception {
         builder.header(DATE_FIELD, RFC822_SUN_SEP_9TH_2001);
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateOn(DATE_FIELD, getDate(9, 9,
                 2000), DateResolution.Day),row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateOn(DATE_FIELD, getDate(8, 9,
@@ -244,7 +245,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchCapsHeaderDateOn() throws Exception {
         builder.header(DATE_FIELD.toUpperCase(), RFC822_SUN_SEP_9TH_2001);
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateOn(DATE_FIELD, getDate(9, 9,
                 2000), DateResolution.Day),row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateOn(DATE_FIELD, getDate(8, 9,
@@ -262,7 +263,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchLowersHeaderDateOn() throws Exception {
         builder.header(DATE_FIELD.toLowerCase(), RFC822_SUN_SEP_9TH_2001);
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateOn(DATE_FIELD, getDate(9, 9,
                 2000), DateResolution.Day),row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateOn(DATE_FIELD, getDate(8, 9,
@@ -280,7 +281,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchHeaderDateBefore() throws Exception {
         builder.header(DATE_FIELD.toLowerCase(), RFC822_SUN_SEP_9TH_2001);
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateBefore(DATE_FIELD,
                 getDate(9, 9, 2000), DateResolution.Day),row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateBefore(DATE_FIELD,
@@ -298,7 +299,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchCapsHeaderDateBefore() throws Exception {
         builder.header(DATE_FIELD.toLowerCase(), RFC822_SUN_SEP_9TH_2001);
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateBefore(DATE_FIELD,
                 getDate(9, 9, 2000), DateResolution.Day),row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateBefore(DATE_FIELD,
@@ -316,7 +317,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchLowersHeaderDateBefore() throws Exception {
         builder.header(DATE_FIELD.toLowerCase(), RFC822_SUN_SEP_9TH_2001);
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateBefore(DATE_FIELD,
                 getDate(9, 9, 2000), DateResolution.Day),row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateBefore(DATE_FIELD,
@@ -334,7 +335,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchHeaderContainsCaps() throws Exception {
         builder.header(SUBJECT_FIELD, TEXT.toUpperCase());
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerContains(DATE_FIELD,
                 CUSTARD), row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerContains(DATE_FIELD,
@@ -350,7 +351,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchHeaderContainsLowers() throws Exception {
         builder.header(SUBJECT_FIELD, TEXT.toUpperCase());
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerContains(DATE_FIELD,
                 CUSTARD), row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerContains(DATE_FIELD,
@@ -366,7 +367,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchHeaderContains() throws Exception {
         builder.header(SUBJECT_FIELD, TEXT.toUpperCase());
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerContains(DATE_FIELD,
                 CUSTARD), row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerContains(DATE_FIELD,
@@ -382,7 +383,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchLowerHeaderContains() throws Exception {
         builder.header(SUBJECT_FIELD.toLowerCase(), TEXT);
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerContains(DATE_FIELD,
                 CUSTARD), row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerContains(DATE_FIELD,
@@ -398,7 +399,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchCapsHeaderContains() throws Exception {
         builder.header(SUBJECT_FIELD.toUpperCase(), TEXT);
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerContains(DATE_FIELD,
                 CUSTARD), row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerContains(DATE_FIELD,
@@ -414,7 +415,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchHeaderExists() throws Exception {
         builder.header(SUBJECT_FIELD, TEXT);
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerExists(DATE_FIELD), row,
                 recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.headerExists(SUBJECT_FIELD),
@@ -424,7 +425,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchLowersHeaderExists() throws Exception {
         builder.header(SUBJECT_FIELD.toLowerCase(), TEXT);
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerExists(DATE_FIELD), row,
                 recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.headerExists(SUBJECT_FIELD),
@@ -434,7 +435,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchUppersHeaderExists() throws Exception {
         builder.header(SUBJECT_FIELD.toLowerCase(), TEXT);
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerExists(DATE_FIELD), row,
                 recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.headerExists(SUBJECT_FIELD),
@@ -444,7 +445,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchUidRange() throws Exception {
         builder.setKey(1, 1729);
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.uid(range(1, 1)), row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.uid(range(1728, 1728)), row,
                 recent, log));
@@ -475,7 +476,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchSeenFlagSet() throws Exception {
         builder.setFlags(true, false, false, false, false, false);
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertTrue(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.SEEN),
                 row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.FLAGGED),
@@ -493,7 +494,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchAnsweredFlagSet() throws Exception {
         builder.setFlags(false, false, true, false, false, false);
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.SEEN),
                 row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.FLAGGED),
@@ -511,7 +512,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchFlaggedFlagSet() throws Exception {
         builder.setFlags(false, true, false, false, false, false);
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.SEEN),
                 row, recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.FLAGGED),
@@ -529,7 +530,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchDraftFlagSet() throws Exception {
         builder.setFlags(false, false, false, true, false, false);
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.SEEN),
                 row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.FLAGGED),
@@ -548,7 +549,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchDeletedFlagSet() throws Exception {
         builder.setFlags(false, false, false, false, true, false);
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.SEEN),
                 row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.FLAGGED),
@@ -566,7 +567,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchSeenRecentSet() throws Exception {
         builder.setFlags(false, false, false, false, false, false);
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         recent.add(new Long(row.getUid()));
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.SEEN),
                 row, recent, log));
@@ -585,7 +586,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchSeenFlagUnSet() throws Exception {
         builder.setFlags(false, true, true, true, true, true);
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         recent.add(new Long(row.getUid()));
         assertTrue(new MessageSearches().isMatch(SearchQuery.flagIsUnSet(Flags.Flag.SEEN),
                 row, recent, log));
@@ -604,7 +605,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchAnsweredFlagUnSet() throws Exception {
         builder.setFlags(true, true, false, true, true, true);
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         recent.add(new Long(row.getUid()));
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsUnSet(Flags.Flag.SEEN),
                 row, recent, log));
@@ -623,7 +624,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchFlaggedFlagUnSet() throws Exception {
         builder.setFlags(true, false, true, true, true, true);
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         recent.add(new Long(row.getUid()));
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsUnSet(Flags.Flag.SEEN),
                 row, recent, log));
@@ -642,7 +643,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchDraftFlagUnSet() throws Exception {
         builder.setFlags(true, true, true, false, true, true);
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         recent.add(new Long(row.getUid()));
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsUnSet(Flags.Flag.SEEN),
                 row, recent, log));
@@ -661,7 +662,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchDeletedFlagUnSet() throws Exception {
         builder.setFlags(true, true, true, true, false, true);
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         recent.add(new Long(row.getUid()));
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsUnSet(Flags.Flag.SEEN),
                 row, recent, log));
@@ -680,7 +681,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchSeenRecentUnSet() throws Exception {
         builder.setFlags(true, true, true, true, true, true);
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         recent.add(new Long(row.getUid() + 1));
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsUnSet(Flags.Flag.SEEN),
                 row, recent, log));
@@ -698,13 +699,13 @@ public class SearchUtilsTest {
 
     @Test
     public void testShouldMatchAll() throws Exception {
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertTrue(new MessageSearches().isMatch(SearchQuery.all(), row, recent, log));
     }
 
     @Test
     public void testShouldMatchNot() throws Exception {
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.not(SearchQuery.all()), row,
                 recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.not(SearchQuery
@@ -713,7 +714,7 @@ public class SearchUtilsTest {
 
     @Test
     public void testShouldMatchOr() throws Exception {
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertTrue(new MessageSearches().isMatch(SearchQuery.or(SearchQuery.all(),
                 SearchQuery.headerExists(DATE_FIELD)), row, recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.or(SearchQuery
@@ -727,7 +728,7 @@ public class SearchUtilsTest {
 
     @Test
     public void testShouldMatchAnd() throws Exception {
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.and(SearchQuery.all(),
                 SearchQuery.headerExists(DATE_FIELD)), row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.and(SearchQuery
@@ -754,7 +755,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchHeaderDateOnWithOffset() throws Exception {
         builder.header(DATE_FIELD, "Mon, 26 Mar 2007 00:00:00 +0300");
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertTrue(new MessageSearches().isMatch(SearchQuery.headerDateOn(DATE_FIELD, getDate(26, 3,
                 2007), DateResolution.Day),row, recent, log));
         
@@ -768,7 +769,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchHeaderDateBeforeWithOffset() throws Exception {
         builder.header(DATE_FIELD, "Mon, 26 Mar 2007 00:00:00 +0300");
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateBefore(DATE_FIELD, getDate(26, 3,
                 2007), DateResolution.Day),row, recent, log));
         
@@ -781,7 +782,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchHeaderDateAfterWithOffset() throws Exception {
         builder.header(DATE_FIELD, "Mon, 26 Mar 2007 00:00:00 +0300");
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateAfter(DATE_FIELD, getDate(26, 3,
                 2007), DateResolution.Day),row, recent, log));
         
@@ -794,7 +795,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchAddressHeaderWithComments() throws Exception {
         builder.header("To", "<user-from (comment)@ (comment) domain.org>");
-        MailboxMessage<TestId> row = builder.build();
+        MailboxMessage row = builder.build();
         assertTrue(new MessageSearches().isMatch(SearchQuery.address(AddressType.To, "user-from@domain.org"), row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.address(AddressType.From, "user-from@domain.org"), row, recent, log));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/test/java/org/apache/james/mailbox/store/SimpleMailboxMembership.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/SimpleMailboxMembership.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/SimpleMailboxMembership.java
index 7baf0fd..a1afb98 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/SimpleMailboxMembership.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/SimpleMailboxMembership.java
@@ -39,7 +39,7 @@ import org.apache.james.mailbox.store.mail.model.DefaultMessageId;
 import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 import org.apache.james.mailbox.store.mail.model.Property;
 
-public class SimpleMailboxMembership implements MailboxMessage<TestId> {
+public class SimpleMailboxMembership implements MailboxMessage {
     
     private static final String TOSTRING_SEPARATOR = " ";
     
@@ -153,7 +153,6 @@ public class SimpleMailboxMembership implements MailboxMessage<TestId> {
         return result;
     }
 
-    @SuppressWarnings("unchecked")
     @Override
     public boolean equals(Object obj) {
         if (this == obj)
@@ -162,8 +161,8 @@ public class SimpleMailboxMembership implements MailboxMessage<TestId> {
             return false;
         if (getClass() != obj.getClass())
             return false;
-        final MailboxMessage<TestId> other = (MailboxMessage<TestId>) obj;
-        if (mailboxId.id != other.getMailboxId().id)
+        final MailboxMessage other = (MailboxMessage) obj;
+        if (!mailboxId.equals(other.getMailboxId()))
             return false;
         if (uid != other.getUid())
             return false;
@@ -246,7 +245,7 @@ public class SimpleMailboxMembership implements MailboxMessage<TestId> {
         return size;
     }
 
-    public int compareTo(MailboxMessage<TestId> other) {
+    public int compareTo(MailboxMessage other) {
         return (int) (getUid() - other.getUid());
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxManagerTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxManagerTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxManagerTest.java
index c8a9cf6..1bc2f55 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxManagerTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxManagerTest.java
@@ -19,6 +19,8 @@
 
 package org.apache.james.mailbox.store;
 
+import static org.assertj.core.api.Assertions.assertThat;
+
 import org.apache.james.mailbox.acl.SimpleGroupMembershipResolver;
 import org.apache.james.mailbox.acl.UnionMailboxACLResolver;
 import org.apache.james.mailbox.model.MailboxPath;
@@ -26,75 +28,73 @@ import org.apache.james.mailbox.store.mail.model.impl.SimpleMailbox;
 import org.junit.Before;
 import org.junit.Test;
 
-import static org.assertj.core.api.Assertions.assertThat;
-
 public class StoreMailboxManagerTest {
 
     public static final int UID_VALIDITY = 42;
-    private StoreMailboxManager<TestId> storeMailboxManager;
+    private StoreMailboxManager storeMailboxManager;
 
     @Before
     public void setUp() {
-        storeMailboxManager = new StoreMailboxManager<TestId>(null, new MockAuthenticator(), new JVMMailboxPathLocker(), new UnionMailboxACLResolver(), new SimpleGroupMembershipResolver());
+        storeMailboxManager = new StoreMailboxManager(null, new MockAuthenticator(), new JVMMailboxPathLocker(), new UnionMailboxACLResolver(), new SimpleGroupMembershipResolver());
     }
 
     @Test
     public void belongsToNamespaceAndUserShouldReturnTrueWithIdenticalMailboxes() {
         MailboxPath path = new MailboxPath("namespace", "user", "name");
-        assertThat(storeMailboxManager.belongsToNamespaceAndUser(path, new SimpleMailbox<TestId>(path, UID_VALIDITY))).isTrue();
+        assertThat(storeMailboxManager.belongsToNamespaceAndUser(path, new SimpleMailbox(path, UID_VALIDITY))).isTrue();
     }
 
     @Test
     public void belongsToNamespaceAndUserShouldReturnTrueWithIdenticalMailboxesWithNullUser() {
         MailboxPath path = new MailboxPath("namespace", null, "name");
-        assertThat(storeMailboxManager.belongsToNamespaceAndUser(path, new SimpleMailbox<TestId>(path, UID_VALIDITY))).isTrue();
+        assertThat(storeMailboxManager.belongsToNamespaceAndUser(path, new SimpleMailbox(path, UID_VALIDITY))).isTrue();
     }
 
     @Test
     public void belongsToNamespaceAndUserShouldReturnTrueWithIdenticalMailboxesWithNullNamespace() {
         MailboxPath path = new MailboxPath(null, "user", "name");
         assertThat(storeMailboxManager.belongsToNamespaceAndUser(path,
-            new SimpleMailbox<TestId>(new MailboxPath(null, "user", "name"), UID_VALIDITY))).isTrue();
+            new SimpleMailbox(new MailboxPath(null, "user", "name"), UID_VALIDITY))).isTrue();
     }
 
     @Test
     public void belongsToNamespaceAndUserShouldReturnTrueWithMailboxWithSameNamespaceAndUserWithNullUser() {
         MailboxPath path = new MailboxPath("namespace", null, "name");
         assertThat(storeMailboxManager.belongsToNamespaceAndUser(path,
-            new SimpleMailbox<TestId>(new MailboxPath("namespace", null, "name2"), UID_VALIDITY))).isTrue();
+            new SimpleMailbox(new MailboxPath("namespace", null, "name2"), UID_VALIDITY))).isTrue();
     }
 
     @Test
     public void belongsToNamespaceAndUserShouldReturnTrueWithMailboxWithSameNamespaceAndUser() {
         MailboxPath path = new MailboxPath("namespace", "user", "name");
         assertThat(storeMailboxManager.belongsToNamespaceAndUser(path,
-            new SimpleMailbox<TestId>(new MailboxPath("namespace", "user", "name2"), UID_VALIDITY))).isTrue();
+            new SimpleMailbox(new MailboxPath("namespace", "user", "name2"), UID_VALIDITY))).isTrue();
     }
 
     @Test
     public void belongsToNamespaceAndUserShouldReturnFalseWithDifferentNamespace() {
         MailboxPath path = new MailboxPath("namespace", "user", "name");
         assertThat(storeMailboxManager.belongsToNamespaceAndUser(path,
-            new SimpleMailbox<TestId>(new MailboxPath("namespace2", "user", "name"), UID_VALIDITY))).isFalse();
+            new SimpleMailbox(new MailboxPath("namespace2", "user", "name"), UID_VALIDITY))).isFalse();
     }
 
     @Test
     public void belongsToNamespaceAndUserShouldReturnFalseWithDifferentUser() {
         MailboxPath path = new MailboxPath("namespace", "user", "name");
         assertThat(storeMailboxManager.belongsToNamespaceAndUser(path,
-            new SimpleMailbox<TestId>(new MailboxPath("namespace", "user2", "name"), UID_VALIDITY))).isFalse();
+            new SimpleMailbox(new MailboxPath("namespace", "user2", "name"), UID_VALIDITY))).isFalse();
     }
     @Test
     public void belongsToNamespaceAndUserShouldReturnFalseWithOneOfTheUserNull() {
         MailboxPath path = new MailboxPath("namespace", null, "name");
         assertThat(storeMailboxManager.belongsToNamespaceAndUser(path,
-            new SimpleMailbox<TestId>(new MailboxPath("namespace", "user", "name"), UID_VALIDITY))).isFalse();
+            new SimpleMailbox(new MailboxPath("namespace", "user", "name"), UID_VALIDITY))).isFalse();
     }
     @Test
     public void belongsToNamespaceAndUserShouldReturnFalseIfNamespaceAreDifferentWithNullUser() {
         MailboxPath path = new MailboxPath("namespace", null, "name");
         assertThat(storeMailboxManager.belongsToNamespaceAndUser(path,
-            new SimpleMailbox<TestId>(new MailboxPath("namespace2", null, "name"), UID_VALIDITY))).isFalse();
+            new SimpleMailbox(new MailboxPath("namespace2", null, "name"), UID_VALIDITY))).isFalse();
     }
 
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxMessageResultIteratorTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxMessageResultIteratorTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxMessageResultIteratorTest.java
index b60e238..b49fa93 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxMessageResultIteratorTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxMessageResultIteratorTest.java
@@ -60,7 +60,7 @@ public class StoreMailboxMessageResultIteratorTest {
         }
     }
 
-    private final class TestMessageMapper implements MessageMapper<TestId> {
+    private final class TestMessageMapper implements MessageMapper {
         
 
         private final MessageRange messageRange;
@@ -80,14 +80,14 @@ public class StoreMailboxMessageResultIteratorTest {
         }
 
         @Override
-        public Iterator<MailboxMessage<TestId>> findInMailbox(Mailbox<TestId> mailbox, MessageRange set,
+        public Iterator<MailboxMessage> findInMailbox(Mailbox mailbox, MessageRange set,
                                                               org.apache.james.mailbox.store.mail.MessageMapper.FetchType type, int limit)
                 throws MailboxException {
             
             long start = set.getUidFrom();
             long end = Math.min(start + limit, set.getUidTo());
 
-            List<MailboxMessage<TestId>> messages = new ArrayList<MailboxMessage<TestId>>();
+            List<MailboxMessage> messages = new ArrayList<MailboxMessage>();
             
             for (long uid: MessageRange.range(start, end)) {
                 if (messageRange.includes(uid)) {
@@ -97,75 +97,75 @@ public class StoreMailboxMessageResultIteratorTest {
             return messages.iterator();
         }
 
-        private SimpleMailboxMessage<TestId> createMessage(long uid) {
-            SimpleMailboxMessage<TestId> message = new SimpleMailboxMessage<TestId>(null, 0, 0, new SharedByteArrayInputStream(
+        private SimpleMailboxMessage createMessage(long uid) {
+            SimpleMailboxMessage message = new SimpleMailboxMessage(null, 0, 0, new SharedByteArrayInputStream(
                     "".getBytes()), new Flags(), new PropertyBuilder(), TestId.of(1L));
             message.setUid(uid);
             return message;
         }
 
         @Override
-        public Map<Long, MessageMetaData> expungeMarkedForDeletionInMailbox(Mailbox<TestId> mailbox, MessageRange set)
+        public Map<Long, MessageMetaData> expungeMarkedForDeletionInMailbox(Mailbox mailbox, MessageRange set)
                 throws MailboxException {
             throw new UnsupportedOperationException();
 
         }
 
         @Override
-        public long countMessagesInMailbox(Mailbox<TestId> mailbox) throws MailboxException {
+        public long countMessagesInMailbox(Mailbox mailbox) throws MailboxException {
             throw new UnsupportedOperationException();
 
         }
 
         @Override
-        public long countUnseenMessagesInMailbox(Mailbox<TestId> mailbox) throws MailboxException {
+        public long countUnseenMessagesInMailbox(Mailbox mailbox) throws MailboxException {
             throw new UnsupportedOperationException();
         }
 
         @Override
-        public void delete(Mailbox<TestId> mailbox, MailboxMessage<TestId> message) throws MailboxException {
+        public void delete(Mailbox mailbox, MailboxMessage message) throws MailboxException {
             throw new UnsupportedOperationException();
         }
 
         @Override
-        public Long findFirstUnseenMessageUid(Mailbox<TestId> mailbox) throws MailboxException {
+        public Long findFirstUnseenMessageUid(Mailbox mailbox) throws MailboxException {
             throw new UnsupportedOperationException();
         }
 
         @Override
-        public List<Long> findRecentMessageUidsInMailbox(Mailbox<TestId> mailbox) throws MailboxException {
+        public List<Long> findRecentMessageUidsInMailbox(Mailbox mailbox) throws MailboxException {
             throw new UnsupportedOperationException();
 
         }
 
         @Override
-        public MessageMetaData add(Mailbox<TestId> mailbox, MailboxMessage<TestId> message) throws MailboxException {
+        public MessageMetaData add(Mailbox mailbox, MailboxMessage message) throws MailboxException {
             throw new UnsupportedOperationException();
         }
 
         @Override
-        public Iterator<UpdatedFlags> updateFlags(Mailbox<TestId> mailbox, FlagsUpdateCalculator calculator, MessageRange set) throws MailboxException {
+        public Iterator<UpdatedFlags> updateFlags(Mailbox mailbox, FlagsUpdateCalculator calculator, MessageRange set) throws MailboxException {
             throw new UnsupportedOperationException();
         }
 
         @Override
-        public MessageMetaData copy(Mailbox<TestId> mailbox, MailboxMessage<TestId> original) throws MailboxException {
+        public MessageMetaData copy(Mailbox mailbox, MailboxMessage original) throws MailboxException {
             throw new UnsupportedOperationException();
 
         }
 
         @Override
-        public long getLastUid(Mailbox<TestId> mailbox) throws MailboxException {
+        public long getLastUid(Mailbox mailbox) throws MailboxException {
             throw new UnsupportedOperationException();
         }
 
         @Override
-        public long getHighestModSeq(Mailbox<TestId> mailbox) throws MailboxException {
+        public long getHighestModSeq(Mailbox mailbox) throws MailboxException {
             throw new UnsupportedOperationException();
         }
 
         @Override
-        public MessageMetaData move(Mailbox<TestId> mailbox, MailboxMessage<TestId> original) throws MailboxException {
+        public MessageMetaData move(Mailbox mailbox, MailboxMessage original) throws MailboxException {
             throw new UnsupportedOperationException();
 
         }
@@ -175,7 +175,7 @@ public class StoreMailboxMessageResultIteratorTest {
     public void testBatching() {
         MessageRange range = MessageRange.range(1, 10);
         int batchSize = 3;
-        StoreMessageResultIterator<TestId> it = new StoreMessageResultIterator<TestId>(new TestMessageMapper(MessageRange.all()), null, range, batchSize, new TestFetchGroup());
+        StoreMessageResultIterator it = new StoreMessageResultIterator(new TestMessageMapper(MessageRange.all()), null, range, batchSize, new TestFetchGroup());
 
         assertThat(it).extracting(new Extractor<MessageResult, Long>(){
             @Override
@@ -189,7 +189,7 @@ public class StoreMailboxMessageResultIteratorTest {
     public void nextShouldReturnFirstElement() {
         MessageRange range = MessageRange.one(1);
         int batchSize = 42;
-        StoreMessageResultIterator<TestId> iterator = new StoreMessageResultIterator<TestId>(new TestMessageMapper(range), null, range, batchSize, new TestFetchGroup());
+        StoreMessageResultIterator iterator = new StoreMessageResultIterator(new TestMessageMapper(range), null, range, batchSize, new TestFetchGroup());
         assertThat(iterator.next()).isNotNull();
     }
     
@@ -198,7 +198,7 @@ public class StoreMailboxMessageResultIteratorTest {
         MessageRange messages = MessageRange.one(1);
         MessageRange findRange = MessageRange.one(2);
         int batchSize = 42;
-        StoreMessageResultIterator<TestId> iterator = new StoreMessageResultIterator<TestId>(new TestMessageMapper(messages), null, findRange, batchSize, new TestFetchGroup());
+        StoreMessageResultIterator iterator = new StoreMessageResultIterator(new TestMessageMapper(messages), null, findRange, batchSize, new TestFetchGroup());
         iterator.next();
     }
     
@@ -207,7 +207,7 @@ public class StoreMailboxMessageResultIteratorTest {
         MessageRange messages = MessageRange.one(1);
         MessageRange findRange = MessageRange.one(2);
         int batchSize = 42;
-        StoreMessageResultIterator<TestId> iterator = new StoreMessageResultIterator<TestId>(new TestMessageMapper(messages), null, findRange, batchSize, new TestFetchGroup());
+        StoreMessageResultIterator iterator = new StoreMessageResultIterator(new TestMessageMapper(messages), null, findRange, batchSize, new TestFetchGroup());
         assertThat(iterator.hasNext()).isFalse();
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/test/java/org/apache/james/mailbox/store/TestIdDeserializer.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/TestIdDeserializer.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/TestIdDeserializer.java
index 0432a39..38ee6b4 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/TestIdDeserializer.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/TestIdDeserializer.java
@@ -21,7 +21,7 @@ package org.apache.james.mailbox.store;
 
 import org.apache.james.mailbox.store.mail.model.MailboxIdDeserializer;
 
-public class TestIdDeserializer implements MailboxIdDeserializer<TestId> {
+public class TestIdDeserializer implements MailboxIdDeserializer {
 
     @Override
     public TestId deserialize(String serializedMailboxId) {

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/test/java/org/apache/james/mailbox/store/event/distributed/BroadcastDelegatingMailboxListenerIntegrationTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/event/distributed/BroadcastDelegatingMailboxListenerIntegrationTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/event/distributed/BroadcastDelegatingMailboxListenerIntegrationTest.java
index 02386c4..fde1fcf 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/event/distributed/BroadcastDelegatingMailboxListenerIntegrationTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/event/distributed/BroadcastDelegatingMailboxListenerIntegrationTest.java
@@ -21,6 +21,8 @@ package org.apache.james.mailbox.store.event.distributed;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
+import java.util.TreeMap;
+
 import org.apache.james.mailbox.MailboxListener;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.mock.MockMailboxSession;
@@ -37,8 +39,6 @@ import org.apache.james.mailbox.util.EventCollector;
 import org.junit.Before;
 import org.junit.Test;
 
-import java.util.TreeMap;
-
 /**
  Integration tests for BroadcastDelegatingMailboxListener.
 
@@ -68,20 +68,20 @@ public class BroadcastDelegatingMailboxListenerIntegrationTest {
         PublisherReceiver publisherReceiver = new PublisherReceiver();
         broadcastDelegatingMailboxListener1 = new BroadcastDelegatingMailboxListener(publisherReceiver,
             publisherReceiver,
-            new MessagePackEventSerializer<TestId>(
-                new EventConverter<TestId>(new MailboxConverter<TestId>(new TestIdDeserializer()))
+            new MessagePackEventSerializer(
+                new EventConverter(new MailboxConverter(new TestIdDeserializer()))
             ),
             TOPIC);
         broadcastDelegatingMailboxListener2 = new BroadcastDelegatingMailboxListener(publisherReceiver,
             publisherReceiver,
-            new MessagePackEventSerializer<TestId>(
-                new EventConverter<TestId>(new MailboxConverter<TestId>(new TestIdDeserializer()))
+            new MessagePackEventSerializer(
+                new EventConverter(new MailboxConverter(new TestIdDeserializer()))
             ),
             TOPIC);
         broadcastDelegatingMailboxListener3 = new BroadcastDelegatingMailboxListener(publisherReceiver,
             publisherReceiver,
-            new MessagePackEventSerializer<TestId>(
-                new EventConverter<TestId>(new MailboxConverter<TestId>(new TestIdDeserializer()))
+            new MessagePackEventSerializer(
+                new EventConverter(new MailboxConverter(new TestIdDeserializer()))
             ),
             TOPIC);
         eventCollectorMailbox1 = new EventCollector(MailboxListener.ListenerType.MAILBOX);
@@ -107,9 +107,9 @@ public class BroadcastDelegatingMailboxListenerIntegrationTest {
 
     @Test
     public void mailboxEventListenersShouldBeTriggeredIfRegistered() throws Exception {
-        SimpleMailbox<TestId> simpleMailbox = new SimpleMailbox<TestId>(MAILBOX_PATH_1, 42);
+        SimpleMailbox simpleMailbox = new SimpleMailbox(MAILBOX_PATH_1, 42);
         simpleMailbox.setMailboxId(TestId.of(52));
-        final MailboxListener.Event event = new EventFactory<TestId>().added(mailboxSession, new TreeMap<Long, MessageMetaData>(), simpleMailbox);
+        final MailboxListener.Event event = new EventFactory().added(mailboxSession, new TreeMap<Long, MessageMetaData>(), simpleMailbox);
 
         broadcastDelegatingMailboxListener1.event(event);
 
@@ -120,9 +120,9 @@ public class BroadcastDelegatingMailboxListenerIntegrationTest {
 
     @Test
     public void onceEventListenersShouldBeTriggeredOnceAcrossTheCluster() {
-        SimpleMailbox<TestId> simpleMailbox = new SimpleMailbox<TestId>(MAILBOX_PATH_1, 42);
+        SimpleMailbox simpleMailbox = new SimpleMailbox(MAILBOX_PATH_1, 42);
         simpleMailbox.setMailboxId(TestId.of(52));
-        final MailboxListener.Event event = new EventFactory<TestId>().added(mailboxSession, new TreeMap<Long, MessageMetaData>(), simpleMailbox);
+        final MailboxListener.Event event = new EventFactory().added(mailboxSession, new TreeMap<Long, MessageMetaData>(), simpleMailbox);
 
         broadcastDelegatingMailboxListener1.event(event);
 
@@ -133,9 +133,9 @@ public class BroadcastDelegatingMailboxListenerIntegrationTest {
 
     @Test
     public void eachEventListenersShouldBeTriggeredOnEachNode() {
-        SimpleMailbox<TestId> simpleMailbox = new SimpleMailbox<TestId>(MAILBOX_PATH_1, 42);
+        SimpleMailbox simpleMailbox = new SimpleMailbox(MAILBOX_PATH_1, 42);
         simpleMailbox.setMailboxId(TestId.of(52));
-        final MailboxListener.Event event = new EventFactory<TestId>().added(mailboxSession, new TreeMap<Long, MessageMetaData>(), simpleMailbox);
+        final MailboxListener.Event event = new EventFactory().added(mailboxSession, new TreeMap<Long, MessageMetaData>(), simpleMailbox);
 
         broadcastDelegatingMailboxListener1.event(event);
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/test/java/org/apache/james/mailbox/store/json/EventSerializerTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/json/EventSerializerTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/json/EventSerializerTest.java
index 8e5162e..bab3d60 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/json/EventSerializerTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/json/EventSerializerTest.java
@@ -21,7 +21,10 @@ package org.apache.james.mailbox.store.json;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
-import com.google.common.collect.Lists;
+import java.util.TreeMap;
+
+import javax.mail.Flags;
+
 import org.apache.james.mailbox.MailboxListener;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.mock.MockMailboxSession;
@@ -36,8 +39,7 @@ import org.apache.james.mailbox.store.mail.model.impl.SimpleMailbox;
 import org.junit.Before;
 import org.junit.Test;
 
-import javax.mail.Flags;
-import java.util.TreeMap;
+import com.google.common.collect.Lists;
 
 public abstract class EventSerializerTest {
 
@@ -49,18 +51,18 @@ public abstract class EventSerializerTest {
     public static final SimpleMessageMetaData MESSAGE_META_DATA = new SimpleMessageMetaData(UID, MOD_SEQ, FLAGS, SIZE, null);
     public static final MailboxPath FROM = new MailboxPath("namespace", "user", "name");
     private EventSerializer serializer;
-    private EventFactory<TestId> eventFactory;
+    private EventFactory eventFactory;
     private MailboxSession mailboxSession;
-    private SimpleMailbox<TestId> mailbox;
+    private SimpleMailbox mailbox;
 
     abstract EventSerializer createSerializer();
 
     @Before
     public void setUp() {
-        eventFactory = new EventFactory<TestId>();
+        eventFactory = new EventFactory();
         serializer = createSerializer();
         mailboxSession = new MockMailboxSession("benwa");
-        mailbox = new SimpleMailbox<TestId>(new MailboxPath("#private", "benwa", "name"), 42);
+        mailbox = new SimpleMailbox(new MailboxPath("#private", "benwa", "name"), 42);
         mailbox.setMailboxId(TestId.of(28L));
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/test/java/org/apache/james/mailbox/store/json/JsonEventSerializerTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/json/JsonEventSerializerTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/json/JsonEventSerializerTest.java
index 2a8abca..a0c37be 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/json/JsonEventSerializerTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/json/JsonEventSerializerTest.java
@@ -19,7 +19,6 @@
 
 package org.apache.james.mailbox.store.json;
 
-import org.apache.james.mailbox.store.TestId;
 import org.apache.james.mailbox.store.TestIdDeserializer;
 import org.apache.james.mailbox.store.event.EventSerializer;
 import org.apache.james.mailbox.store.json.event.EventConverter;
@@ -29,8 +28,8 @@ public class JsonEventSerializerTest extends EventSerializerTest {
 
     @Override
     EventSerializer createSerializer() {
-        return new JsonEventSerializer<TestId>(
-            new EventConverter<TestId>(
-                new MailboxConverter<TestId>(new TestIdDeserializer())));
+        return new JsonEventSerializer(
+            new EventConverter(
+                new MailboxConverter(new TestIdDeserializer())));
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/test/java/org/apache/james/mailbox/store/json/MailboxMessagePackEventSerializerTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/json/MailboxMessagePackEventSerializerTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/json/MailboxMessagePackEventSerializerTest.java
index 5c8726d..cfcc378 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/json/MailboxMessagePackEventSerializerTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/json/MailboxMessagePackEventSerializerTest.java
@@ -19,7 +19,6 @@
 
 package org.apache.james.mailbox.store.json;
 
-import org.apache.james.mailbox.store.TestId;
 import org.apache.james.mailbox.store.TestIdDeserializer;
 import org.apache.james.mailbox.store.event.EventSerializer;
 import org.apache.james.mailbox.store.json.event.EventConverter;
@@ -29,8 +28,8 @@ public class MailboxMessagePackEventSerializerTest extends EventSerializerTest {
 
     @Override
     EventSerializer createSerializer() {
-        return new MessagePackEventSerializer<TestId>(
-            new EventConverter<TestId>(
-                new MailboxConverter<TestId>(new TestIdDeserializer())));
+        return new MessagePackEventSerializer(
+            new EventConverter(
+                new MailboxConverter(new TestIdDeserializer())));
     }
 }


---------------------------------------------------------------------
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