### Question:
SifIdResolverCustomData implements SifIdResolver { @Override public String getSliGuidByType(String sifId, String sliType, String zoneId) { synchronized (lock) { Entity entity = getSliEntityFromOtherSifId(sifId, sliType, zoneId); if (entity == null) { return null; } return entity.getId(); } }  @Override String getSliGuid(String sifId, String zoneId); @Override List<String> getSliGuidList(String sifId, String zoneId); @Override String getSliGuidByType(String sifId, String sliType, String zoneId); @Override List<String> getSliGuidListByType(String sifId, String sliType, String zoneId); @Override Entity getSliEntityByType(String sifId, String sliType, String zoneId); @Override List<Entity> getSliEntityListByType(String sifId, String sliType, String zoneId); @Override Entity getSliEntity(String sifId, String zoneId); @Override List<Entity> getSliEntityList(String sifId, String zoneId); @Override String getZoneSea(String zoneId); @Override void putSliGuid(String sifId, String sliType, String sliId, String zoneId); @Override Entity getSliEntityFromOtherSifId(String sifId, String sliType, String zoneId); @Override void putSliGuidForOtherSifId(String sifId, String sliType, String sliId, String zoneId);  }### Answer:
@Test public void getSliGuidByTypeShouldLookupSliGuid() throws Exception { setupCustomDataMocking(); Entity entity = Mockito.mock(Entity.class); when(entity.getId()).thenReturn(SLI_ID4); List<Entity> queryResult = Arrays.asList(new Entity[] { entity }); when(mockSlcInterface.read(eq(SLI_TYPE4), any(Query.class))).thenReturn(queryResult); String result = resolver.getSliGuidByType(SIF_REF_ID4, SLI_TYPE4, ZONE_ID1); assertEquals(SLI_ID4, result); }
@Test public void getSliGuidByTypeShouldHandleNull() throws Exception { setupCustomDataMocking(); Entity entity = Mockito.mock(Entity.class); when(entity.getId()).thenReturn(SLI_ID4); List<Entity> queryResult = Arrays.asList(new Entity[] {}); when(mockSlcInterface.read(eq(SLI_TYPE4), any(Query.class))).thenReturn(queryResult); String result = resolver.getSliGuidByType(SIF_REF_ID4, SLI_TYPE4, ZONE_ID1); Assert.assertNull(result); }