public static void validate(
      FederationPolicyInitializationContext policyContext, String myType)
      throws FederationPolicyInitializationException {

    if (myType == null) {
      throw new FederationPolicyInitializationException(
          "The myType parameter" + " should not be null.");
    }

    if (policyContext == null) {
      throw new FederationPolicyInitializationException(
          "The FederationPolicyInitializationContext provided is null. Cannot"
              + " reinitialize " + "successfully.");
    }

    if (policyContext.getFederationStateStoreFacade() == null) {
      throw new FederationPolicyInitializationException(
          "The FederationStateStoreFacade provided is null. Cannot"
              + " reinitialize successfully.");
    }

    if (policyContext.getFederationSubclusterResolver() == null) {
      throw new FederationPolicyInitializationException(
          "The FederationSubclusterResolver provided is null. Cannot"
              + " reinitialize successfully.");
    }

    if (policyContext.getSubClusterPolicyConfiguration() == null) {
      throw new FederationPolicyInitializationException(
          "The SubClusterPolicyConfiguration provided is null. Cannot "
              + "reinitialize successfully.");
    }

    String intendedType =
        policyContext.getSubClusterPolicyConfiguration().getType();

    if (!myType.equals(intendedType)) {
      throw new FederationPolicyInitializationException(
          "The FederationPolicyConfiguration carries a type (" + intendedType
              + ") different then mine (" + myType
              + "). Cannot reinitialize successfully.");
    }

  }
@Test(expected = FederationPolicyInitializationException.class)
  public void nullType() throws Exception {
    FederationPolicyInitializationContextValidator.validate(context, null);
  }