### Question:
SubjectInfoResolver implements Function<UUID, SubjectInfoSEB> { @Override public SubjectInfoSEB apply(UUID id) { if (id == null) return null; Subject subject = subjectResolver.resolveSubject(id); if (subject == null) return null; return SubjectInfoSEB.builder() .setId(subject.getId()) .setName(subject.getName()) .build(); } @Inject  SubjectInfoResolver(SubjectResolver subjectResolver); @Override SubjectInfoSEB apply(UUID id);  }### Answer:
@Test public void testResolveNull() { assertNull(resolver.apply(null)); }
@Test public void testResolveNoSubjectFound() { UUID id = UUID.randomUUID(); assertNull(resolver.apply(id)); verify(subjectResolver).resolveSubject(id); }
@Test public void testResolveSubjectFound() { Subject model = Subject.builder() .setId(UUID.randomUUID()) .setName("name") .build(); when(subjectResolver.resolveSubject(isA(UUID.class))).thenReturn(model); SubjectInfoSEB seb = resolver.apply(model.getId()); assertNotNull(seb); assertEquals(model.getId(), seb.getId()); assertEquals(model.getName(), seb.getName()); verify(subjectResolver).resolveSubject(model.getId()); }