### Question:
SifTranslationManager { public List<SliEntity> translate(SIFDataObject sifData, String zoneId) { List<SliEntity> entities = new ArrayList<SliEntity>(); List<TranslationTask> translationTasks = translationMap.get(sifData.getObjectType().toString()); if (translationTasks == null) { LOG.error("No TranslationTask found for sif type: " + sifData.getObjectType()); return entities; } for (TranslationTask translationTask : translationTasks) { try { entities.addAll(translationTask.translate(sifData, zoneId)); } catch (SifTranslationException e) { LOG.error("Sif translation exception: ", e); } } return entities; }  void setTranslationMap(Map<String, List<TranslationTask>> translationMap); List<SliEntity> translate(SIFDataObject sifData, String zoneId);  }### Answer:
@Test public void shouldCreateOneToOneTranslatedEntities() { List<SliEntity> sliEntities = sifTranslationManager.translate(sifB, "zoneId"); Assert.assertEquals("Should translate to one sli entity", 1, sliEntities.size()); Assert.assertEquals("First translated entity not of correct", sliZ, sliEntities.get(0)); }
@Test public void shouldCreateOneToManyTranslatedEntities() { List<SliEntity> sliEntities = sifTranslationManager.translate(sifA, "zoneId"); Assert.assertEquals("Should translate to two sli entities", 2, sliEntities.size()); Assert.assertEquals("First translated entity not of correct", sliX, sliEntities.get(0)); Assert.assertEquals("First translated entity not of correct", sliY, sliEntities.get(1)); }
@Test public void shouldHandleSifTranslationExceptions() throws SifTranslationException { Mockito.when(mockTranslationBtoZ.translate(Mockito.eq(sifB), Mockito.anyString())).thenThrow( new SifTranslationException("test throw")); sifTranslationManager.translate(sifA, "zoneId"); }