code: public static ICC_Profile validateProfile(final ICC_Profile profile) {
          // Fix profile before validation
          profileCleaner.fixProfile(profile);
          validateColorSpace(new ICC_ColorSpace(profile));
  
          return profile;
      }
docs: Tests whether an ICC color profile is valid.
  Invalid profiles are known to cause problems for {@link java.awt.image.ColorConvertOp}.
  <p />
  <em>
  Note that this method only tests if a color conversion using this profile is known to fail.
  There's no guarantee that the color conversion will succeed even if this method returns {@code false}.
  </em>
  
  @param profile the ICC color profile. May not be {@code null}.
  @return {@code profile} if valid.
  @throws IllegalArgumentException if {@code profile} is {@code null}
  @throws java.awt.color.CMMException if {@code profile} is invalid.