NumberFormatException solved.
Changed types for RecordIdentifiers and RelatedItems to List (from Set).