### Question:
ContactsServiceImpl implements ContactsService { @Override public Response findContactsById(UUID id, HttpHeaders headers) { LOGGER.info("FIND CONTACTS BY ID: " + id); Contacts contacts = contactsRepository.findById(id); if (contacts != null) { return new Response<>(1, success, contacts); } else { return new Response<>(0, "No contacts according to contacts id", null); } }  @Override Response findContactsById(UUID id, HttpHeaders headers); @Override Response findContactsByAccountId(UUID accountId, HttpHeaders headers); @Override Response createContacts(Contacts contacts, HttpHeaders headers); @Override Response create(Contacts addContacts, HttpHeaders headers); @Override Response delete(UUID contactsId, HttpHeaders headers); @Override Response modify(Contacts contacts, HttpHeaders headers); @Override Response getAllContacts(HttpHeaders headers);  }### Answer:
@Test public void testFindContactsById1() { UUID id = UUID.randomUUID(); Contacts contacts = new Contacts(); Mockito.when(contactsRepository.findById(Mockito.any(UUID.class))).thenReturn(contacts); Response result = contactsServiceImpl.findContactsById(id, headers); Assert.assertEquals(new Response<>(1, "Success", contacts), result); }
@Test public void testFindContactsById2() { UUID id = UUID.randomUUID(); Mockito.when(contactsRepository.findById(Mockito.any(UUID.class))).thenReturn(null); Response result = contactsServiceImpl.findContactsById(id, headers); Assert.assertEquals(new Response<>(0, "No contacts according to contacts id", null), result); }