### Question:
ProjectRestService extends RestEntityServiceBase { @PostConstruct public void init() { setEntityService(projectService); }  @PostConstruct void init(); @GET @Path("/") @Produces(MediaType.APPLICATION_JSON) @Override @PermitAll @AuditIgnore Object getAll(@QueryParam("from") Integer from, @QueryParam("size") Integer size); @GET @Path("/{id}") @Produces(MediaType.APPLICATION_JSON) @Override @PermitAll @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); @GET @Path("/search") @Produces(MediaType.APPLICATION_JSON) @AuditIgnore Object search(@Context UriInfo uriInfo); static final String PARAM_CODE; }### Answer:
@Test public void init() { ProjectRestService tested = new ProjectRestService(); Assert.assertNull(tested.entityService); tested.projectService = Mockito.mock(ProjectService.class); Assert.assertNull(tested.entityService); tested.init(); Assert.assertEquals(tested.projectService, tested.entityService); }