### Question:
ProviderRestService extends RestEntityServiceBase { @PostConstruct public void init() { setEntityService(providerService); }  @PostConstruct void init(); @GET @Path("/") @Produces(MediaType.APPLICATION_JSON) @AuditIgnore Object getAll(@QueryParam("from") Integer from, @QueryParam("size") Integer size); @GET @Path("/{id}") @Produces(MediaType.APPLICATION_JSON) @RolesAllowed({ Role.ADMIN, Role.PROVIDER }) @Override @AuditIgnore Object get(@PathParam("id") String id); @POST @Path("/") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Object create(@AuditContent Map<String, Object> data); @POST @Path("/{id}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Object create(@PathParam("id") @AuditId String id, @AuditContent Map<String, Object> data); @POST @Path("/{id}/password") @RolesAllowed({ Role.ADMIN, Role.PROVIDER }) Object changePassword(@PathParam("id") @AuditId String id, String pwd); @POST @Path("/{id}/content_manipulation_lock") @RolesAllowed({ Role.ADMIN, Role.PROVIDER }) Object contentManipulationLockCreate(@PathParam("id") @AuditId String id); @DELETE @Path("/{id}/content_manipulation_lock") @RolesAllowed({ Role.ADMIN, Role.PROVIDER }) Object contentManipulationLockDelete(@PathParam("id") @AuditId String id); @GET @Path("/{id}/content_manipulation_lock") @RolesAllowed({ Role.ADMIN, Role.PROVIDER }) @Produces(MediaType.APPLICATION_JSON) Map<String, Object> contentManipulationLockInfo(@PathParam("id") @AuditId String id);  }### Answer:
@Test public void init() { ProviderRestService tested = new ProviderRestService(); tested.log = Logger.getLogger("testlogger"); Assert.assertNull(tested.entityService); tested.providerService = Mockito.mock(ProviderService.class); Assert.assertNull(tested.entityService); tested.init(); }