TranslationCache { public <T> T getTranslation(Object source, Class<T> destination) { Map<Class<?>, Object> translations = cache.get(source); if (translations != null && translations.containsKey(destination)) { return destination.cast(translations.get(destination)); } else { return null; } } TranslationCache(); T getTranslation(Object source, Class<T> destination); void putTranslation(Object source, Object translation);  }
@Test public void testNewCacheDoesNotContainTranslations() { TranslationCache cache = new TranslationCache(); cache.getTranslation("One", Integer.class); }