Provider { public boolean hasSameOrigin(Provider otherProvider) { if (otherProvider != null) { if (otherProvider.url != null && !otherProvider.url.isEmpty()) { return url.equals(otherProvider.url) && (Objects.equals(servicePath, otherProvider.servicePath)) && (Objects.equals(serviceName, otherProvider.serviceName)); } } return false; } Provider(String url);  Provider(); String getUrl(); void setUrl(String url); Instant getSubscriptionDate(); void setSubscriptionDate(Instant subscriptionDate); String getSubscriptionId(); void setSubscriptionId(String subscriptionId); String getServiceName(); void setServiceName(String serviceName); String getServicePath(); void setServicePath(String servicePath); boolean hasSameOrigin(Provider otherProvider);  }
@Test public void testHasObjectNull() { Provider provider = new Provider(); Provider pr = null; boolean checkTest = provider.hasSameOrigin(pr); assertFalse(checkTest); }