if (attribute.getSequence() == null) {
   throw new MetadataException("Invalid value for Attribute sequence: "
    				+ attribute.getSequence());
}

boolean minValueForSequence = attribute.getSequence() < MINIMUM_VALUE_FOR_THE_ATTRIBUTE_SEQUENCE;
boolean maxValueForSequence = currentNumberOfAttributes < attribute
	.getSequence();
if (!(minValueForSequence || maxValueForSequence)) {
	return;
}