@Override
 public int getMessageCount(CompilerMessageCategory category) {
   if (category != null) {
     Collection<CompilerMessage> collection = myMessages.get(category);
     return collection != null ? collection.size() : 0;
   }
   int count = 0;
   for (Collection<CompilerMessage> collection : myMessages.values()) {
     if (collection != null) {
       count += collection.size();
     }
   }
   return count;
 }
 @Override
 public CompilerMessage[] getMessages(CompilerMessageCategory category) {
   Collection<CompilerMessage> collection = myMessages.get(category);
   if (collection == null) {
     return CompilerMessage.EMPTY_ARRAY;
   }
   return collection.toArray(new CompilerMessage[collection.size()]);
 }