### Question:
MessageKeyVerifier implements IMessageKeyVerifier { public List<Cal10nError> verify(Locale locale) { List<Cal10nError> errorList = new ArrayList<Cal10nError>(); String baseName = AnnotationExtractor.getBaseName(enumType); if (baseName == null) { errorList.add(new Cal10nError(ErrorType.MISSING_BN_ANNOTATION, "", enumType, locale, "")); return errorList; } String charset = AnnotationExtractor.getCharset(enumType, Locale.FRENCH); ResourceBundle rb = CAL10NResourceBundleFinder.getBundle(this.getClass() .getClassLoader(), baseName, locale, charset); ErrorFactory errorFactory = new ErrorFactory(enumType, locale, baseName); if (rb == null) { errorList.add(errorFactory.buildError(ErrorType.FAILED_TO_FIND_RB, "")); return errorList; } Set<String> rbKeySet = buildKeySetFromEnumeration(rb.getKeys()); if (rbKeySet.size() == 0) { errorList.add(errorFactory.buildError(ErrorType.EMPTY_RB, "")); } Enum<?>[] enumArray = enumType.getEnumConstants(); if (enumArray == null || enumArray.length == 0) { errorList.add(errorFactory.buildError(ErrorType.EMPTY_ENUM, "")); } if (errorList.size() != 0) { return errorList; } for (Enum<?> e : enumArray) { String enumKey = e.toString(); if (rbKeySet.contains(enumKey)) { rbKeySet.remove(enumKey); } else { errorList.add(errorFactory.buildError(ErrorType.ABSENT_IN_RB, enumKey)); } } for (String rbKey : rbKeySet) { errorList.add(errorFactory.buildError(ErrorType.ABSENT_IN_ENUM, rbKey)); } return errorList; } MessageKeyVerifier(Class<? extends Enum<?>> enumClass); @SuppressWarnings("unchecked")  MessageKeyVerifier(String enumTypeAsStr); Class<? extends Enum<?>> getEnumType(); String getEnumTypeAsStr(); List<Cal10nError> verify(Locale locale); List<String> typeIsolatedVerify(Locale locale); List<Cal10nError> verifyAllLocales(); String[] getLocaleNames(); String getBaseName();  }### Answer:
@Test public void smoke() { IMessageKeyVerifier miv = new MessageKeyVerifier(Colors.class); List<Cal10nError> errorList = miv.verify(Locale.UK); assertEquals(0, errorList.size()); }
@Test public void withErrors_UK() { IMessageKeyVerifier miv = new MessageKeyVerifier(Countries.class); List<Cal10nError> errorList = miv.verify(Locale.UK); assertEquals(2, errorList.size()); assertEquals("CH", errorList.get(0).getKey()); assertEquals("BR", errorList.get(1).getKey()); }
@Test public void withErrors_FR() { IMessageKeyVerifier miv = new MessageKeyVerifier(Countries.class); List<Cal10nError> errorList = miv.verify(Locale.FRANCE); assertEquals(3, errorList.size()); assertEquals("CH", errorList.get(0).getKey()); assertEquals("CN", errorList.get(1).getKey()); assertEquals("BR", errorList.get(2).getKey()); }