title: How to set the value in this mock object
body: <p>How to set the value in mock object below.
  I know how to get the value but how do set the value using mock?</p>
  
  <pre><code>    public class AUTest
      {
  
      Set&lt;String&gt; permissionIds = new HashSet&lt;String&gt;();
  
      @Mock 
      UserService userservice;
  
      @Mock
      PermissionService permissionservice;
  
      Set&lt;String&gt; emailid = new HashSet&lt;String&gt;();
  
  
      @Test
      public void getSuperUserPermissions()
      {
          List&lt;Permissions&gt; allPermissions = permissionservice.getAllPermissions();
          PermissionService permission = Mockito.mock(PermissionService.class);
          Mockito.when(permission.getPermissionById(5L)).thenReturn(pemission);
          Assert.assertNotNull(allPermissions);
      }
  
  }
  </code></pre>