### Question:
UZUtil { public static void initWorkspace(Context context, String domainApi, String token, String appId) { if (context == null) { throw new NullPointerException("Error: Context cannot be null"); } if (domainApi == null || domainApi.isEmpty()) { throw new NullPointerException("Domain api cannot be null or empty"); } if (token == null || token.isEmpty()) { throw new NullPointerException("Token cannot be null or empty"); } if (appId == null || appId.isEmpty()) { throw new NullPointerException("App id be null or empty"); } Utils.init(context.getApplicationContext()); UZRestClient.init(Constants.PREFIXS + domainApi, token); }  static void initWorkspace(Context context, String domainApi, String token, String appId);  }### Answer:
@Test public void initWorkspace_correct() { Context context = Mockito.mock(Context.class); Mockito.when(context.getApplicationContext()).thenReturn(context); UZUtil.initWorkspace(context, domainApi, token, appId); PowerMockito.verifyStatic(Utils.class, times(1)); Utils.init(context); PowerMockito.verifyStatic(UZRestClient.class, times(1)); UZRestClient.init(Constants.PREFIXS + domainApi, token); }
@Test(expected = NullPointerException.class) public void initWorkspace_withNullContext_error() { UZUtil.initWorkspace(null, domainApi, token, appId); }
@Test(expected = NullPointerException.class) public void initWorkspace_withNullDomain_error() { Context context = Mockito.mock(Context.class); Mockito.when(context.getApplicationContext()).thenReturn(context); UZUtil.initWorkspace(context, null, token, appId); }
@Test(expected = NullPointerException.class) public void initWorkspace_withNullToken_error() { Context context = Mockito.mock(Context.class); Mockito.when(context.getApplicationContext()).thenReturn(context); UZUtil.initWorkspace(context, domainApi, null, appId); }
@Test(expected = NullPointerException.class) public void initWorkspace_withNullAppId_error() { Context context = Mockito.mock(Context.class); Mockito.when(context.getApplicationContext()).thenReturn(context); UZUtil.initWorkspace(context, domainApi, token, null); }