src/org/ohmage/domain/campaign/SurveyResponse.java
public final void filterPromptResponseByPromptIds(
			final Collection<String> promptIds) 
			throws DomainException {
		
		if(promptIds == null || promptIds.isEmpty()) {
			throw new DomainException("a list of prompt ids is required");
		}
		
		if(responses != null) {
			Iterator<Integer> responsesKeySetIterator = responses.keySet().iterator();
			while(responsesKeySetIterator.hasNext()) {
				Response response = responses.get(responsesKeySetIterator.next());
				
				if(! promptIds.contains(response.getId())) {
					responsesKeySetIterator.remove();
				}
			}
		} 
		else {
			LOGGER.warn("attempt to filter prompt responses out of a SurveyResponse that has no prompt responses.");
		}
	}
/**
	 * Removes the any prompt responses that do not belong to the provided 
	 * collection of prompt ids from this survey response.
	 * 
	 * @param promptIds  A collection of prompt ids belonging to some campaign. 
	 * 
	 * @throws DomainException if promptIds is null or empty.
	 */
Removes the any prompt responses that do not belong to the provided
collection of prompt ids from this survey response.

@param promptIds  A collection of prompt ids belonging to some campaign.

@throws DomainException if promptIds is null or empty.
Removes the any prompt responses that do not belong to the provided collection of prompt ids from this survey response . @param promptIds A collection of prompt ids belonging to some campaign . @throws DomainException if promptIds is null or empty .
public final void filterPromptResponseByPromptIds(
			final Collection<String> promptIds) 
			throws DomainException {
		if(promptIds == null || promptIds.isEmpty()) {
			throw new DomainException("a list of prompt ids is required");
		}
		if(responses != null) {
			Iterator<Integer> responsesKeySetIterator = responses.keySet().iterator();
			while(responsesKeySetIterator.hasNext()) {
				Response response = responses.get(responsesKeySetIterator.next());
				if(! promptIds.contains(response.getId())) {
					responsesKeySetIterator.remove();
				}
			}
		} 
		else {
			LOGGER.warn("attempt to filter prompt responses out of a SurveyResponse that has no prompt responses.");
		}
	}
public final void filterPromptResponseByPromptIds ( final Collection < String > promptIds ) throws DomainException { if ( promptIds == null || promptIds . isEmpty ( ) ) { throw new DomainException ( "a list of prompt ids is required" ) ; } if ( responses != null ) { Iterator < Integer > responsesKeySetIterator = responses . keySet ( ) . iterator ( ) ; while ( responsesKeySetIterator . hasNext ( ) ) { Response response = responses . get ( responsesKeySetIterator . next ( ) ) ; if ( ! promptIds . contains ( response . getId ( ) ) ) { responsesKeySetIterator . remove ( ) ; } } } else { LOGGER . warn ( "attempt to filter prompt responses out of a SurveyResponse that has no prompt responses." ) ; } }
Removes the any prompt responses that do not belong to the provided
 collection of prompt ids from this survey response.
Removes the any prompt responses that do not belong to the provided collection of prompt ids from this survey response .