private CIMInstance isRegisteredProfileValid(Iterator<CIMInstance> profileinstances){
  CIMInstance profileInstance=null;
  while (profileinstances.hasNext()) {
    profileInstance=profileinstances.next();
    String registeredName=getCIMPropertyValue(profileInstance,REGISTEREDNAME);
    String registeredVersion=getCIMPropertyValue(profileInstance,REGISTEREDVERSION);
    String registeredOrganization=getCIMPropertyValue(profileInstance,REGISTEREDORGANIZATION);
    if (registeredName.contains(ARRAY) && registeredOrganization.equalsIgnoreCase(ELEVEN)) {
      if (highestVersion.isEmpty()) {
        highestVersionRegProfile=profileInstance;
        highestVersion=registeredVersion;
      }
 else       if (compareVersions(registeredVersion,highestVersion) > 0) {
        highestVersionRegProfile=profileInstance;
        highestVersion=registeredVersion;
      }
    }
  }
  return highestVersionRegProfile;
}

private CIMInstance isRegisteredProfileValid ( Iterator < CIMInstance > profileinstances ) { CIMInstance profileInstance = null ; while ( profileinstances . hasNext ( ) ) { profileInstance = profileinstances . next ( ) ; String registeredName = getCIMPropertyValue ( profileInstance , REGISTEREDNAME ) ; String registeredVersion = getCIMPropertyValue ( profileInstance , REGISTEREDVERSION ) ; String registeredOrganization = getCIMPropertyValue ( profileInstance , REGISTEREDORGANIZATION ) ; if ( registeredName . contains ( ARRAY ) && registeredOrganization . equalsIgnoreCase ( ELEVEN ) ) { if ( highestVersion . isEmpty ( ) ) { highestVersionRegProfile = profileInstance ; highestVersion = registeredVersion ; } else if ( compareVersions ( registeredVersion , highestVersion ) > 0 ) { highestVersionRegProfile = profileInstance ; highestVersion = registeredVersion ; } } } return highestVersionRegProfile ; }
is registered profile valid .
