← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19421: Changed from using Collection to List as return type in dhis-service-tracker.

 

------------------------------------------------------------
revno: 19421
committer: Tran Chau<tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-06-16 20:17:59 +0700
message:
  Changed from using Collection to List as return type in dhis-service-tracker.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramIndicatorService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstanceService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstanceStore.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElementService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceStore.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStore.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramValidationService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramValidationStore.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/programrule/ProgramRuleActionService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/programrule/ProgramRuleActionStore.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/programrule/ProgramRuleService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/programrule/ProgramRuleStore.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/programrule/ProgramRuleVariableService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/programrule/ProgramRuleVariableStore.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/relationship/RelationshipService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/relationship/RelationshipStore.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/relationship/RelationshipTypeService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeGroupService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeStore.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAuditService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAuditStore.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityFormService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentityattributevalue/TrackedEntityAttributeValueService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentityattributevalue/TrackedEntityAttributeValueStore.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueStore.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramDataEntryService.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramIndicatorService.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramService.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramStageDataElementService.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramValidationService.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramInstanceStore.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStore.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramValidationStore.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/programrule/DefaultProgramRuleActionService.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/programrule/DefaultProgramRuleService.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/programrule/DefaultProgramRuleVariableService.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/programrule/hibernate/HibernateProgramRuleActionStore.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/programrule/hibernate/HibernateProgramRuleStore.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/programrule/hibernate/HibernateProgramRuleVariableStore.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/relationship/DefaultRelationshipService.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/relationship/DefaultRelationshipTypeService.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/relationship/hibernate/HibernateRelationshipStore.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAttributeGroupService.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAttributeService.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAuditService.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityFormService.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityService.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityAttributeStore.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityAuditStore.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentityattributevalue/DefaultTrackedEntityAttributeValueService.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentityattributevalue/hibernate/HibernateTrackedEntityAttributeValueStore.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentitydatavalue/DefaultTrackedEntityDataValueService.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentitydatavalue/hibernate/HibernateTrackedEntityDataValueStore.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramInstanceServiceTest.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramInstanceStoreTest.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramServiceTest.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramStageInstanceServiceTest.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramStageInstanceStoreTest.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramStoreTest.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramValidationServiceTest.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/programrule/ProgramRuleActionServiceTest.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/programrule/ProgramRuleActionStoreTest.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/programrule/ProgramRuleServiceTest.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/programrule/ProgramRuleStoreTest.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/programrule/ProgramRuleVariableServiceTest.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/programrule/ProgramRuleVariableStoreTest.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/relationship/RelationshipServiceTest.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/relationship/RelationshipStoreTest.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeServiceTest.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeStoreTest.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAuditServiceTest.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAuditStoreTest.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityFormServiceTest.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentityattributevalue/TrackedEntityAttributeValueServiceTest.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentityattributevalue/TrackedEntityAttributeValueStoreTest.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueServiceTest.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueStoreTest.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetAllProgramsAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetProgramsByOrgunitAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadProgramStageInstanceAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/MultiDataEntrySelectAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ShowEventWithRegistrationFormAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ValidateProgramInstanceAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/GetProgramTrackingListAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetAttributesByProgramAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetVisitScheduleAttributesAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ProgramEnrollmentAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ProgramEnrollmentSelectAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SelectAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowActivityPlanFormAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddRelationshipFormAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddRepresentativeAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddTrackedEntityInstanceFormAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/TrackedEntityInstanceDashboardAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetAggPSDataElementsAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetDataElementsByDataSetAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/ShowAddCaseAggregationConditionFormAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/ShowUpdateCaseAggregationConditionFormAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/dataentryform/GetTrackedEntityFormListAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/dataentryform/ViewDataEntryFormAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/dataentryform/ViewTrackedEntityFormAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/GetProgramAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/GetProgramListAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/ShowAddProgramFormAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/ShowUpdateProgramFormAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programrule/GetProgramRuleListAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programrule/ShowAddProgramRuleFormAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/GetProgramStageAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/ShowAddProgramStageAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/ShowAddProgramStageFormAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/relationship/GetRelationshipTypeListAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentity/GetTrackedEntityListAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentity/ShowAddUpdateTrackedEntityAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/GetAttributeListAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/ShowAddUpdateAttributeAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/ShowAttributeInListNoProgramAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/ShowAttributeVisitScheduleFormAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattributegroup/GetAttributeGroupAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattributegroup/GetAttributeGroupListAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityinstancereminder/GetInstanceReminderAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityinstancereminder/ShowAddProgramReminderAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityinstancereminder/ShowAddProgramStageReminderAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/validation/GetValidationCriteriaListAction.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramIndicatorService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramIndicatorService.java	2015-06-02 22:11:37 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramIndicatorService.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
@@ -97,10 +97,10 @@
     /**
      * Returns all {@link ProgramIndicator}.
      *
-     * @return a collection of all ProgramIndicator, or an empty collection if
+     * @return a List of all ProgramIndicator, or an empty List if
      * there are no ProgramIndicators.
      */
-    Collection<ProgramIndicator> getAllProgramIndicators();
+    List<ProgramIndicator> getAllProgramIndicators();
 
     /**
      * Calculate a program indicator value based on program stage instance and an

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstanceService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstanceService.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstanceService.java	2015-06-16 13:17:59 +0000
@@ -89,7 +89,7 @@
      * @param program Program
      * @return ProgramInstance list
      */
-    Collection<ProgramInstance> getProgramInstances( Program program );
+    List<ProgramInstance> getProgramInstances( Program program );
 
     /**
      * Retrieve program instances on program list
@@ -97,7 +97,7 @@
      * @param programs Program list
      * @return ProgramInstance list
      */
-    Collection<ProgramInstance> getProgramInstances( Collection<Program> programs );
+    List<ProgramInstance> getProgramInstances( Collection<Program> programs );
 
     /**
      * Retrieve program instances of whom registered in to a orgunit from
@@ -107,7 +107,7 @@
      * @param organisationUnit Organisation Unit
      * @return ProgramInstance list
      */
-    Collection<ProgramInstance> getProgramInstances( Collection<Program> programs, OrganisationUnit organisationUnit );
+    List<ProgramInstance> getProgramInstances( Collection<Program> programs, OrganisationUnit organisationUnit );
 
     /**
      * Retrieve program instances of whom registered in to a orgunit from
@@ -119,7 +119,7 @@
      *                         STATUS_COMPLETED and STATUS_CANCELLED
      * @return ProgramInstance list
      */
-    Collection<ProgramInstance> getProgramInstances( Collection<Program> programs, OrganisationUnit organisationUnit,
+    List<ProgramInstance> getProgramInstances( Collection<Program> programs, OrganisationUnit organisationUnit,
         int status );
 
     /**
@@ -130,7 +130,7 @@
      *                STATUS_COMPLETED and STATUS_CANCELLED
      * @return ProgramInstance list
      */
-    Collection<ProgramInstance> getProgramInstances( Program program, Integer status );
+    List<ProgramInstance> getProgramInstances( Program program, Integer status );
 
     /**
      * Retrieve program instances on a program list by status
@@ -140,7 +140,7 @@
      *                 STATUS_COMPLETED and STATUS_CANCELLED
      * @return ProgramInstance list
      */
-    Collection<ProgramInstance> getProgramInstances( Collection<Program> programs, Integer status );
+    List<ProgramInstance> getProgramInstances( Collection<Program> programs, Integer status );
 
     /**
      * Retrieve program instances on a TrackedEntityInstance by a status
@@ -150,7 +150,7 @@
      *                       STATUS_COMPLETED and STATUS_CANCELLED
      * @return ProgramInstance list
      */
-    Collection<ProgramInstance> getProgramInstances( TrackedEntityInstance entityInstance, Integer status );
+    List<ProgramInstance> getProgramInstances( TrackedEntityInstance entityInstance, Integer status );
 
     /**
      * Retrieve program instances on a TrackedEntityInstance by a program
@@ -159,7 +159,7 @@
      * @param program        Program
      * @return ProgramInstance list
      */
-    Collection<ProgramInstance> getProgramInstances( TrackedEntityInstance entityInstance, Program program );
+    List<ProgramInstance> getProgramInstances( TrackedEntityInstance entityInstance, Program program );
 
     /**
      * Retrieve program instances on a TrackedEntityInstance with a status by a program
@@ -170,7 +170,7 @@
      *                       STATUS_COMPLETED and STATUS_CANCELLED
      * @return ProgramInstance list
      */
-    Collection<ProgramInstance> getProgramInstances( TrackedEntityInstance entityInstance, Program program, Integer status );
+    List<ProgramInstance> getProgramInstances( TrackedEntityInstance entityInstance, Program program, Integer status );
 
     /**
      * Retrieve program instances with active status on an orgunit by a program
@@ -182,7 +182,7 @@
      * @param max              Maximum results
      * @return ProgramInstance list
      */
-    Collection<ProgramInstance> getProgramInstances( Program program, OrganisationUnit organisationUnit, Integer min,
+    List<ProgramInstance> getProgramInstances( Program program, OrganisationUnit organisationUnit, Integer min,
         Integer max );
 
     /**
@@ -197,7 +197,7 @@
      * @param max        Maximum results
      * @return ProgramInstance list
      */
-    Collection<ProgramInstance> getProgramInstances( Program program, Collection<Integer> orgunitIds, Date startDate,
+    List<ProgramInstance> getProgramInstances( Program program, Collection<Integer> orgunitIds, Date startDate,
         Date endDate, Integer min, Integer max );
 
     /**
@@ -243,7 +243,7 @@
      * @param endDate    The end date for retrieving on enrollment-date
      * @return ProgramInstance list
      */
-    Collection<ProgramInstance> getProgramInstancesByStatus( Integer status, Program program,
+    List<ProgramInstance> getProgramInstancesByStatus( Integer status, Program program,
         Collection<Integer> orgunitIds, Date startDate, Date endDate );
 
     /**
@@ -258,7 +258,7 @@
      * @param endDate    The end date for retrieving on enrollment-date
      * @return ProgramInstance list
      */
-    Collection<ProgramInstance> getProgramInstancesByStatus( Integer status, Program program,
+    List<ProgramInstance> getProgramInstancesByStatus( Integer status, Program program,
         Collection<Integer> orgunitIds, Date startDate, Date endDate, Integer min, Integer max );
 
     /**

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstanceStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstanceStore.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstanceStore.java	2015-06-16 13:17:59 +0000
@@ -34,6 +34,7 @@
 
 import java.util.Collection;
 import java.util.Date;
+import java.util.List;
 
 /**
  * @author Abyot Asalefew
@@ -50,7 +51,7 @@
      * @param program Program
      * @return ProgramInstance list
      */
-    Collection<ProgramInstance> get( Program program );
+    List<ProgramInstance> get( Program program );
 
     /**
      * Retrieve program instances on program list
@@ -58,7 +59,7 @@
      * @param programs Program list
      * @return ProgramInstance list
      */
-    Collection<ProgramInstance> get( Collection<Program> programs );
+    List<ProgramInstance> get( Collection<Program> programs );
 
     /**
      * Retrieve program instances of whom registered in to a orgunit from
@@ -68,7 +69,7 @@
      * @param organisationUnit Organisation Unit
      * @return ProgramInstance list
      */
-    Collection<ProgramInstance> get( Collection<Program> programs, OrganisationUnit organisationUnit );
+    List<ProgramInstance> get( Collection<Program> programs, OrganisationUnit organisationUnit );
 
     /**
      * Retrieve program instances of whom registered in to a orgunit from
@@ -80,7 +81,7 @@
      *                         STATUS_COMPLETED and STATUS_CANCELLED
      * @return ProgramInstance list
      */
-    Collection<ProgramInstance> get( Collection<Program> programs, OrganisationUnit organisationUnit, int status );
+    List<ProgramInstance> get( Collection<Program> programs, OrganisationUnit organisationUnit, int status );
 
     /**
      * Retrieve program instances on a program by status
@@ -90,7 +91,7 @@
      *                STATUS_COMPLETED and STATUS_CANCELLED
      * @return ProgramInstance list
      */
-    Collection<ProgramInstance> get( Program program, Integer status );
+    List<ProgramInstance> get( Program program, Integer status );
 
     /**
      * Retrieve program instances on a program list by status
@@ -100,7 +101,7 @@
      *                 STATUS_COMPLETED and STATUS_CANCELLED
      * @return ProgramInstance list
      */
-    Collection<ProgramInstance> get( Collection<Program> programs, Integer status );
+    List<ProgramInstance> get( Collection<Program> programs, Integer status );
 
     /**
      * Retrieve program instances on a TrackedEntityInstance by a status
@@ -110,7 +111,7 @@
      *                       STATUS_COMPLETED and STATUS_CANCELLED
      * @return ProgramInstance list
      */
-    Collection<ProgramInstance> get( TrackedEntityInstance entityInstance, Integer status );
+    List<ProgramInstance> get( TrackedEntityInstance entityInstance, Integer status );
 
     /**
      * Retrieve program instances on a TrackedEntityInstance by a program
@@ -119,7 +120,7 @@
      * @param program        Program
      * @return ProgramInstance list
      */
-    Collection<ProgramInstance> get( TrackedEntityInstance entityInstance, Program program );
+    List<ProgramInstance> get( TrackedEntityInstance entityInstance, Program program );
 
     /**
      * Retrieve program instances on a TrackedEntityInstance with a status by a program
@@ -130,7 +131,7 @@
      *                       STATUS_COMPLETED and STATUS_CANCELLED
      * @return ProgramInstance list
      */
-    Collection<ProgramInstance> get( TrackedEntityInstance entityInstance, Program program, Integer status );
+    List<ProgramInstance> get( TrackedEntityInstance entityInstance, Program program, Integer status );
 
     /**
      * Retrieve program instances with active status on an orgunit by a program
@@ -142,7 +143,7 @@
      * @param max              Maximum results
      * @return ProgramInstance list
      */
-    Collection<ProgramInstance> get( Program program, OrganisationUnit organisationUnit, Integer min, Integer max );
+    List<ProgramInstance> get( Program program, OrganisationUnit organisationUnit, Integer min, Integer max );
 
     /**
      * Retrieve program instances with active status on an orgunit by a program
@@ -156,7 +157,7 @@
      * @param max        Maximum results
      * @return ProgramInstance list
      */
-    Collection<ProgramInstance> get( Program program, Collection<Integer> orgunitIds, Date startDate, Date endDate,
+    List<ProgramInstance> get( Program program, Collection<Integer> orgunitIds, Date startDate, Date endDate,
         Integer min, Integer max );
 
     /**
@@ -206,7 +207,7 @@
      * @param endDate    The end date for retrieving on enrollment-date
      * @return ProgramInstance list
      */
-    Collection<ProgramInstance> getByStatus( Integer status, Program program, Collection<Integer> orgunitIds,
+    List<ProgramInstance> getByStatus( Integer status, Program program, Collection<Integer> orgunitIds,
         Date startDate, Date endDate );
 
     /**
@@ -221,7 +222,7 @@
      * @param endDate    The end date for retrieving on enrollment-date
      * @return ProgramInstance list
      */
-    Collection<ProgramInstance> getByStatus( Integer status, Program program, Collection<Integer> orgunitIds,
+    List<ProgramInstance> getByStatus( Integer status, Program program, Collection<Integer> orgunitIds,
         Date startDate, Date endDate, Integer min, Integer max );
 
     /**

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramService.java	2015-03-03 05:06:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramService.java	2015-06-16 13:17:59 +0000
@@ -34,6 +34,7 @@
 import org.hisp.dhis.validation.ValidationCriteria;
 
 import java.util.Collection;
+import java.util.List;
 
 /**
  * @author Abyot Asalefew
@@ -89,7 +90,7 @@
      * @return a collection of all Program, or an empty collection if there are
      * no Programs.
      */
-    Collection<Program> getAllPrograms();
+    List<Program> getAllPrograms();
 
     /**
      * Get all {@link Program} belong to a orgunit
@@ -97,21 +98,21 @@
      * @param organisationUnit {@link OrganisationUnit}
      * @return The program list
      */
-    Collection<Program> getPrograms( OrganisationUnit organisationUnit );
+    List<Program> getPrograms( OrganisationUnit organisationUnit );
 
     /**
      * Get {@link Program} by the current user.
      *
      * @return The program list the current user
      */
-    Collection<Program> getProgramsByCurrentUser();
+    List<Program> getProgramsByCurrentUser();
 
     /**
      * Get {@link Program} by user.
      *
      * @return The program list the current user
      */
-    Collection<Program> getProgramsByUser( User user );
+    List<Program> getProgramsByUser( User user );
 
     /**
      * Get {@link Program} by the current user and a certain type
@@ -121,7 +122,7 @@
      *             Single event without registration.
      * @return Program list by a type specified
      */
-    Collection<Program> getProgramsByCurrentUser( int type );
+    List<Program> getProgramsByCurrentUser( int type );
 
     /**
      * Get {@link Program} included in the expression of a
@@ -130,7 +131,7 @@
      * @param validationCriteria {@link ValidationCriteria}
      * @return Program list
      */
-    Collection<Program> getPrograms( ValidationCriteria validationCriteria );
+    List<Program> getPrograms( ValidationCriteria validationCriteria );
 
     /**
      * Get {@link Program} by a type
@@ -140,7 +141,7 @@
      *             Single event without registration
      * @return Program list by a type specified
      */
-    Collection<Program> getPrograms( int type );
+    List<Program> getPrograms( int type );
 
     /**
      * Get {@link Program} assigned to an {@link OrganisationUnit} by a type
@@ -151,7 +152,7 @@
      * @param orgunit Where programs assigned
      * @return Program list by a type specified
      */
-    Collection<Program> getPrograms( int type, OrganisationUnit orgunit );
+    List<Program> getPrograms( int type, OrganisationUnit orgunit );
 
     /**
      * Returns the {@link Program} with the given UID.
@@ -166,14 +167,14 @@
      *
      * @param organisationUnit {@link OrganisationUnit}
      */
-    Collection<Program> getProgramsByCurrentUser( OrganisationUnit organisationUnit );
+    List<Program> getProgramsByCurrentUser( OrganisationUnit organisationUnit );
 
     /**
      * Get {@link TrackedEntity} by TrackedEntity
      *
      * @param trackedEntity {@link TrackedEntity}
      */
-    Collection<Program> getProgramsByTrackedEntity( TrackedEntity trackedEntity );
+    List<Program> getProgramsByTrackedEntity( TrackedEntity trackedEntity );
 
     /**
      * Returns The number of Programs with the key searched
@@ -189,10 +190,10 @@
      * @param name Keyword for searching by name
      * @param min  First result
      * @param max  Maximum results
-     * @return a collection of all Program, or an empty collection if
+     * @return a List of all Program, or an empty collection if
      * there are no Program.
      */
-    Collection<Program> getProgramBetweenByName( String name, int min, int max );
+    List<Program> getProgramBetweenByName( String name, int min, int max );
 
     /**
      * Returns The number of all Program available
@@ -204,17 +205,17 @@
      *
      * @param min First result
      * @param max Maximum results
-     * @return a collection of all Program, or an empty collection if
+     * @return a List of all Program, or an empty List if
      * there are no Program.
      */
-    Collection<Program> getProgramsBetween( int min, int max );
+    List<Program> getProgramsBetween( int min, int max );
 
     /**
      * Get {@link Program} by the current user.
      *
      * @return The program list the current user
      */
-    Collection<Program> getByCurrentUser();
+    List<Program> getByCurrentUser();
 
     /**
      * Get {@link Program} by the current user and a certain type
@@ -224,5 +225,5 @@
      *             Single event without registration.
      * @return Program list by a type specified
      */
-    Collection<Program> getByCurrentUser( int type );
+    List<Program> getByCurrentUser( int type );
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java	2015-04-01 09:10:55 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,9 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.util.ArrayList;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 
 import org.hisp.dhis.attribute.AttributeValue;
@@ -150,9 +152,9 @@
     // Logic
     // -------------------------------------------------------------------------
 
-    public Set<DataElement> getAllDataElements()
+    public List<DataElement> getAllDataElements()
     {
-        Set<DataElement> dataElements = new HashSet<>();
+        List<DataElement> dataElements = new ArrayList<>();
 
         for ( ProgramStageDataElement element : programStageDataElements )
         {
@@ -553,19 +555,32 @@
                 description = programStage.getDescription() == null ? description : programStage.getDescription();
                 irregular = programStage.getIrregular() == null ? irregular : programStage.getIrregular();
                 program = programStage.getProgram() == null ? program : programStage.getProgram();
-                dataEntryForm = programStage.getDataEntryForm() == null ? dataEntryForm : programStage.getDataEntryForm();
-                standardInterval = programStage.getStandardInterval() == null ? standardInterval : programStage.getStandardInterval();
-                reportDateDescription = programStage.getReportDateDescription() == null ? reportDateDescription : programStage.getReportDateDescription();
-                validCompleteOnly = programStage.getValidCompleteOnly() == null ? validCompleteOnly : programStage.getValidCompleteOnly();
-                displayGenerateEventBox = programStage.getDisplayGenerateEventBox() == null ? displayGenerateEventBox : programStage.getDisplayGenerateEventBox();
-                captureCoordinates = programStage.getCaptureCoordinates() == null ? captureCoordinates : programStage.getCaptureCoordinates();
-                blockEntryForm = programStage.getBlockEntryForm() == null ? blockEntryForm : programStage.getBlockEntryForm();
-                remindCompleted = programStage.getRemindCompleted() == null ? remindCompleted : programStage.getRemindCompleted();
-                generatedByEnrollmentDate = programStage.getGeneratedByEnrollmentDate() == null ? generatedByEnrollmentDate : programStage.getGeneratedByEnrollmentDate();
-                allowGenerateNextVisit = programStage.getAllowGenerateNextVisit() == null ? allowGenerateNextVisit : programStage.getAllowGenerateNextVisit();
-                openAfterEnrollment = programStage.getOpenAfterEnrollment() == null ? openAfterEnrollment : programStage.getOpenAfterEnrollment();
-                reportDateToUse = programStage.getReportDateToUse() == null ? reportDateToUse : programStage.getReportDateToUse();
-                preGenerateUID = programStage.getPreGenerateUID() == null ? preGenerateUID : programStage.getPreGenerateUID();
+                dataEntryForm = programStage.getDataEntryForm() == null ? dataEntryForm : programStage
+                    .getDataEntryForm();
+                standardInterval = programStage.getStandardInterval() == null ? standardInterval : programStage
+                    .getStandardInterval();
+                reportDateDescription = programStage.getReportDateDescription() == null ? reportDateDescription
+                    : programStage.getReportDateDescription();
+                validCompleteOnly = programStage.getValidCompleteOnly() == null ? validCompleteOnly : programStage
+                    .getValidCompleteOnly();
+                displayGenerateEventBox = programStage.getDisplayGenerateEventBox() == null ? displayGenerateEventBox
+                    : programStage.getDisplayGenerateEventBox();
+                captureCoordinates = programStage.getCaptureCoordinates() == null ? captureCoordinates : programStage
+                    .getCaptureCoordinates();
+                blockEntryForm = programStage.getBlockEntryForm() == null ? blockEntryForm : programStage
+                    .getBlockEntryForm();
+                remindCompleted = programStage.getRemindCompleted() == null ? remindCompleted : programStage
+                    .getRemindCompleted();
+                generatedByEnrollmentDate = programStage.getGeneratedByEnrollmentDate() == null ? generatedByEnrollmentDate
+                    : programStage.getGeneratedByEnrollmentDate();
+                allowGenerateNextVisit = programStage.getAllowGenerateNextVisit() == null ? allowGenerateNextVisit
+                    : programStage.getAllowGenerateNextVisit();
+                openAfterEnrollment = programStage.getOpenAfterEnrollment() == null ? openAfterEnrollment
+                    : programStage.getOpenAfterEnrollment();
+                reportDateToUse = programStage.getReportDateToUse() == null ? reportDateToUse : programStage
+                    .getReportDateToUse();
+                preGenerateUID = programStage.getPreGenerateUID() == null ? preGenerateUID : programStage
+                    .getPreGenerateUID();
             }
 
             programStageDataElements.clear();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElementService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElementService.java	2015-03-30 09:30:54 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElementService.java	2015-06-16 13:17:59 +0000
@@ -28,10 +28,10 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.util.List;
+
 import org.hisp.dhis.dataelement.DataElement;
 
-import java.util.Collection;
-
 /**
  * @author Viet Nguyen
  */
@@ -76,5 +76,5 @@
      * @return a collection of all ProgramStageDataElement, or an empty
      * collection if there are no ProgramStageDataElements.
      */
-    Collection<ProgramStageDataElement> getAllProgramStageDataElements();
+    List<ProgramStageDataElement> getAllProgramStageDataElements();
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java	2015-05-18 17:05:23 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java	2015-06-16 13:17:59 +0000
@@ -105,7 +105,7 @@
      * @param status EventStatus
      * @return ProgramStageInstance list
      */
-    Collection<ProgramStageInstance> getProgramStageInstances( Collection<ProgramInstance> programInstances,
+    List<ProgramStageInstance> getProgramStageInstances( Collection<ProgramInstance> programInstances,
         EventStatus status );
 
     /**

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceStore.java	2015-04-24 11:16:03 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceStore.java	2015-06-16 13:17:59 +0000
@@ -64,7 +64,7 @@
      * @param status EventStatus
      * @return ProgramStageInstance list
      */
-    Collection<ProgramStageInstance> get( Collection<ProgramInstance> programInstances, EventStatus status );
+    List<ProgramStageInstance> get( Collection<ProgramInstance> programInstances, EventStatus status );
 
     /**
      * Get all events by TrackedEntityInstance, optionally filtering by completed.

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStore.java	2015-03-08 14:00:13 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStore.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
+import java.util.List;
 
 import org.hisp.dhis.common.GenericIdentifiableObjectStore;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
@@ -51,7 +51,7 @@
      *             Single event without registration
      * @return Program list by a type specified
      */
-    Collection<Program> getByType( int type );
+    List<Program> getByType( int type );
 
     /**
      * Get {@link Program} assigned to an {@link OrganisationUnit} by a type
@@ -59,7 +59,7 @@
      * @param organisationUnit Where programs assigned
      * @return Program list by a type specified
      */
-    Collection<Program> get( OrganisationUnit organisationUnit );
+    List<Program> get( OrganisationUnit organisationUnit );
 
     /**
      * Get {@link Program} assigned to an {@link OrganisationUnit} by a type
@@ -70,13 +70,13 @@
      * @param orgunit Where programs assigned
      * @return Program list by a type specified
      */
-    Collection<Program> get( int type, OrganisationUnit orgunit );
+    List<Program> get( int type, OrganisationUnit orgunit );
 
     /**
      * Get {@link Program} by TrackedEntity
      *
      * @param trackedEntity {@link TrackedEntity}
      */
-    Collection<Program> getByTrackedEntity( TrackedEntity trackedEntity );
+    List<Program> getByTrackedEntity( TrackedEntity trackedEntity );
 
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramValidationService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramValidationService.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramValidationService.java	2015-06-16 13:17:59 +0000
@@ -29,6 +29,7 @@
  */
 
 import java.util.Collection;
+import java.util.List;
 
 /**
  * @author Chau Thu Tran
@@ -74,7 +75,7 @@
      * @return a collection of all ProgramValidation, or an empty collection if
      * there are no ProgramValidations.
      */
-    Collection<ProgramValidation> getAllProgramValidation();
+    List<ProgramValidation> getAllProgramValidation();
 
     /**
      * Get validation by {@link Program}
@@ -82,7 +83,7 @@
      * @param program Program
      * @return ProgramValidation list
      */
-    Collection<ProgramValidation> getProgramValidation( Program program );
+    List<ProgramValidation> getProgramValidation( Program program );
 
     /**
      * Get validation by program stage
@@ -90,7 +91,7 @@
      * @param programStage {@link ProgramStage}
      * @return ProgramValidation list
      */
-    Collection<ProgramValidation> getProgramValidation( ProgramStage programStage );
+    List<ProgramValidation> getProgramValidation( ProgramStage programStage );
 
     /**
      * Get validation violated in an event
@@ -99,6 +100,6 @@
      * @param programStageInstance {@link ProgramStageInstance}
      * @return List of validation violated
      */
-    Collection<ProgramValidationResult> validate( Collection<ProgramValidation> validation,
+    List<ProgramValidationResult> validate( Collection<ProgramValidation> validation,
         ProgramStageInstance programStageInstance );
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramValidationStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramValidationStore.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramValidationStore.java	2015-06-16 13:17:59 +0000
@@ -28,10 +28,10 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.util.List;
+
 import org.hisp.dhis.common.GenericStore;
 
-import java.util.Collection;
-
 /**
  * @author Chau Thu Tran
  * @version $ ProgramValidationStore.java Apr 28, 2011 10:33:44 AM $
@@ -47,5 +47,5 @@
      * @param program {@link Program}
      * @return ProgramValidation list
      */
-    Collection<ProgramValidation> get( Program program );
+    List<ProgramValidation> get( Program program );
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/programrule/ProgramRuleActionService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/programrule/ProgramRuleActionService.java	2015-03-13 08:24:36 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/programrule/ProgramRuleActionService.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
+import java.util.List;
 
 /**
  *
@@ -74,7 +74,7 @@
      * @return a collection of all ProgramRuleAction, or an empty collection if
      * there are no ProgramRuleActions.
      */
-    Collection<ProgramRuleAction> getAllProgramRuleAction();
+    List<ProgramRuleAction> getAllProgramRuleAction();
 
     /**
      * Get validation by {@link ProgramRule}
@@ -82,5 +82,5 @@
      * @param program Program
      * @return ProgramRuleAction list
      */
-    Collection<ProgramRuleAction> getProgramRuleAction( ProgramRule programRule );
+    List<ProgramRuleAction> getProgramRuleAction( ProgramRule programRule );
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/programrule/ProgramRuleActionStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/programrule/ProgramRuleActionStore.java	2015-03-13 08:24:36 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/programrule/ProgramRuleActionStore.java	2015-06-16 13:17:59 +0000
@@ -28,8 +28,10 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
+import java.util.List;
+
 import org.hisp.dhis.common.GenericNameableObjectStore;
+import org.hisp.dhis.program.Program;
 
 /**
  * @author markusbekken
@@ -45,5 +47,5 @@
      * @param program {@link Program}
      * @return ProgramRuleActionVariable list
      */
-    Collection<ProgramRuleAction> get( ProgramRule programRule );
+    List<ProgramRuleAction> get( ProgramRule programRule );
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/programrule/ProgramRuleService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/programrule/ProgramRuleService.java	2015-04-11 13:18:25 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/programrule/ProgramRuleService.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,8 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
+import java.util.List;
+
 import org.hisp.dhis.program.Program;
 
 /**
@@ -84,7 +85,7 @@
      * @return a collection of all ProgramRule, or an empty collection if
      * there are no ProgramRules.
      */
-    Collection<ProgramRule> getAllProgramRule();
+    List<ProgramRule> getAllProgramRule();
 
     /**
      * Get validation by {@link Program}
@@ -92,7 +93,7 @@
      * @param program Program
      * @return ProgramRule list
      */
-    Collection<ProgramRule> getProgramRule( Program program );
+    List<ProgramRule> getProgramRule( Program program );
 
     /**
      * Get validation by {@link Program}
@@ -101,5 +102,5 @@
      * @param key Search Program Rule by key
      * @return ProgramRule list
      */
-    Collection<ProgramRule> getProgramRules( Program program, String key );
+    List<ProgramRule> getProgramRules( Program program, String key );
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/programrule/ProgramRuleStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/programrule/ProgramRuleStore.java	2015-04-11 13:18:25 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/programrule/ProgramRuleStore.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
+import java.util.List;
 
 import org.hisp.dhis.common.GenericNameableObjectStore;
 import org.hisp.dhis.program.Program;
@@ -47,7 +47,7 @@
      * @param program {@link Program}
      * @return ProgramRuleVariable list
      */
-    Collection<ProgramRule> get( Program program );
+    List<ProgramRule> get( Program program );
     
     /**
      * Returns a {@link ProgramRule}.
@@ -65,5 +65,5 @@
      * @param key Search Program Rule by key
      * @return ProgramRule list
      */
-    Collection<ProgramRule> get( Program program, String key );
+    List<ProgramRule> get( Program program, String key );
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/programrule/ProgramRuleVariableService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/programrule/ProgramRuleVariableService.java	2015-03-13 08:24:36 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/programrule/ProgramRuleVariableService.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
+import java.util.List;
 
 import org.hisp.dhis.program.Program;
 
@@ -73,10 +73,10 @@
     /**
      * Returns all {@link ProgramRuleVariable}.
      *
-     * @return a collection of all ProgramRuleVariable, or an empty collection if
+     * @return a List of all ProgramRuleVariable, or an empty List if
      * there are no ProgramRuleVariables.
      */
-    Collection<ProgramRuleVariable> getAllProgramRuleVariable();
+    List<ProgramRuleVariable> getAllProgramRuleVariable();
 
     /**
      * Get validation by {@link Program}
@@ -84,5 +84,5 @@
      * @param program Program
      * @return ProgramRuleVariable list
      */
-    Collection<ProgramRuleVariable> getProgramRuleVariable( Program program );
+    List<ProgramRuleVariable> getProgramRuleVariable( Program program );
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/programrule/ProgramRuleVariableStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/programrule/ProgramRuleVariableStore.java	2015-03-13 08:24:36 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/programrule/ProgramRuleVariableStore.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
+import java.util.List;
 
 import org.hisp.dhis.common.GenericNameableObjectStore;
 import org.hisp.dhis.program.Program;
@@ -47,5 +47,5 @@
      * @param program {@link Program}
      * @return ProgramRuleVariable list
      */
-    Collection<ProgramRuleVariable> get( Program program );
+    List<ProgramRuleVariable> get( Program program );
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/relationship/RelationshipService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/relationship/RelationshipService.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/relationship/RelationshipService.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
+import java.util.List;
 
 import org.hisp.dhis.program.Program;
 import org.hisp.dhis.trackedentity.TrackedEntityInstance;
@@ -94,7 +94,7 @@
      * 
      * @return Relationship list
      */
-    Collection<Relationship> getRelationshipsForTrackedEntityInstance( TrackedEntityInstance instance );
+    List<Relationship> getRelationshipsForTrackedEntityInstance( TrackedEntityInstance instance );
 
     /**
      * Retrieve all relationships by relationship type of a person, for example
@@ -105,5 +105,5 @@
      * 
      * @return Relationship list
      */
-    Collection<Relationship> getRelationships( TrackedEntityInstance entityInstanceA, RelationshipType relationshipType );
+    List<Relationship> getRelationships( TrackedEntityInstance entityInstanceA, RelationshipType relationshipType );
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/relationship/RelationshipStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/relationship/RelationshipStore.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/relationship/RelationshipStore.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
+import java.util.List;
 
 import org.hisp.dhis.common.GenericStore;
 import org.hisp.dhis.trackedentity.TrackedEntityInstance;
@@ -61,7 +61,7 @@
      * 
      * @return Relationship list
      */
-    Collection<Relationship> getForTrackedEntityInstance( TrackedEntityInstance instance );
+    List<Relationship> getForTrackedEntityInstance( TrackedEntityInstance instance );
 
     /**
      * Retrieve all relationships of a relationship type
@@ -70,5 +70,5 @@
      * 
      * @return Relationship list
      */
-    Collection<Relationship> getByRelationshipType( RelationshipType relationshipType );
+    List<Relationship> getByRelationshipType( RelationshipType relationshipType );
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/relationship/RelationshipTypeService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/relationship/RelationshipTypeService.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/relationship/RelationshipTypeService.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
+import java.util.List;
 
 import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
 
@@ -97,7 +97,7 @@
      * @return a collection of all RelationshipType, or an empty collection if
      *         there are no RelationshipTypes.
      */
-    Collection<RelationshipType> getAllRelationshipTypes();
+    List<RelationshipType> getAllRelationshipTypes();
 
     /**
      * Returns The number of RelationshipTypes with the key searched
@@ -118,7 +118,7 @@
      * @return a collection of all TrackedEntityAttribute, or an empty
      *         collection if there are no TrackedEntityAttributes.
      */
-    Collection<? extends RelationshipType> getRelationshipTypesBetweenByName( String name,
+    List<RelationshipType> getRelationshipTypesBetweenByName( String name,
         int min, int max );
 
     /**
@@ -132,8 +132,8 @@
      * 
      * @param min
      * @param max
-     * @return a collection of all TrackedEntityAttribute, or an empty
-     *         collection if there are no TrackedEntityAttributes.
+     * @return a List of all TrackedEntityAttribute, or an empty
+     *         List if there are no TrackedEntityAttributes.
      */
-    Collection<RelationshipType> getRelationshipTypesBetween( int min, int max );
+    List<RelationshipType> getRelationshipTypesBetween( int min, int max );
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeGroupService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeGroupService.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeGroupService.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
+import java.util.List;
 
 /**
  * @author Chau Thu Tran
@@ -96,10 +96,10 @@
     /**
      * Returns all {@link TrackedEntityAttributeGroup}
      * 
-     * @return a collection of all TrackedEntityAttributeGroup, or an empty
-     *         collection if there are no TrackedEntityAttributeGroups.
+     * @return a List of all TrackedEntityAttributeGroup, or an empty
+     *         List if there are no TrackedEntityAttributeGroups.
      */
-    Collection<TrackedEntityAttributeGroup> getAllTrackedEntityAttributeGroups();
+    List<TrackedEntityAttributeGroup> getAllTrackedEntityAttributeGroups();
 
     /**
      * Returns The number of TrackedEntityAttributeGroups with the key searched
@@ -117,10 +117,10 @@
      * @param name Keyword for searching by name
      * @param min
      * @param max
-     * @return a collection of all TrackedEntityAttribute, or an empty
-     *         collection if there are no TrackedEntityAttributes.
+     * @return a List of all TrackedEntityAttribute, or an empty
+     *         List if there are no TrackedEntityAttributes.
      */
-    Collection<TrackedEntityAttributeGroup> getTrackedEntityAttributeGroupsBetweenByName( String name,
+    List<TrackedEntityAttributeGroup> getTrackedEntityAttributeGroupsBetweenByName( String name,
         int min, int max );
 
     /**
@@ -134,8 +134,8 @@
      * 
      * @param min
      * @param max
-     * @return a collection of all TrackedEntityAttribute, or an empty
-     *         collection if there are no TrackedEntityAttributes.
+     * @return a List of all TrackedEntityAttribute, or an empty
+     *         List if there are no TrackedEntityAttributes.
      */
-    Collection<TrackedEntityAttributeGroup> getTrackedEntityAttributeGroupsBetween( int min, int max );
+    List<TrackedEntityAttributeGroup> getTrackedEntityAttributeGroupsBetween( int min, int max );
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeService.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeService.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
+import java.util.List;
 
 /**
  * @author Abyot Asalefew
@@ -113,24 +113,24 @@
     /**
      * Returns all {@link TrackedEntityAttribute}
      * 
-     * @return a collection of all TrackedEntityAttribute, or an empty
-     *         collection if there are no TrackedEntityAttributes.
+     * @return a List of all TrackedEntityAttribute, or an empty
+     *         List if there are no TrackedEntityAttributes.
      */
-    Collection<TrackedEntityAttribute> getAllTrackedEntityAttributes();
+    List<TrackedEntityAttribute> getAllTrackedEntityAttributes();
 
     /**
      * Get attributes without groups
      * 
      * @return List of attributes
      */
-    Collection<TrackedEntityAttribute> getOptionalAttributesWithoutGroup();
+    List<TrackedEntityAttribute> getOptionalAttributesWithoutGroup();
 
     /**
      * Get attributes without groups
      * 
      * @return List of attributes without group
      */
-    Collection<TrackedEntityAttribute> getTrackedEntityAttributesWithoutGroup();
+    List<TrackedEntityAttribute> getTrackedEntityAttributesWithoutGroup();
 
     /**
      * Get attributes which are displayed in visit schedule
@@ -139,7 +139,7 @@
      * 
      * @return List of attributes
      */
-    Collection<TrackedEntityAttribute> getTrackedEntityAttributesByDisplayOnVisitSchedule(
+    List<TrackedEntityAttribute> getTrackedEntityAttributesByDisplayOnVisitSchedule(
         boolean displayOnVisitSchedule );
 
     /**
@@ -149,7 +149,7 @@
      * 
      * @return List of attributes
      */
-    Collection<TrackedEntityAttribute> getTrackedEntityAttributesWithoutProgram();
+    List<TrackedEntityAttribute> getTrackedEntityAttributesWithoutProgram();
 
     /**
      * Get attributes which are displayed in visit schedule
@@ -158,7 +158,7 @@
      * 
      * @return List of attributes
      */
-    Collection<TrackedEntityAttribute> getTrackedEntityAttributesDisplayInList();
+    List<TrackedEntityAttribute> getTrackedEntityAttributesDisplayInList();
 
     /**
      * Returns {@link TrackedEntityAttribute} list with paging
@@ -169,7 +169,7 @@
      * @return a collection of all TrackedEntityAttribute, or an empty
      *         collection if there are no TrackedEntityAttributes.
      */
-    Collection<TrackedEntityAttribute> getTrackedEntityAttributesBetweenByName( String name, int min, int max );
+    List<TrackedEntityAttribute> getTrackedEntityAttributesBetweenByName( String name, int min, int max );
 
     /**
      * Returns The number of all TrackedEntityAttribute available
@@ -185,7 +185,7 @@
      * @return a collection of all TrackedEntityAttribute, or an empty
      *         collection if there are no TrackedEntityAttributes.
      */
-    Collection<TrackedEntityAttribute> getTrackedEntityAttributesBetween( int min, int max );
+    List<TrackedEntityAttribute> getTrackedEntityAttributesBetween( int min, int max );
 
     /**
      * Returns The number of TrackedEntityAttributes with the key searched

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeStore.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeStore.java	2015-06-16 13:17:59 +0000
@@ -29,6 +29,7 @@
  */
 
 import java.util.Collection;
+import java.util.List;
 
 import org.hisp.dhis.common.GenericNameableObjectStore;
 
@@ -45,14 +46,14 @@
      * 
      * @return List of attributes
      */
-    Collection<TrackedEntityAttribute> getOptionalAttributesWithoutGroup();
+    List<TrackedEntityAttribute> getOptionalAttributesWithoutGroup();
 
     /**
      * Get {@link TrackedEntityAttribute} without any group
      * 
      * @return TrackedEntityAttribute without group.
      */
-    Collection<TrackedEntityAttribute> getWithoutGroup();
+    List<TrackedEntityAttribute> getWithoutGroup();
 
     /**
      * Get attributes which are displayed in visit schedule
@@ -61,13 +62,13 @@
      * 
      * @return List of attributes
      */
-    Collection<TrackedEntityAttribute> getByDisplayOnVisitSchedule( boolean displayOnVisitSchedule );
+    List<TrackedEntityAttribute> getByDisplayOnVisitSchedule( boolean displayOnVisitSchedule );
 
     /**
      * Get attributes which are displayed in visit schedule
      * 
      * @return List of attributes
      */
-    Collection<TrackedEntityAttribute> getDisplayInList();
+    List<TrackedEntityAttribute> getDisplayInList();
 
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAuditService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAuditService.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAuditService.java	2015-06-16 13:17:59 +0000
@@ -28,8 +28,8 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
 import java.util.Date;
+import java.util.List;
 
 /**
  * @author Chau Thu Tran
@@ -72,7 +72,7 @@
      * 
      * @return List of TrackedEntityAudit
      */
-    Collection<TrackedEntityAudit> getTrackedEntityAudits( TrackedEntityInstance instance );
+    List<TrackedEntityAudit> getTrackedEntityAudits( TrackedEntityInstance instance );
 
     /**
      * Get instance audit of a instance

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAuditStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAuditStore.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAuditStore.java	2015-06-16 13:17:59 +0000
@@ -28,8 +28,8 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
 import java.util.Date;
+import java.util.List;
 
 import org.hisp.dhis.common.GenericStore;
 
@@ -48,7 +48,7 @@
      * 
      * @return List of TrackedEntityInstanceAudit
      */
-    Collection<TrackedEntityAudit> get( TrackedEntityInstance instance );
+    List<TrackedEntityAudit> get( TrackedEntityInstance instance );
 
     /**
      * Get tracked entity audit of a instance

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityFormService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityFormService.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityFormService.java	2015-06-16 13:17:59 +0000
@@ -29,6 +29,7 @@
  */
 
 import java.util.Collection;
+import java.util.List;
 import java.util.regex.Pattern;
 
 import org.hisp.dhis.i18n.I18n;
@@ -102,7 +103,7 @@
      * @return a collection of all TrackedEntityForm, or an empty collection if
      *         there are no TrackedEntityForms.
      */
-    Collection<TrackedEntityForm> getAllTrackedEntityForms();
+    List<TrackedEntityForm> getAllTrackedEntityForms();
 
     /**
      * Get tracked entity form of a program

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityService.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityService.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
+import java.util.List;
 
 /**
  * @author Chau Thu Tran
@@ -97,10 +97,10 @@
     /**
      * Returns all {@link TrackedEntity}
      * 
-     * @return a collection of all TrackedEntity, or an empty
-     *         collection if there are no TrackedEntitys.
+     * @return a List of all TrackedEntity, or an empty
+     *         List if there are no TrackedEntitys.
      */
-    Collection<TrackedEntity> getAllTrackedEntity();
+    List<TrackedEntity> getAllTrackedEntity();
     
     /**
      * Returns The number of TrackedEntities with the key searched
@@ -118,10 +118,10 @@
      * @param name Keyword for searching by name
      * @param min
      * @param max
-     * @return a collection of all TrackedEntity, or an empty
-     *         collection if there are no TrackedEntity.
+     * @return a List of all TrackedEntity, or an empty
+     *         List if there are no TrackedEntity.
      */
-    Collection<TrackedEntity> getTrackedEntityBetweenByName( String name,
+    List<TrackedEntity> getTrackedEntityBetweenByName( String name,
         int min, int max );
 
     /**
@@ -135,8 +135,8 @@
      * 
      * @param min
      * @param max
-     * @return a collection of all TrackedEntity, or an empty
-     *         collection if there are no TrackedEntity.
+     * @return a List of all TrackedEntity, or an empty
+     *         List if there are no TrackedEntity.
      */
-    Collection<TrackedEntity> getTrackedEntitysBetween( int min, int max );
+    List<TrackedEntity> getTrackedEntitysBetween( int min, int max );
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentityattributevalue/TrackedEntityAttributeValueService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentityattributevalue/TrackedEntityAttributeValueService.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentityattributevalue/TrackedEntityAttributeValueService.java	2015-06-16 13:17:59 +0000
@@ -29,6 +29,7 @@
  */
 
 import java.util.Collection;
+import java.util.List;
 
 import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
 import org.hisp.dhis.trackedentity.TrackedEntityInstance;
@@ -80,7 +81,7 @@
      * 
      * @return TrackedEntityAttributeValue list
      */
-    Collection<TrackedEntityAttributeValue> getTrackedEntityAttributeValues( TrackedEntityInstance instance );
+    List<TrackedEntityAttributeValue> getTrackedEntityAttributeValues( TrackedEntityInstance instance );
 
     /**
      * Retrieve {@link TrackedEntityAttributeValue} of a {@link TrackedEntityAttribute}
@@ -89,7 +90,7 @@
      * 
      * @return TrackedEntityAttributeValue list
      */
-    Collection<TrackedEntityAttributeValue> getTrackedEntityAttributeValues( TrackedEntityAttribute attribute );
+    List<TrackedEntityAttributeValue> getTrackedEntityAttributeValues( TrackedEntityAttribute attribute );
 
     /**
      * Retrieve {@link TrackedEntityAttributeValue} of a instance list
@@ -98,7 +99,7 @@
      * 
      * @return TrackedEntityAttributeValue list
      */
-    Collection<TrackedEntityAttributeValue> getTrackedEntityAttributeValues( Collection<TrackedEntityInstance> instances );
+    List<TrackedEntityAttributeValue> getTrackedEntityAttributeValues( Collection<TrackedEntityInstance> instances );
 
     /**
      * Search TrackedEntityAttributeValue objects by a TrackedEntityAttribute and a attribute
@@ -109,7 +110,7 @@
      * 
      * @return TrackedEntityAttributeValue list
      */
-    Collection<TrackedEntityAttributeValue> searchTrackedEntityAttributeValue( TrackedEntityAttribute attribute, String searchText );
+    List<TrackedEntityAttributeValue> searchTrackedEntityAttributeValue( TrackedEntityAttribute attribute, String searchText );
 
     /**
      * Remove all attribute values of destination instance and copy attribute

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentityattributevalue/TrackedEntityAttributeValueStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentityattributevalue/TrackedEntityAttributeValueStore.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentityattributevalue/TrackedEntityAttributeValueStore.java	2015-06-16 13:17:59 +0000
@@ -29,6 +29,7 @@
  */
 
 import java.util.Collection;
+import java.util.List;
 
 import org.hisp.dhis.common.GenericStore;
 import org.hisp.dhis.program.Program;
@@ -79,7 +80,7 @@
      * 
      * @return TrackedEntityAttributeValue list
      */
-    Collection<TrackedEntityAttributeValue> get( TrackedEntityInstance instance );
+    List<TrackedEntityAttributeValue> get( TrackedEntityInstance instance );
 
     /**
      * Retrieve {@link TrackedEntityAttributeValue} of a
@@ -89,7 +90,7 @@
      * 
      * @return TrackedEntityAttributeValue list
      */
-    Collection<TrackedEntityAttributeValue> get( TrackedEntityAttribute attribute );
+    List<TrackedEntityAttributeValue> get( TrackedEntityAttribute attribute );
 
     /**
      * Retrieve {@link TrackedEntityAttributeValue} of a instance list
@@ -98,7 +99,7 @@
      * 
      * @return TrackedEntityAttributeValue list
      */
-    Collection<TrackedEntityAttributeValue> get( Collection<TrackedEntityInstance> instances );
+    List<TrackedEntityAttributeValue> get( Collection<TrackedEntityInstance> instances );
 
     /**
      * Search TrackedEntityAttributeValue objects by a TrackedEntityAttribute
@@ -109,7 +110,7 @@
      * 
      * @return TrackedEntityAttributeValue list
      */
-    Collection<TrackedEntityAttributeValue> searchByValue( TrackedEntityAttribute attribute, String searchText );
+    List<TrackedEntityAttributeValue> searchByValue( TrackedEntityAttribute attribute, String searchText );
 
     /**
      * Retrieve attribute values of an instance by a program
@@ -119,5 +120,5 @@
      * 
      * @return TrackedEntityAttributeValue list
      */
-    Collection<TrackedEntityAttributeValue> get( TrackedEntityInstance instance, Program program );
+    List<TrackedEntityAttributeValue> get( TrackedEntityInstance instance, Program program );
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueService.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueService.java	2015-06-16 13:17:59 +0000
@@ -30,6 +30,7 @@
 
 import java.util.Collection;
 import java.util.Date;
+import java.util.List;
 
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.program.ProgramStageInstance;
@@ -82,7 +83,7 @@
      * 
      * @return TrackedEntityDataValue list
      */
-    Collection<TrackedEntityDataValue> getTrackedEntityDataValues( ProgramStageInstance programStageInstance );
+    List<TrackedEntityDataValue> getTrackedEntityDataValues( ProgramStageInstance programStageInstance );
 
     /**
      * Retrieve data values of a event with data elements specified
@@ -92,7 +93,7 @@
      * 
      * @return TrackedEntityDataValue list
      */
-    Collection<TrackedEntityDataValue> getTrackedEntityDataValues( ProgramStageInstance programStageInstance,
+    List<TrackedEntityDataValue> getTrackedEntityDataValues( ProgramStageInstance programStageInstance,
         Collection<DataElement> dataElement );
 
     /**
@@ -102,7 +103,7 @@
      * 
      * @return TrackedEntityDataValue list
      */
-    Collection<TrackedEntityDataValue> getTrackedEntityDataValues( Collection<ProgramStageInstance> programStageInstances );
+    List<TrackedEntityDataValue> getTrackedEntityDataValues( Collection<ProgramStageInstance> programStageInstances );
 
     /**
      * Retrieve data values of a data element
@@ -111,7 +112,7 @@
      * 
      * @return TrackedEntityDataValue list
      */
-    Collection<TrackedEntityDataValue> getTrackedEntityDataValues( DataElement dataElement );
+    List<TrackedEntityDataValue> getTrackedEntityDataValues( DataElement dataElement );
 
     /**
      * Retrieve data values of a instance on data elements specified from
@@ -124,7 +125,7 @@
      * 
      * @return TrackedEntityDataValue list
      */
-    Collection<TrackedEntityDataValue> getTrackedEntityDataValues( TrackedEntityInstance instance, Collection<DataElement> dataElements,
+    List<TrackedEntityDataValue> getTrackedEntityDataValues( TrackedEntityInstance instance, Collection<DataElement> dataElements,
         Date after, Date before );
 
     /**

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueStore.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueStore.java	2015-06-16 13:17:59 +0000
@@ -30,6 +30,7 @@
 
 import java.util.Collection;
 import java.util.Date;
+import java.util.List;
 
 import org.hisp.dhis.common.GenericStore;
 import org.hisp.dhis.dataelement.DataElement;
@@ -69,7 +70,7 @@
      * 
      * @return TrackedEntityDataValue list
      */
-    Collection<TrackedEntityDataValue> get( ProgramStageInstance programStageInstance );
+    List<TrackedEntityDataValue> get( ProgramStageInstance programStageInstance );
 
     /**
      * Retrieve data values of a event with data elements specified
@@ -79,7 +80,7 @@
      * 
      * @return TrackedEntityDataValue list
      */
-    Collection<TrackedEntityDataValue> get( ProgramStageInstance programStageInstance,
+    List<TrackedEntityDataValue> get( ProgramStageInstance programStageInstance,
         Collection<DataElement> dataElements );
 
     /**
@@ -89,7 +90,7 @@
      * 
      * @return TrackedEntityDataValue list
      */
-    Collection<TrackedEntityDataValue> get( Collection<ProgramStageInstance> programStageInstances );
+    List<TrackedEntityDataValue> get( Collection<ProgramStageInstance> programStageInstances );
 
     /**
      * Retrieve data values on a data element
@@ -98,7 +99,7 @@
      * 
      * @return TrackedEntityDataValue list
      */
-    Collection<TrackedEntityDataValue> get( DataElement dataElement );
+    List<TrackedEntityDataValue> get( DataElement dataElement );
 
     /**
      * Retrieve data values of a {@link TrackedEntityInstance} on a
@@ -111,7 +112,7 @@
      * 
      * @return TrackedEntityDataValue list
      */
-    Collection<TrackedEntityDataValue> get( TrackedEntityInstance instance, Collection<DataElement> dataElements,
+    List<TrackedEntityDataValue> get( TrackedEntityInstance instance, Collection<DataElement> dataElements,
         Date after, Date before );
 
     /**

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramDataEntryService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramDataEntryService.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramDataEntryService.java	2015-06-16 13:17:59 +0000
@@ -30,6 +30,7 @@
 
 import java.util.Collection;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -826,7 +827,7 @@
             return null;
         }
         
-        Collection<DataElement> dataElements = programStage.getAllDataElements();
+        List<DataElement> dataElements = programStage.getAllDataElements();
 
         Map<String, DataElement> map = new HashMap<>();
 

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramIndicatorService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramIndicatorService.java	2015-06-15 13:44:20 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramIndicatorService.java	2015-06-16 13:17:59 +0000
@@ -34,6 +34,7 @@
 import java.util.Date;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.regex.Matcher;
@@ -176,7 +177,7 @@
     }
 
     @Override
-    public Collection<ProgramIndicator> getAllProgramIndicators()
+    public List<ProgramIndicator> getAllProgramIndicators()
     {
         return i18n( i18nService, programIndicatorStore.getAll() );
     }

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java	2015-05-18 17:05:23 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java	2015-06-16 13:17:59 +0000
@@ -189,71 +189,71 @@
     }
 
     @Override
-    public Collection<ProgramInstance> getProgramInstances( Program program )
+    public List<ProgramInstance> getProgramInstances( Program program )
     {
         return programInstanceStore.get( program );
     }
 
     @Override
-    public Collection<ProgramInstance> getProgramInstances( Collection<Program> programs )
+    public List<ProgramInstance> getProgramInstances( Collection<Program> programs )
     {
         return programInstanceStore.get( programs );
     }
 
     @Override
-    public Collection<ProgramInstance> getProgramInstances( Collection<Program> programs,
+    public List<ProgramInstance> getProgramInstances( Collection<Program> programs,
         OrganisationUnit organisationUnit )
     {
         return programInstanceStore.get( programs, organisationUnit );
     }
 
     @Override
-    public Collection<ProgramInstance> getProgramInstances( Collection<Program> programs,
+    public List<ProgramInstance> getProgramInstances( Collection<Program> programs,
         OrganisationUnit organisationUnit, int status )
     {
         return programInstanceStore.get( programs, organisationUnit, status );
     }
 
     @Override
-    public Collection<ProgramInstance> getProgramInstances( Collection<Program> programs, Integer status )
+    public List<ProgramInstance> getProgramInstances( Collection<Program> programs, Integer status )
     {
         return programInstanceStore.get( programs, status );
     }
 
     @Override
-    public Collection<ProgramInstance> getProgramInstances( Program program, Integer status )
+    public List<ProgramInstance> getProgramInstances( Program program, Integer status )
     {
         return programInstanceStore.get( program, status );
     }
 
     @Override
-    public Collection<ProgramInstance> getProgramInstances( TrackedEntityInstance entityInstance, Integer status )
+    public List<ProgramInstance> getProgramInstances( TrackedEntityInstance entityInstance, Integer status )
     {
         return programInstanceStore.get( entityInstance, status );
     }
 
     @Override
-    public Collection<ProgramInstance> getProgramInstances( TrackedEntityInstance entityInstance, Program program )
+    public List<ProgramInstance> getProgramInstances( TrackedEntityInstance entityInstance, Program program )
     {
         return programInstanceStore.get( entityInstance, program );
     }
 
     @Override
-    public Collection<ProgramInstance> getProgramInstances( TrackedEntityInstance entityInstance, Program program,
+    public List<ProgramInstance> getProgramInstances( TrackedEntityInstance entityInstance, Program program,
         Integer status )
     {
         return programInstanceStore.get( entityInstance, program, status );
     }
 
     @Override
-    public Collection<ProgramInstance> getProgramInstances( Program program, OrganisationUnit organisationUnit,
+    public List<ProgramInstance> getProgramInstances( Program program, OrganisationUnit organisationUnit,
         Integer min, Integer max )
     {
         return programInstanceStore.get( program, organisationUnit, min, max );
     }
 
     @Override
-    public Collection<ProgramInstance> getProgramInstances( Program program, Collection<Integer> orgunitIds,
+    public List<ProgramInstance> getProgramInstances( Program program, Collection<Integer> orgunitIds,
         Date startDate, Date endDate, Integer min, Integer max )
     {
         return programInstanceStore.get( program, orgunitIds, startDate, endDate, min, max );
@@ -441,14 +441,14 @@
     }
 
     @Override
-    public Collection<ProgramInstance> getProgramInstancesByStatus( Integer status, Program program,
+    public List<ProgramInstance> getProgramInstancesByStatus( Integer status, Program program,
         Collection<Integer> orgunitIds, Date startDate, Date endDate )
     {
         return programInstanceStore.getByStatus( status, program, orgunitIds, startDate, endDate );
     }
 
     @Override
-    public Collection<ProgramInstance> getProgramInstancesByStatus( Integer status, Program program,
+    public List<ProgramInstance> getProgramInstancesByStatus( Integer status, Program program,
         Collection<Integer> orgunitIds, Date startDate, Date endDate, Integer min, Integer max )
     {
         return programInstanceStore.getByStatus( status, program, orgunitIds, startDate, endDate, min, max );

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramService.java	2015-06-10 15:56:53 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramService.java	2015-06-16 13:17:59 +0000
@@ -33,6 +33,7 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 
 import org.hisp.dhis.i18n.I18nService;
@@ -109,7 +110,7 @@
     }
 
     @Override
-    public Collection<Program> getAllPrograms()
+    public List<Program> getAllPrograms()
     {
         return i18n( i18nService, programStore.getAll() );
     }
@@ -127,15 +128,15 @@
     }
 
     @Override
-    public Collection<Program> getPrograms( OrganisationUnit organisationUnit )
+    public List<Program> getPrograms( OrganisationUnit organisationUnit )
     {
         return i18n( i18nService, programStore.get( organisationUnit ) );
     }
 
     @Override
-    public Collection<Program> getPrograms( ValidationCriteria validationCriteria )
+    public List<Program> getPrograms( ValidationCriteria validationCriteria )
     {
-        Set<Program> programs = new HashSet<>();
+        List<Program> programs = new ArrayList<>();
 
         for ( Program program : getAllPrograms() )
         {
@@ -149,31 +150,31 @@
     }
 
     @Override
-    public Collection<Program> getPrograms( int type )
+    public List<Program> getPrograms( int type )
     {
         return i18n( i18nService, programStore.getByType( type ) );
     }
 
     @Override
-    public Collection<Program> getPrograms( int type, OrganisationUnit orgunit )
+    public List<Program> getPrograms( int type, OrganisationUnit orgunit )
     {
         return i18n( i18nService, programStore.get( type, orgunit ) );
     }
 
     @Override
-    public Collection<Program> getProgramsByCurrentUser()
+    public List<Program> getProgramsByCurrentUser()
     {
         return i18n( i18nService, getByCurrentUser() );
     }
 
     @Override
-    public Collection<Program> getProgramsByUser( User user )
+    public List<Program> getProgramsByUser( User user )
     {
         return i18n( i18nService, getByUser( user ) );
     }
 
     @Override
-    public Collection<Program> getProgramsByCurrentUser( int type )
+    public List<Program> getProgramsByCurrentUser( int type )
     {
         return i18n( i18nService, getByCurrentUser( type ) );
     }
@@ -185,16 +186,16 @@
     }
 
     @Override
-    public Collection<Program> getProgramsByCurrentUser( OrganisationUnit organisationUnit )
+    public List<Program> getProgramsByCurrentUser( OrganisationUnit organisationUnit )
     {
-        Collection<Program> programs = new ArrayList<>( getPrograms( organisationUnit ) );
+        List<Program> programs = new ArrayList<>( getPrograms( organisationUnit ) );
         programs.retainAll( getProgramsByCurrentUser() );
 
         return programs;
     }
 
     @Override
-    public Collection<Program> getProgramsByTrackedEntity( TrackedEntity trackedEntity )
+    public List<Program> getProgramsByTrackedEntity( TrackedEntity trackedEntity )
     {
         return i18n( i18nService, programStore.getByTrackedEntity( trackedEntity ) );
     }
@@ -206,7 +207,7 @@
     }
 
     @Override
-    public Collection<Program> getProgramBetweenByName( String name, int min, int max )
+    public List<Program> getProgramBetweenByName( String name, int min, int max )
     {
         return i18n( i18nService, programStore.getAllLikeName( name, min, max ) );
     }
@@ -218,20 +219,20 @@
     }
 
     @Override
-    public Collection<Program> getProgramsBetween( int min, int max )
+    public List<Program> getProgramsBetween( int min, int max )
     {
         return i18n( i18nService, programStore.getAllOrderedName( min, max ) );
     }
 
     @Override
-    public Collection<Program> getByCurrentUser()
+    public List<Program> getByCurrentUser()
     {
         return getByUser( currentUserService.getCurrentUser() );
     }
 
-    public Collection<Program> getByUser( User user )
+    public List<Program> getByUser( User user )
     {
-        Collection<Program> programs = new HashSet<>();
+        List<Program> programs = new ArrayList<>();
 
         if ( user != null && !user.isSuper() )
         {
@@ -255,9 +256,9 @@
     }
 
     @Override
-    public Collection<Program> getByCurrentUser( int type )
+    public List<Program> getByCurrentUser( int type )
     {
-        Collection<Program> programs = new HashSet<>();
+        List<Program> programs = new ArrayList<>();
 
         if ( currentUserService.getCurrentUser() != null && !currentUserService.currentUserIsSuper() )
         {

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramStageDataElementService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramStageDataElementService.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramStageDataElementService.java	2015-06-16 13:17:59 +0000
@@ -28,11 +28,11 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.util.List;
+
 import org.hisp.dhis.dataelement.DataElement;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.Collection;
-
 /**
  * @author Viet Nguyen
  */
@@ -68,7 +68,7 @@
     }
 
     @Override
-    public Collection<ProgramStageDataElement> getAllProgramStageDataElements()
+    public List<ProgramStageDataElement> getAllProgramStageDataElements()
     {
         return programStageDataElementStore.getAll();
     }

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java	2015-05-18 17:05:23 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java	2015-06-16 13:17:59 +0000
@@ -153,7 +153,7 @@
     }
 
     @Override
-    public Collection<ProgramStageInstance> getProgramStageInstances( Collection<ProgramInstance> programInstances,
+    public List<ProgramStageInstance> getProgramStageInstances( Collection<ProgramInstance> programInstances,
         EventStatus status )
     {
         return programStageInstanceStore.get( programInstances, status );

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramValidationService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramValidationService.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramValidationService.java	2015-06-16 13:17:59 +0000
@@ -33,10 +33,11 @@
 import static org.hisp.dhis.program.ProgramExpression.SEPARATOR_ID;
 import static org.hisp.dhis.program.ProgramExpression.SEPARATOR_OBJECT;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -99,7 +100,7 @@
     }
 
     @Override
-    public Collection<ProgramValidation> getAllProgramValidation()
+    public List<ProgramValidation> getAllProgramValidation()
     {
         return validationStore.getAll();
     }
@@ -111,10 +112,10 @@
     }
 
     @Override
-    public Collection<ProgramValidationResult> validate( Collection<ProgramValidation> validation,
+    public List<ProgramValidationResult> validate( Collection<ProgramValidation> validation,
         ProgramStageInstance programStageInstance )
     {
-        Collection<ProgramValidationResult> result = new HashSet<>();
+        List<ProgramValidationResult> result = new ArrayList<>();
 
         // ---------------------------------------------------------------------
         // Get data-values
@@ -188,15 +189,15 @@
     }
 
     @Override
-    public Collection<ProgramValidation> getProgramValidation( Program program )
+    public List<ProgramValidation> getProgramValidation( Program program )
     {
         return validationStore.get( program );
     }
 
     @Override
-    public Collection<ProgramValidation> getProgramValidation( ProgramStage programStage )
+    public List<ProgramValidation> getProgramValidation( ProgramStage programStage )
     {
-        Collection<ProgramValidation> programValidation = getProgramValidation( programStage.getProgram() );
+        List<ProgramValidation> programValidation = getProgramValidation( programStage.getProgram() );
 
         Iterator<ProgramValidation> iter = programValidation.iterator();
 

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramInstanceStore.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramInstanceStore.java	2015-06-15 13:44:20 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramInstanceStore.java	2015-06-16 13:17:59 +0000
@@ -67,14 +67,14 @@
 
     @Override
     @SuppressWarnings("unchecked")
-    public Collection<ProgramInstance> get( Program program )
+    public List<ProgramInstance> get( Program program )
     {
         return getCriteria( Restrictions.eq( "program", program ) ).list();
     }
 
     @Override
     @SuppressWarnings("unchecked")
-    public Collection<ProgramInstance> get( Collection<Program> programs )
+    public List<ProgramInstance> get( Collection<Program> programs )
     {
         if ( programs == null || programs.isEmpty() )
         {
@@ -86,7 +86,7 @@
 
     @Override
     @SuppressWarnings("unchecked")
-    public Collection<ProgramInstance> get( Collection<Program> programs, OrganisationUnit organisationUnit )
+    public List<ProgramInstance> get( Collection<Program> programs, OrganisationUnit organisationUnit )
     {
         if ( programs == null || programs.isEmpty() )
         {
@@ -101,7 +101,7 @@
 
     @Override
     @SuppressWarnings("unchecked")
-    public Collection<ProgramInstance> get( Collection<Program> programs, OrganisationUnit organisationUnit, int status )
+    public List<ProgramInstance> get( Collection<Program> programs, OrganisationUnit organisationUnit, int status )
     {
         if ( programs == null || programs.isEmpty() )
         {
@@ -117,14 +117,14 @@
 
     @Override
     @SuppressWarnings("unchecked")
-    public Collection<ProgramInstance> get( Program program, Integer status )
+    public List<ProgramInstance> get( Program program, Integer status )
     {
         return getCriteria( Restrictions.eq( "program", program ), Restrictions.eq( "status", status ) ).list();
     }
 
     @Override
     @SuppressWarnings("unchecked")
-    public Collection<ProgramInstance> get( Collection<Program> programs, Integer status )
+    public List<ProgramInstance> get( Collection<Program> programs, Integer status )
     {
         if ( programs == null || programs.isEmpty() )
         {
@@ -136,21 +136,21 @@
 
     @Override
     @SuppressWarnings("unchecked")
-    public Collection<ProgramInstance> get( TrackedEntityInstance entityInstance, Integer status )
+    public List<ProgramInstance> get( TrackedEntityInstance entityInstance, Integer status )
     {
         return getCriteria( Restrictions.eq( "entityInstance", entityInstance ), Restrictions.eq( "status", status ) ).list();
     }
 
     @Override
     @SuppressWarnings("unchecked")
-    public Collection<ProgramInstance> get( TrackedEntityInstance entityInstance, Program program )
+    public List<ProgramInstance> get( TrackedEntityInstance entityInstance, Program program )
     {
         return getCriteria( Restrictions.eq( "entityInstance", entityInstance ), Restrictions.eq( "program", program ) ).list();
     }
 
     @Override
     @SuppressWarnings("unchecked")
-    public Collection<ProgramInstance> get( TrackedEntityInstance entityInstance, Program program, Integer status )
+    public List<ProgramInstance> get( TrackedEntityInstance entityInstance, Program program, Integer status )
     {
         return getCriteria( Restrictions.eq( "entityInstance", entityInstance ), Restrictions.eq( "program", program ),
             Restrictions.eq( "status", status ) ).list();
@@ -158,7 +158,7 @@
 
     @Override
     @SuppressWarnings("unchecked")
-    public Collection<ProgramInstance> get( Program program, OrganisationUnit organisationUnit, Integer min, Integer max )
+    public List<ProgramInstance> get( Program program, OrganisationUnit organisationUnit, Integer min, Integer max )
     {
         Criteria criteria = getCriteria(
             Restrictions.eq( "program", program ), Restrictions.isNull( "endDate" ) ).
@@ -181,7 +181,7 @@
 
     @Override
     @SuppressWarnings("unchecked")
-    public Collection<ProgramInstance> get( Program program, Collection<Integer> orgunitIds, Date startDate,
+    public List<ProgramInstance> get( Program program, Collection<Integer> orgunitIds, Date startDate,
         Date endDate, Integer min, Integer max )
     {
         Criteria criteria = getCriteria( Restrictions.eq( "program", program ),
@@ -246,7 +246,7 @@
 
     @Override
     @SuppressWarnings( "unchecked" )
-    public Collection<ProgramInstance> getByStatus( Integer status, Program program, Collection<Integer> orgunitIds,
+    public List<ProgramInstance> getByStatus( Integer status, Program program, Collection<Integer> orgunitIds,
         Date startDate, Date endDate )
     {
         return getCriteria(
@@ -260,7 +260,7 @@
 
     @Override
     @SuppressWarnings("unchecked")
-    public Collection<ProgramInstance> getByStatus( Integer status, Program program, Collection<Integer> orgunitIds,
+    public List<ProgramInstance> getByStatus( Integer status, Program program, Collection<Integer> orgunitIds,
         Date startDate, Date endDate, Integer min, Integer max )
     {
         Criteria criteria = getCriteria(

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java	2015-06-15 13:44:20 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java	2015-06-16 13:17:59 +0000
@@ -99,7 +99,7 @@
 
     @Override
     @SuppressWarnings( "unchecked" )
-    public Collection<ProgramStageInstance> get( Collection<ProgramInstance> programInstances, EventStatus status )
+    public List<ProgramStageInstance> get( Collection<ProgramInstance> programInstances, EventStatus status )
     {
         return getCriteria( 
             Restrictions.in( "programInstance", programInstances ), 

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStore.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStore.java	2015-02-13 08:50:17 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStore.java	2015-06-16 13:17:59 +0000
@@ -29,6 +29,7 @@
  */
 
 import java.util.Collection;
+import java.util.List;
 
 import org.hibernate.Criteria;
 import org.hibernate.criterion.Restrictions;
@@ -51,14 +52,14 @@
 
     @SuppressWarnings( "unchecked" )
     @Override
-    public Collection<Program> getByType( int type )
+    public List<Program> getByType( int type )
     {
         return getCriteria( Restrictions.eq( "type", type ) ).list();
     }
 
     @SuppressWarnings( "unchecked" )
     @Override
-    public Collection<Program> get( OrganisationUnit organisationUnit )
+    public List<Program> get( OrganisationUnit organisationUnit )
     {
         Criteria criteria = getCriteria();
         criteria.createAlias( "organisationUnits", "orgunit" );
@@ -68,7 +69,7 @@
 
     @SuppressWarnings( "unchecked" )
     @Override
-    public Collection<Program> get( int type, OrganisationUnit organisationUnit )
+    public List<Program> get( int type, OrganisationUnit organisationUnit )
     {
         Criteria criteria1 = getCriteria();
         criteria1.createAlias( "organisationUnits", "orgunit" );
@@ -79,7 +80,7 @@
 
     @Override
     @SuppressWarnings( "unchecked" )
-    public Collection<Program> getByTrackedEntity( TrackedEntity trackedEntity )
+    public List<Program> getByTrackedEntity( TrackedEntity trackedEntity )
     {
         return getCriteria( Restrictions.eq( "trackedEntity", trackedEntity ) ).list();
     }

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramValidationStore.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramValidationStore.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramValidationStore.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
+import java.util.List;
 
 import org.hibernate.criterion.Restrictions;
 import org.hisp.dhis.common.hibernate.HibernateIdentifiableObjectStore;
@@ -49,7 +49,7 @@
 
     @Override
     @SuppressWarnings( "unchecked" )
-    public Collection<ProgramValidation> get( Program program )
+    public List<ProgramValidation> get( Program program )
     {
         return getCriteria( Restrictions.eq( "program", program ) ).list();
     }

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/programrule/DefaultProgramRuleActionService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/programrule/DefaultProgramRuleActionService.java	2015-03-13 08:24:36 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/programrule/DefaultProgramRuleActionService.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,8 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
+import java.util.List;
+
 import org.springframework.transaction.annotation.Transactional;
 
 /**
@@ -78,13 +79,13 @@
     }
 
     @Override
-    public Collection<ProgramRuleAction> getAllProgramRuleAction()
+    public List<ProgramRuleAction> getAllProgramRuleAction()
     {
         return programRuleActionStore.getAll();
     }
 
     @Override
-    public Collection<ProgramRuleAction> getProgramRuleAction( ProgramRule programRule )
+    public List<ProgramRuleAction> getProgramRuleAction( ProgramRule programRule )
     {
         return programRuleActionStore.get( programRule );
     }

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/programrule/DefaultProgramRuleService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/programrule/DefaultProgramRuleService.java	2015-04-11 13:18:25 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/programrule/DefaultProgramRuleService.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
+import java.util.List;
 
 import org.hisp.dhis.program.Program;
 import org.springframework.transaction.annotation.Transactional;
@@ -86,19 +86,19 @@
     }
     
     @Override
-    public Collection<ProgramRule> getAllProgramRule()
+    public List<ProgramRule> getAllProgramRule()
     {
         return programRuleStore.getAll();
     }
 
     @Override
-    public Collection<ProgramRule> getProgramRule( Program program )
+    public List<ProgramRule> getProgramRule( Program program )
     {
         return programRuleStore.get( program );
     }
     
     @Override
-    public Collection<ProgramRule> getProgramRules( Program program, String key )
+    public List<ProgramRule> getProgramRules( Program program, String key )
     {
         return programRuleStore.get( program, key );
     }

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/programrule/DefaultProgramRuleVariableService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/programrule/DefaultProgramRuleVariableService.java	2015-03-13 08:24:36 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/programrule/DefaultProgramRuleVariableService.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
+import java.util.List;
 
 import org.hisp.dhis.program.Program;
 import org.springframework.transaction.annotation.Transactional;
@@ -80,13 +80,13 @@
     }
 
     @Override
-    public Collection<ProgramRuleVariable> getAllProgramRuleVariable()
+    public List<ProgramRuleVariable> getAllProgramRuleVariable()
     {
         return programRuleVariableStore.getAll();
     }
 
     @Override
-    public Collection<ProgramRuleVariable> getProgramRuleVariable( Program program )
+    public List<ProgramRuleVariable> getProgramRuleVariable( Program program )
     {
         return programRuleVariableStore.get( program );
     }

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/programrule/hibernate/HibernateProgramRuleActionStore.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/programrule/hibernate/HibernateProgramRuleActionStore.java	2015-03-13 08:24:36 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/programrule/hibernate/HibernateProgramRuleActionStore.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
+import java.util.List;
 
 import org.hibernate.criterion.Restrictions;
 import org.hisp.dhis.common.hibernate.HibernateIdentifiableObjectStore;
@@ -45,7 +45,7 @@
 {
     @Override
     @SuppressWarnings( "unchecked" )
-    public Collection<ProgramRuleAction> get( ProgramRule programRule )
+    public List<ProgramRuleAction> get( ProgramRule programRule )
     {
         return getCriteria( Restrictions.eq( "programRule", programRule ) ).list();
     }

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/programrule/hibernate/HibernateProgramRuleStore.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/programrule/hibernate/HibernateProgramRuleStore.java	2015-04-11 13:18:25 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/programrule/hibernate/HibernateProgramRuleStore.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
+import java.util.List;
 
 import org.hibernate.criterion.Order;
 import org.hibernate.criterion.Restrictions;
@@ -46,7 +46,7 @@
 {
     @Override
     @SuppressWarnings( "unchecked" )
-    public Collection<ProgramRule> get( Program program )
+    public List<ProgramRule> get( Program program )
     {
         return getCriteria( Restrictions.eq( "program", program ) ).list();
     }
@@ -60,7 +60,7 @@
     
     @Override
     @SuppressWarnings( "unchecked" )
-    public Collection<ProgramRule> get( Program program, String key )
+    public List<ProgramRule> get( Program program, String key )
     {
         return getSharingCriteria()
             .add( Restrictions.eq( "program", program ) )

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/programrule/hibernate/HibernateProgramRuleVariableStore.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/programrule/hibernate/HibernateProgramRuleVariableStore.java	2015-03-13 08:24:36 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/programrule/hibernate/HibernateProgramRuleVariableStore.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
+import java.util.List;
 
 import org.hibernate.criterion.Restrictions;
 import org.hisp.dhis.common.hibernate.HibernateIdentifiableObjectStore;
@@ -45,7 +45,7 @@
 {
     @Override
     @SuppressWarnings( "unchecked" )
-    public Collection<ProgramRuleVariable> get( Program program )
+    public List<ProgramRuleVariable> get( Program program )
     {
         return getCriteria( Restrictions.eq( "program", program ) ).list();
     }

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/relationship/DefaultRelationshipService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/relationship/DefaultRelationshipService.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/relationship/DefaultRelationshipService.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
+import java.util.List;
 
 import org.apache.commons.lang3.NotImplementedException;
 import org.hisp.dhis.trackedentity.TrackedEntityInstance;
@@ -69,7 +69,7 @@
     }
 
     @Override
-    public Collection<Relationship> getRelationshipsForTrackedEntityInstance( TrackedEntityInstance instance )
+    public List<Relationship> getRelationshipsForTrackedEntityInstance( TrackedEntityInstance instance )
     {
         return relationshipStore.getForTrackedEntityInstance( instance );
     }
@@ -93,7 +93,7 @@
     }
 
     @Override
-    public Collection<Relationship> getRelationships( TrackedEntityInstance entityInstanceA,
+    public List<Relationship> getRelationships( TrackedEntityInstance entityInstanceA,
         RelationshipType relationshipType )
     {
         throw new NotImplementedException("");

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/relationship/DefaultRelationshipTypeService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/relationship/DefaultRelationshipTypeService.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/relationship/DefaultRelationshipTypeService.java	2015-06-16 13:17:59 +0000
@@ -30,7 +30,7 @@
 
 import static org.hisp.dhis.i18n.I18nUtils.i18n;
 
-import java.util.Collection;
+import java.util.List;
 
 import org.hisp.dhis.i18n.I18nService;
 import org.springframework.transaction.annotation.Transactional;
@@ -71,7 +71,7 @@
     }
 
     @Override
-    public Collection<RelationshipType> getAllRelationshipTypes()
+    public List<RelationshipType> getAllRelationshipTypes()
     {
         return i18n( i18nService, relationshipTypeStore.getAll() );
     }
@@ -113,7 +113,7 @@
     }
 
     @Override
-    public Collection<? extends RelationshipType> getRelationshipTypesBetweenByName( String name, int min, int max )
+    public List<RelationshipType> getRelationshipTypesBetweenByName( String name, int min, int max )
     {
         return relationshipTypeStore.getAllLikeName( name, min, max );
     }
@@ -125,7 +125,7 @@
     }
 
     @Override
-    public Collection<RelationshipType> getRelationshipTypesBetween( int min, int max )
+    public List<RelationshipType> getRelationshipTypesBetween( int min, int max )
     {
         return relationshipTypeStore.getAllOrderedName( min, max );
     }

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/relationship/hibernate/HibernateRelationshipStore.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/relationship/hibernate/HibernateRelationshipStore.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/relationship/hibernate/HibernateRelationshipStore.java	2015-06-16 13:17:59 +0000
@@ -29,6 +29,7 @@
  */
 
 import java.util.Collection;
+import java.util.List;
 
 import org.hibernate.criterion.Restrictions;
 import org.hisp.dhis.hibernate.HibernateGenericStore;
@@ -46,7 +47,7 @@
 {
     @Override
     @SuppressWarnings( "unchecked" )
-    public Collection<Relationship> getForTrackedEntityInstance( TrackedEntityInstance instance )
+    public List<Relationship> getForTrackedEntityInstance( TrackedEntityInstance instance )
     {
         return getCriteria( 
             Restrictions.disjunction().add( 
@@ -56,7 +57,7 @@
 
     @Override
     @SuppressWarnings( "unchecked" )
-    public Collection<Relationship> getByRelationshipType( RelationshipType relationshipType )
+    public List<Relationship> getByRelationshipType( RelationshipType relationshipType )
     {
         return getCriteria( Restrictions.eq( "relationshipType", relationshipType ) ).list();
     }

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAttributeGroupService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAttributeGroupService.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAttributeGroupService.java	2015-06-16 13:17:59 +0000
@@ -30,7 +30,7 @@
 
 import static org.hisp.dhis.i18n.I18nUtils.i18n;
 
-import java.util.Collection;
+import java.util.List;
 
 import org.hisp.dhis.common.GenericIdentifiableObjectStore;
 import org.hisp.dhis.i18n.I18nService;
@@ -102,7 +102,7 @@
     }
 
     @Override
-    public Collection<TrackedEntityAttributeGroup> getAllTrackedEntityAttributeGroups()
+    public List<TrackedEntityAttributeGroup> getAllTrackedEntityAttributeGroups()
     {
         return i18n( i18nService, attributeGroupStore.getAll() );
     }
@@ -114,7 +114,7 @@
     }
 
     @Override
-    public Collection<TrackedEntityAttributeGroup> getTrackedEntityAttributeGroupsBetweenByName( String name, int min, int max )
+    public List<TrackedEntityAttributeGroup> getTrackedEntityAttributeGroupsBetweenByName( String name, int min, int max )
     {
         return attributeGroupStore.getAllLikeName( name, min, max );
     }
@@ -126,7 +126,7 @@
     }
 
     @Override
-    public Collection<TrackedEntityAttributeGroup> getTrackedEntityAttributeGroupsBetween( int min, int max )
+    public List<TrackedEntityAttributeGroup> getTrackedEntityAttributeGroupsBetween( int min, int max )
     {
         return attributeGroupStore.getAllOrderedName( min, max );
     }

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAttributeService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAttributeService.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAttributeService.java	2015-06-16 13:17:59 +0000
@@ -28,8 +28,8 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
-import java.util.HashSet;
+import java.util.ArrayList;
+import java.util.List;
 
 import org.hisp.dhis.program.Program;
 import org.hisp.dhis.program.ProgramService;
@@ -71,7 +71,7 @@
     }
 
     @Override
-    public Collection<TrackedEntityAttribute> getAllTrackedEntityAttributes()
+    public List<TrackedEntityAttribute> getAllTrackedEntityAttributes()
     {
         return attributeStore.getAll();
     }
@@ -113,13 +113,13 @@
     }
 
     @Override
-    public Collection<TrackedEntityAttribute> getOptionalAttributesWithoutGroup()
+    public List<TrackedEntityAttribute> getOptionalAttributesWithoutGroup()
     {
         return attributeStore.getOptionalAttributesWithoutGroup();
     }
 
     @Override
-    public Collection<TrackedEntityAttribute> getTrackedEntityAttributesWithoutGroup()
+    public List<TrackedEntityAttribute> getTrackedEntityAttributesWithoutGroup()
     {
         return attributeStore.getWithoutGroup();
     }
@@ -131,18 +131,18 @@
     }
 
     @Override
-    public Collection<TrackedEntityAttribute> getTrackedEntityAttributesByDisplayOnVisitSchedule(
+    public List<TrackedEntityAttribute> getTrackedEntityAttributesByDisplayOnVisitSchedule(
         boolean displayOnVisitSchedule )
     {
         return attributeStore.getByDisplayOnVisitSchedule( displayOnVisitSchedule );
     }
 
     @Override
-    public Collection<TrackedEntityAttribute> getTrackedEntityAttributesWithoutProgram()
+    public List<TrackedEntityAttribute> getTrackedEntityAttributesWithoutProgram()
     {
-        Collection<TrackedEntityAttribute> result = attributeStore.getAll();
+        List<TrackedEntityAttribute> result = attributeStore.getAll();
 
-        Collection<Program> programs = programService.getAllPrograms();
+        List<Program> programs = programService.getAllPrograms();
 
         if ( result != null )
         {
@@ -154,17 +154,17 @@
             return result;
         }
 
-        return new HashSet<>();
+        return new ArrayList<>();
     }
 
     @Override
-    public Collection<TrackedEntityAttribute> getTrackedEntityAttributesDisplayInList()
+    public List<TrackedEntityAttribute> getTrackedEntityAttributesDisplayInList()
     {
         return attributeStore.getDisplayInList();
     }
 
     @Override
-    public Collection<TrackedEntityAttribute> getTrackedEntityAttributesBetweenByName( String name, int min, int max )
+    public List<TrackedEntityAttribute> getTrackedEntityAttributesBetweenByName( String name, int min, int max )
     {
         return attributeStore.getAllLikeName( name, min, max );
     }
@@ -176,7 +176,7 @@
     }
 
     @Override
-    public Collection<TrackedEntityAttribute> getTrackedEntityAttributesBetween( int min, int max )
+    public List<TrackedEntityAttribute> getTrackedEntityAttributesBetween( int min, int max )
     {
         return attributeStore.getAllOrderedName( min, max );
     }

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAuditService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAuditService.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAuditService.java	2015-06-16 13:17:59 +0000
@@ -28,13 +28,9 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
 import java.util.Date;
+import java.util.List;
 
-import org.hisp.dhis.trackedentity.TrackedEntityInstance;
-import org.hisp.dhis.trackedentity.TrackedEntityAudit;
-import org.hisp.dhis.trackedentity.TrackedEntityAuditService;
-import org.hisp.dhis.trackedentity.TrackedEntityAuditStore;
 import org.springframework.transaction.annotation.Transactional;
 
 /**
@@ -78,7 +74,7 @@
     }
 
     @Override
-    public Collection<TrackedEntityAudit> getTrackedEntityAudits( TrackedEntityInstance instance )
+    public List<TrackedEntityAudit> getTrackedEntityAudits( TrackedEntityInstance instance )
     {
         return auditStore.get( instance );
     }

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityFormService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityFormService.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityFormService.java	2015-06-16 13:17:59 +0000
@@ -30,6 +30,7 @@
 
 import java.util.Collection;
 import java.util.Date;
+import java.util.List;
 import java.util.regex.Matcher;
 
 import org.apache.commons.lang3.StringUtils;
@@ -115,7 +116,7 @@
     }
 
     @Override
-    public Collection<TrackedEntityForm> getAllTrackedEntityForms()
+    public List<TrackedEntityForm> getAllTrackedEntityForms()
     {
         return formStore.getAll();
     }

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityService.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityService.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
+import java.util.List;
 
 import org.hisp.dhis.common.GenericIdentifiableObjectStore;
 import org.springframework.transaction.annotation.Transactional;
@@ -92,7 +92,7 @@
     }
 
     @Override
-    public Collection<TrackedEntity> getAllTrackedEntity()
+    public List<TrackedEntity> getAllTrackedEntity()
     {
         return trackedEntityStore.getAll();
     }
@@ -104,7 +104,7 @@
     }
 
     @Override
-    public Collection<TrackedEntity> getTrackedEntityBetweenByName( String name, int min, int max )
+    public List<TrackedEntity> getTrackedEntityBetweenByName( String name, int min, int max )
     {
         return trackedEntityStore.getAllLikeName( name, min, max );
     }
@@ -116,7 +116,7 @@
     }
 
     @Override
-    public Collection<TrackedEntity> getTrackedEntitysBetween( int min, int max )
+    public List<TrackedEntity> getTrackedEntitysBetween( int min, int max )
     {
         return trackedEntityStore.getAllOrderedName( min, max );
     }

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityAttributeStore.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityAttributeStore.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityAttributeStore.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
+import java.util.List;
 
 import org.hibernate.criterion.Restrictions;
 import org.hisp.dhis.common.hibernate.HibernateIdentifiableObjectStore;
@@ -48,28 +48,28 @@
 
     @Override
     @SuppressWarnings( "unchecked" )
-    public Collection<TrackedEntityAttribute> getOptionalAttributesWithoutGroup()
-    {
-        return getCriteria( Restrictions.isNull( "attributeGroup" ) ).list();
-    }
-
-    @Override
-    @SuppressWarnings( "unchecked" )
-    public Collection<TrackedEntityAttribute> getWithoutGroup()
-    {
-        return getCriteria( Restrictions.isNull( "attributeGroup" ) ).list();
-    }
-
-    @Override
-    @SuppressWarnings( "unchecked" )
-    public Collection<TrackedEntityAttribute> getByDisplayOnVisitSchedule( boolean displayOnVisitSchedule )
+    public List<TrackedEntityAttribute> getOptionalAttributesWithoutGroup()
+    {
+        return getCriteria( Restrictions.isNull( "attributeGroup" ) ).list();
+    }
+
+    @Override
+    @SuppressWarnings( "unchecked" )
+    public List<TrackedEntityAttribute> getWithoutGroup()
+    {
+        return getCriteria( Restrictions.isNull( "attributeGroup" ) ).list();
+    }
+
+    @Override
+    @SuppressWarnings( "unchecked" )
+    public List<TrackedEntityAttribute> getByDisplayOnVisitSchedule( boolean displayOnVisitSchedule )
     {
         return getCriteria( Restrictions.eq( "displayOnVisitSchedule", displayOnVisitSchedule ) ).list();
     }
 
     @Override
     @SuppressWarnings( "unchecked" )
-    public Collection<TrackedEntityAttribute> getDisplayInList()
+    public List<TrackedEntityAttribute> getDisplayInList()
     {
         return getCriteria( Restrictions.eq( "displayInListNoProgram", true ) ).list();
     }

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityAuditStore.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityAuditStore.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityAuditStore.java	2015-06-16 13:17:59 +0000
@@ -28,15 +28,15 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
 import java.util.Date;
+import java.util.List;
 
 import org.hibernate.criterion.Order;
 import org.hibernate.criterion.Restrictions;
 import org.hisp.dhis.hibernate.HibernateGenericStore;
-import org.hisp.dhis.trackedentity.TrackedEntityInstance;
 import org.hisp.dhis.trackedentity.TrackedEntityAudit;
 import org.hisp.dhis.trackedentity.TrackedEntityAuditStore;
+import org.hisp.dhis.trackedentity.TrackedEntityInstance;
 
 /**
  * @author Chau Thu Tran
@@ -47,7 +47,7 @@
 {
     @SuppressWarnings( "unchecked" )
     @Override
-    public Collection<TrackedEntityAudit> get( TrackedEntityInstance entityInstance )
+    public List<TrackedEntityAudit> get( TrackedEntityInstance entityInstance )
     {
         return getCriteria( Restrictions.eq( "entityInstance", entityInstance ) ).addOrder( Order.desc( "date" ) ).list();
     }

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentityattributevalue/DefaultTrackedEntityAttributeValueService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentityattributevalue/DefaultTrackedEntityAttributeValueService.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentityattributevalue/DefaultTrackedEntityAttributeValueService.java	2015-06-16 13:17:59 +0000
@@ -29,6 +29,7 @@
  */
 
 import java.util.Collection;
+import java.util.List;
 
 import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
 import org.hisp.dhis.trackedentity.TrackedEntityInstance;
@@ -70,19 +71,19 @@
     }
 
     @Override
-    public Collection<TrackedEntityAttributeValue> getTrackedEntityAttributeValues( TrackedEntityInstance instance )
+    public List<TrackedEntityAttributeValue> getTrackedEntityAttributeValues( TrackedEntityInstance instance )
     {
         return attributeValueStore.get( instance );
     }
 
     @Override
-    public Collection<TrackedEntityAttributeValue> getTrackedEntityAttributeValues( TrackedEntityAttribute attribute )
+    public List<TrackedEntityAttributeValue> getTrackedEntityAttributeValues( TrackedEntityAttribute attribute )
     {
         return attributeValueStore.get( attribute );
     }
 
     @Override
-    public Collection<TrackedEntityAttributeValue> getTrackedEntityAttributeValues(
+    public List<TrackedEntityAttributeValue> getTrackedEntityAttributeValues(
         Collection<TrackedEntityInstance> instances )
     {
         if ( instances != null && instances.size() > 0 )
@@ -113,7 +114,7 @@
     }
 
     @Override
-    public Collection<TrackedEntityAttributeValue> searchTrackedEntityAttributeValue( TrackedEntityAttribute attribute,
+    public List<TrackedEntityAttributeValue> searchTrackedEntityAttributeValue( TrackedEntityAttribute attribute,
         String searchText )
     {
         return attributeValueStore.searchByValue( attribute, searchText );

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentityattributevalue/hibernate/HibernateTrackedEntityAttributeValueStore.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentityattributevalue/hibernate/HibernateTrackedEntityAttributeValueStore.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentityattributevalue/hibernate/HibernateTrackedEntityAttributeValueStore.java	2015-06-16 13:17:59 +0000
@@ -30,6 +30,7 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.List;
 
 import org.hibernate.Query;
 import org.hibernate.criterion.Restrictions;
@@ -75,21 +76,21 @@
 
     @Override
     @SuppressWarnings( "unchecked" )
-    public Collection<TrackedEntityAttributeValue> get( TrackedEntityInstance entityInstance )
+    public List<TrackedEntityAttributeValue> get( TrackedEntityInstance entityInstance )
     {
         return getCriteria( Restrictions.eq( "entityInstance", entityInstance ) ).list();
     }
 
     @Override
     @SuppressWarnings( "unchecked" )
-    public Collection<TrackedEntityAttributeValue> get( TrackedEntityAttribute attribute )
+    public List<TrackedEntityAttributeValue> get( TrackedEntityAttribute attribute )
     {
         return getCriteria( Restrictions.eq( "attribute", attribute ) ).list();
     }
 
     @Override
     @SuppressWarnings( "unchecked" )
-    public Collection<TrackedEntityAttributeValue> get( Collection<TrackedEntityInstance> entityInstances )
+    public List<TrackedEntityAttributeValue> get( Collection<TrackedEntityInstance> entityInstances )
     {
         if ( entityInstances == null || entityInstances.isEmpty() )
         {
@@ -101,7 +102,7 @@
 
     @Override
     @SuppressWarnings( "unchecked" )
-    public Collection<TrackedEntityAttributeValue> searchByValue( TrackedEntityAttribute attribute, String searchText )
+    public List<TrackedEntityAttributeValue> searchByValue( TrackedEntityAttribute attribute, String searchText )
     {
         return getCriteria( 
             Restrictions.eq( "attribute", attribute ),
@@ -110,7 +111,7 @@
 
     @Override
     @SuppressWarnings( "unchecked" )
-    public Collection<TrackedEntityAttributeValue> get( TrackedEntityInstance entityInstance, Program program )
+    public List<TrackedEntityAttributeValue> get( TrackedEntityInstance entityInstance, Program program )
     {
         return getCriteria(
             Restrictions.and( Restrictions.eq( "entityInstance", entityInstance ),

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentitydatavalue/DefaultTrackedEntityDataValueService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentitydatavalue/DefaultTrackedEntityDataValueService.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentitydatavalue/DefaultTrackedEntityDataValueService.java	2015-06-16 13:17:59 +0000
@@ -35,6 +35,7 @@
 
 import java.util.Collection;
 import java.util.Date;
+import java.util.List;
 
 /**
  * @author Abyot Asalefew Gizaw
@@ -93,32 +94,32 @@
     }
 
     @Override
-    public Collection<TrackedEntityDataValue> getTrackedEntityDataValues( ProgramStageInstance programStageInstance )
+    public List<TrackedEntityDataValue> getTrackedEntityDataValues( ProgramStageInstance programStageInstance )
     {
         return dataValueStore.get( programStageInstance );
     }
 
     @Override
-    public Collection<TrackedEntityDataValue> getTrackedEntityDataValues( ProgramStageInstance programStageInstance,
+    public List<TrackedEntityDataValue> getTrackedEntityDataValues( ProgramStageInstance programStageInstance,
         Collection<DataElement> dataElements )
     {
         return dataValueStore.get( programStageInstance, dataElements );
     }
 
     @Override
-    public Collection<TrackedEntityDataValue> getTrackedEntityDataValues( Collection<ProgramStageInstance> programStageInstances )
+    public List<TrackedEntityDataValue> getTrackedEntityDataValues( Collection<ProgramStageInstance> programStageInstances )
     {
         return dataValueStore.get( programStageInstances );
     }
 
     @Override
-    public Collection<TrackedEntityDataValue> getTrackedEntityDataValues( DataElement dataElement )
+    public List<TrackedEntityDataValue> getTrackedEntityDataValues( DataElement dataElement )
     {
         return dataValueStore.get( dataElement );
     }
 
     @Override
-    public Collection<TrackedEntityDataValue> getTrackedEntityDataValues( TrackedEntityInstance entityInstance,
+    public List<TrackedEntityDataValue> getTrackedEntityDataValues( TrackedEntityInstance entityInstance,
         Collection<DataElement> dataElements, Date startDate, Date endDate )
     {
         return dataValueStore.get( entityInstance, dataElements, startDate, endDate );

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentitydatavalue/hibernate/HibernateTrackedEntityDataValueStore.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentitydatavalue/hibernate/HibernateTrackedEntityDataValueStore.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentitydatavalue/hibernate/HibernateTrackedEntityDataValueStore.java	2015-06-16 13:17:59 +0000
@@ -31,6 +31,7 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Date;
+import java.util.List;
 
 import org.hibernate.Criteria;
 import org.hibernate.Query;
@@ -65,14 +66,14 @@
 
     @Override
     @SuppressWarnings( "unchecked" )
-    public Collection<TrackedEntityDataValue> get( ProgramStageInstance programStageInstance )
+    public List<TrackedEntityDataValue> get( ProgramStageInstance programStageInstance )
     {
         return getCriteria( Restrictions.eq( "programStageInstance", programStageInstance ) ).list();
     }
 
     @Override
     @SuppressWarnings( "unchecked" )
-    public Collection<TrackedEntityDataValue> get( ProgramStageInstance programStageInstance,
+    public List<TrackedEntityDataValue> get( ProgramStageInstance programStageInstance,
         Collection<DataElement> dataElements )
     {
         if ( dataElements == null || dataElements.isEmpty() )
@@ -85,7 +86,7 @@
 
     @Override
     @SuppressWarnings( "unchecked" )
-    public Collection<TrackedEntityDataValue> get( Collection<ProgramStageInstance> programStageInstances )
+    public List<TrackedEntityDataValue> get( Collection<ProgramStageInstance> programStageInstances )
     {
         if ( programStageInstances == null || programStageInstances.isEmpty() )
         {
@@ -97,14 +98,14 @@
 
     @Override
     @SuppressWarnings( "unchecked" )
-    public Collection<TrackedEntityDataValue> get( DataElement dataElement )
+    public List<TrackedEntityDataValue> get( DataElement dataElement )
     {
         return getCriteria( Restrictions.eq( "dataElement", dataElement ) ).list();
     }
 
     @Override
     @SuppressWarnings( "unchecked" )
-    public Collection<TrackedEntityDataValue> get( TrackedEntityInstance entityInstance, Collection<DataElement> dataElements, Date startDate,
+    public List<TrackedEntityDataValue> get( TrackedEntityInstance entityInstance, Collection<DataElement> dataElements, Date startDate,
         Date endDate )
      {
         if ( dataElements == null || dataElements.isEmpty() )

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramInstanceServiceTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramInstanceServiceTest.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramInstanceServiceTest.java	2015-06-16 13:17:59 +0000
@@ -33,9 +33,11 @@
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Date;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 
 import org.hisp.dhis.DhisSpringTest;
@@ -263,7 +265,7 @@
         programInstanceService.addProgramInstance( programInstanceB );
         programInstanceService.addProgramInstance( programInstanceD );
 
-        Collection<ProgramInstance> programInstances = programInstanceService.getProgramInstances( programA );
+        List<ProgramInstance> programInstances = programInstanceService.getProgramInstances( programA );
         assertEquals( 2, programInstances.size() );
         assertTrue( programInstances.contains( programInstanceA ) );
         assertTrue( programInstances.contains( programInstanceD ) );
@@ -281,11 +283,11 @@
         programInstanceService.addProgramInstance( programInstanceC );
         programInstanceService.addProgramInstance( programInstanceD );
 
-        Collection<Program> programs = new HashSet<>();
+        List<Program> programs = new ArrayList<>();
         programs.add( programA );
         programs.add( programB );
 
-        Collection<ProgramInstance> programInstances = programInstanceService.getProgramInstances( programs );
+        List<ProgramInstance> programInstances = programInstanceService.getProgramInstances( programs );
         assertEquals( 3, programInstances.size() );
         assertTrue( programInstances.contains( programInstanceA ) );
         assertTrue( programInstances.contains( programInstanceB ) );
@@ -303,7 +305,7 @@
         programInstance.setStatus( ProgramInstance.STATUS_COMPLETED );
         programInstanceService.updateProgramInstance( programInstance );
 
-        Collection<ProgramInstance> programInstances = programInstanceService.getProgramInstances( entityInstanceA, programA );
+        List<ProgramInstance> programInstances = programInstanceService.getProgramInstances( entityInstanceA, programA );
         assertEquals( 2, programInstances.size() );
         assertTrue( programInstances.contains( programInstanceA ) );
         assertTrue( programInstances.contains( programInstance ) );
@@ -324,7 +326,7 @@
         programInstance2.setStatus( ProgramInstance.STATUS_COMPLETED );
         programInstanceService.updateProgramInstance( programInstance2 );
 
-        Collection<ProgramInstance> programInstances = programInstanceService.getProgramInstances( entityInstanceA, programA,
+        List<ProgramInstance> programInstances = programInstanceService.getProgramInstances( entityInstanceA, programA,
             ProgramInstance.STATUS_COMPLETED );
         assertEquals( 2, programInstances.size() );
         assertTrue( programInstances.contains( programInstance1 ) );
@@ -343,7 +345,7 @@
         programInstanceService.addProgramInstance( programInstanceC );
         programInstanceService.addProgramInstance( programInstanceD );
 
-        Collection<ProgramInstance> programInstances = programInstanceService.getProgramInstances( programA,
+        List<ProgramInstance> programInstances = programInstanceService.getProgramInstances( programA,
             organisationUnitA, 0, 10 );
         assertEquals( 1, programInstances.size() );
         assertTrue( programInstances.contains( programInstanceA ) );
@@ -356,7 +358,7 @@
         programInstanceService.addProgramInstance( programInstanceB );
         programInstanceService.addProgramInstance( programInstanceD );
 
-        Collection<ProgramInstance> programInstances = programInstanceService.getProgramInstances( programA,
+        List<ProgramInstance> programInstances = programInstanceService.getProgramInstances( programA,
             orgunitIds, incidenDate, enrollmentDate, null, null );
         assertEquals( 2, programInstances.size() );
         assertTrue( programInstances.contains( programInstanceA ) );
@@ -381,7 +383,7 @@
         programInstanceService.addProgramInstance( programInstanceB );
         programInstanceService.addProgramInstance( programInstanceD );
 
-        Collection<ProgramInstance> programInstances = programInstanceService.getProgramInstancesByStatus(
+        List<ProgramInstance> programInstances = programInstanceService.getProgramInstancesByStatus(
             ProgramInstance.STATUS_ACTIVE, programA, orgunitIds, incidenDate, enrollmentDate );
         assertEquals( 2, programInstances.size() );
         assertTrue( programInstances.contains( programInstanceA ) );

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramInstanceStoreTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramInstanceStoreTest.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramInstanceStoreTest.java	2015-06-16 13:17:59 +0000
@@ -31,9 +31,11 @@
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Date;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 
 import org.hisp.dhis.DhisSpringTest;
@@ -185,7 +187,7 @@
         programInstanceStore.save( programInstanceB );
         programInstanceStore.save( programInstanceD );
 
-        Collection<ProgramInstance> programInstances = programInstanceStore.get( programA );
+        List<ProgramInstance> programInstances = programInstanceStore.get( programA );
         assertEquals( 2, programInstances.size() );
         assertTrue( programInstances.contains( programInstanceA ) );
         assertTrue( programInstances.contains( programInstanceD ) );
@@ -203,11 +205,11 @@
         programInstanceStore.save( programInstanceC );
         programInstanceStore.save( programInstanceD );
 
-        Collection<Program> programs = new HashSet<>();
+        List<Program> programs = new ArrayList<>();
         programs.add( programA );
         programs.add( programB );
 
-        Collection<ProgramInstance> programInstances = programInstanceStore.get( programs );
+        List<ProgramInstance> programInstances = programInstanceStore.get( programs );
         assertEquals( 3, programInstances.size() );
         assertTrue( programInstances.contains( programInstanceA ) );
         assertTrue( programInstances.contains( programInstanceB ) );
@@ -222,7 +224,7 @@
         programInstanceStore.save( programInstanceC );
         programInstanceStore.save( programInstanceD );
 
-        Collection<ProgramInstance> programInstances = programInstanceStore.get( entityInstanceA, programC,
+        List<ProgramInstance> programInstances = programInstanceStore.get( entityInstanceA, programC,
             ProgramInstance.STATUS_COMPLETED );
         assertEquals( 1, programInstances.size() );
         assertTrue( programInstances.contains( programInstanceC ) );
@@ -239,7 +241,7 @@
         programInstanceStore.save( programInstanceC );
         programInstanceStore.save( programInstanceD );
 
-        Collection<ProgramInstance> programInstances = programInstanceStore.get( programA, organisationUnitA, 0, 10 );
+        List<ProgramInstance> programInstances = programInstanceStore.get( programA, organisationUnitA, 0, 10 );
         assertEquals( 1, programInstances.size() );
         assertTrue( programInstances.contains( programInstanceA ) );
     }
@@ -251,7 +253,7 @@
         programInstanceStore.save( programInstanceB );
         programInstanceStore.save( programInstanceD );
 
-        Collection<ProgramInstance> programInstances = programInstanceStore.get( programA, orgunitIds, incidenDate,
+        List<ProgramInstance> programInstances = programInstanceStore.get( programA, orgunitIds, incidenDate,
             enrollmentDate, null, null );
         assertEquals( 2, programInstances.size() );
         assertTrue( programInstances.contains( programInstanceA ) );
@@ -276,7 +278,7 @@
         programInstanceStore.save( programInstanceB );
         programInstanceStore.save( programInstanceD );
 
-        Collection<ProgramInstance> programInstances = programInstanceStore.getByStatus( ProgramInstance.STATUS_ACTIVE,
+        List<ProgramInstance> programInstances = programInstanceStore.getByStatus( ProgramInstance.STATUS_ACTIVE,
             programA, orgunitIds, incidenDate, enrollmentDate );
         assertEquals( 2, programInstances.size() );
         assertTrue( programInstances.contains( programInstanceA ) );

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramServiceTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramServiceTest.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramServiceTest.java	2015-06-16 13:17:59 +0000
@@ -33,8 +33,8 @@
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
-import java.util.Collection;
 import java.util.HashSet;
+import java.util.List;
 
 import org.hisp.dhis.DhisSpringTest;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
@@ -166,7 +166,7 @@
         programService.addProgram( programB );
         programService.addProgram( programC );
 
-        Collection<Program> programs = programService.getPrograms( organisationUnitA );
+        List<Program> programs = programService.getPrograms( organisationUnitA );
         assertTrue( equals( programs, programA, programB ) );
 
         programs = programService.getPrograms( organisationUnitB );
@@ -188,7 +188,7 @@
         programB.getValidationCriteria().add( validationCriteria );
         programService.updateProgram( programB );
 
-        Collection<Program> programs = programService.getPrograms( validationCriteria );
+        List<Program> programs = programService.getPrograms( validationCriteria );
         assertEquals( 2, programs.size() );
         assertTrue( programs.contains( programA ) );
         assertTrue( programs.contains( programB ) );
@@ -203,7 +203,7 @@
         programC.setType( Program.SINGLE_EVENT_WITH_REGISTRATION );
         programService.addProgram( programC );
 
-        Collection<Program> programs = programService.getPrograms( Program.MULTIPLE_EVENTS_WITH_REGISTRATION );
+        List<Program> programs = programService.getPrograms( Program.MULTIPLE_EVENTS_WITH_REGISTRATION );
         assertTrue( equals( programs, programA, programB ) );
 
         programs = programService.getPrograms( Program.SINGLE_EVENT_WITH_REGISTRATION );
@@ -217,7 +217,7 @@
         programService.addProgram( programB );
         programService.addProgram( programC );
 
-        Collection<Program> programs = programService.getPrograms( Program.MULTIPLE_EVENTS_WITH_REGISTRATION,
+        List<Program> programs = programService.getPrograms( Program.MULTIPLE_EVENTS_WITH_REGISTRATION,
             organisationUnitA );
         assertTrue( equals( programs, programA, programB ) );
     }

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramStageInstanceServiceTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramStageInstanceServiceTest.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramStageInstanceServiceTest.java	2015-06-16 13:17:59 +0000
@@ -33,7 +33,7 @@
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
-import java.util.Collection;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashSet;
 import java.util.List;
@@ -392,11 +392,11 @@
         programStageInstanceService.addProgramStageInstance( programStageInstanceC );
         programStageInstanceService.addProgramStageInstance( programStageInstanceD1 );
 
-        Collection<ProgramInstance> programInstances = new HashSet<>();
+        List<ProgramInstance> programInstances = new ArrayList<>();
         programInstances.add( programInstanceA );
         programInstances.add( programInstanceB );
 
-        Collection<ProgramStageInstance> stageInstances = programStageInstanceService.getProgramStageInstances(
+        List<ProgramStageInstance> stageInstances = programStageInstanceService.getProgramStageInstances(
             programInstances, EventStatus.COMPLETED );
         assertEquals( 2, stageInstances.size() );
         assertTrue( stageInstances.contains( programStageInstanceA ) );

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramStageInstanceStoreTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramStageInstanceStoreTest.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramStageInstanceStoreTest.java	2015-06-16 13:17:59 +0000
@@ -31,10 +31,11 @@
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
+import java.util.ArrayList;
 import java.util.Calendar;
-import java.util.Collection;
 import java.util.Date;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 
 import org.hisp.dhis.DhisSpringTest;
@@ -290,11 +291,11 @@
         programStageInstanceStore.save( programStageInstanceC );
         programStageInstanceStore.save( programStageInstanceD1 );
 
-        Collection<ProgramInstance> programInstances = new HashSet<>();
+        List<ProgramInstance> programInstances = new ArrayList<>();
         programInstances.add( programInstanceA );
         programInstances.add( programInstanceB );
 
-        Collection<ProgramStageInstance> stageInstances = programStageInstanceStore.get( programInstances, EventStatus.COMPLETED );
+        List<ProgramStageInstance> stageInstances = programStageInstanceStore.get( programInstances, EventStatus.COMPLETED );
         assertEquals( 2, stageInstances.size() );
         assertTrue( stageInstances.contains( programStageInstanceA ) );
         assertTrue( stageInstances.contains( programStageInstanceC ) );
@@ -319,7 +320,7 @@
         programStageInstanceStore.save( programStageInstanceA );
         programStageInstanceStore.save( programStageInstanceB );
 
-        Collection<Integer> orgunitIds = new HashSet<>();
+        List<Integer> orgunitIds = new ArrayList<>();
         orgunitIds.add( orgunitAId );
         orgunitIds.add( orgunitBId );
 

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramStoreTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramStoreTest.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramStoreTest.java	2015-06-16 13:17:59 +0000
@@ -30,8 +30,8 @@
 
 import static org.junit.Assert.assertTrue;
 
-import java.util.Collection;
 import java.util.HashSet;
+import java.util.List;
 
 import org.hisp.dhis.DhisSpringTest;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
@@ -93,7 +93,7 @@
         programC.setType( Program.SINGLE_EVENT_WITH_REGISTRATION );
         programStore.save( programC );
 
-        Collection<Program> programs = programStore.getByType( Program.MULTIPLE_EVENTS_WITH_REGISTRATION );
+        List<Program> programs = programStore.getByType( Program.MULTIPLE_EVENTS_WITH_REGISTRATION );
         assertTrue( equals( programs, programA, programB ) );
 
         programs = programStore.getByType( Program.SINGLE_EVENT_WITH_REGISTRATION );
@@ -107,7 +107,7 @@
         programStore.save( programB );
         programStore.save( programC );
 
-        Collection<Program> programs = programStore.get( Program.MULTIPLE_EVENTS_WITH_REGISTRATION, organisationUnitA );
+        List<Program> programs = programStore.get( Program.MULTIPLE_EVENTS_WITH_REGISTRATION, organisationUnitA );
         assertTrue( equals( programs, programA, programB ) );
     }
 }
\ No newline at end of file

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramValidationServiceTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramValidationServiceTest.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramValidationServiceTest.java	2015-06-16 13:17:59 +0000
@@ -33,9 +33,10 @@
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
-import java.util.Collection;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 
 import org.hisp.dhis.DhisSpringTest;
@@ -267,11 +268,11 @@
         programValidationService.addProgramValidation( validationA );
         programValidationService.addProgramValidation( validationB );
 
-        Collection<ProgramValidation> validationList = new HashSet<>();
+        List<ProgramValidation> validationList = new ArrayList<>();
         validationList.add( validationA );
         validationList.add( validationB );
 
-        Collection<ProgramValidationResult> result = programValidationService.validate( validationList, stageInstanceA );
+        List<ProgramValidationResult> result = programValidationService.validate( validationList, stageInstanceA );
         assertEquals( 1, result.size() );
         assertEquals( result.iterator().next().getProgramValidation(), validationB );
     }

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/programrule/ProgramRuleActionServiceTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/programrule/ProgramRuleActionServiceTest.java	2015-04-28 16:43:41 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/programrule/ProgramRuleActionServiceTest.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,13 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.List;
 
 import org.hisp.dhis.DhisSpringTest;
 import org.hisp.dhis.dataelement.DataElement;
@@ -38,8 +44,6 @@
 import org.junit.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 
-import static org.junit.Assert.*;
-
 public class ProgramRuleActionServiceTest
     extends DhisSpringTest
 {
@@ -108,12 +112,12 @@
         actionService.addProgramRuleAction( actionG );
         
         //Get all the 3 rules for programB
-        Collection<ProgramRuleAction> rules = actionService.getProgramRuleAction( programRuleB );
+        List<ProgramRuleAction> rules = actionService.getProgramRuleAction( programRuleB );
         assertEquals( 3, rules.size() );
         assertTrue( rules.contains( actionD ) );
         assertTrue( rules.contains( actionE ) );
         assertTrue( rules.contains( actionF ) );
-        //Make sure that the action connected to rule A is not returned as part of collection of actions in rule B.
+        //Make sure that the action connected to rule A is not returned as part of list of actions in rule B.
         assertFalse( rules.contains( actionG ) );
         
     }

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/programrule/ProgramRuleActionStoreTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/programrule/ProgramRuleActionStoreTest.java	2015-04-28 16:43:41 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/programrule/ProgramRuleActionStoreTest.java	2015-06-16 13:17:59 +0000
@@ -31,7 +31,7 @@
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
-import java.util.Collection;
+import java.util.List;
 
 import org.hisp.dhis.DhisSpringTest;
 import org.hisp.dhis.dataelement.DataElement;
@@ -83,7 +83,7 @@
         actionStore.save( actionB );
         actionStore.save( actionC );
         
-        Collection<ProgramRuleAction> vars = actionStore.get( programRuleA );
+        List<ProgramRuleAction> vars = actionStore.get( programRuleA );
         
         assertEquals( 3, vars.size() );
         assertTrue( vars.contains( actionA ) );

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/programrule/ProgramRuleServiceTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/programrule/ProgramRuleServiceTest.java	2015-06-11 18:44:52 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/programrule/ProgramRuleServiceTest.java	2015-06-16 13:17:59 +0000
@@ -28,8 +28,14 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 
 import org.hisp.dhis.DhisSpringTest;
@@ -40,8 +46,6 @@
 import org.junit.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 
-import static org.junit.Assert.*;
-
 public class ProgramRuleServiceTest
     extends DhisSpringTest
 {
@@ -136,12 +140,12 @@
         programRuleService.addProgramRule( ruleG );
         
         //Get all the 3 rules for programB
-        Collection<ProgramRule> rules = programRuleService.getProgramRule( programB );
+        List<ProgramRule> rules = programRuleService.getProgramRule( programB );
         assertEquals( 3, rules.size() );
         assertTrue( rules.contains( ruleD ) );
         assertTrue( rules.contains( ruleE ) );
         assertTrue( rules.contains( ruleF ) );
-        //Make sure that the rule connected to program A is not returned as part of collection of rules in program B.
+        //Make sure that the rule connected to program A is not returned as part of list of rules in program B.
         assertFalse( rules.contains( ruleG ) );
         
     }

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/programrule/ProgramRuleStoreTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/programrule/ProgramRuleStoreTest.java	2015-04-28 16:43:41 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/programrule/ProgramRuleStoreTest.java	2015-06-16 13:17:59 +0000
@@ -31,14 +31,14 @@
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
-import java.util.Collection;
+import java.util.List;
 
-import org.junit.Test;
 import org.hisp.dhis.DhisSpringTest;
 import org.hisp.dhis.program.Program;
 import org.hisp.dhis.program.ProgramStage;
 import org.hisp.dhis.program.ProgramStageStore;
 import org.hisp.dhis.program.ProgramStore;
+import org.junit.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 
 public class ProgramRuleStoreTest
@@ -78,7 +78,7 @@
         variableStore.save( ruleB );
         variableStore.save( ruleC );
         
-        Collection<ProgramRule> vars = variableStore.get( programA );
+        List<ProgramRule> vars = variableStore.get( programA );
         
         assertEquals( 3, vars.size() );
         assertTrue( vars.contains( ruleA ) );

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/programrule/ProgramRuleVariableServiceTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/programrule/ProgramRuleVariableServiceTest.java	2015-03-13 08:24:36 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/programrule/ProgramRuleVariableServiceTest.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,13 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.List;
 
 import org.hisp.dhis.DhisSpringTest;
 import org.hisp.dhis.dataelement.DataElement;
@@ -40,8 +46,6 @@
 import org.junit.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 
-import static org.junit.Assert.*;
-
 public class ProgramRuleVariableServiceTest
     extends DhisSpringTest
 {
@@ -112,12 +116,12 @@
         variableService.addProgramRuleVariable( variableG );
 
         //Get all the 3 rules for programB
-        Collection<ProgramRuleVariable> vars = variableService.getProgramRuleVariable( programB );
+        List<ProgramRuleVariable> vars = variableService.getProgramRuleVariable( programB );
         assertEquals( 3, vars.size() );
         assertTrue( vars.contains( variableD ) );
         assertTrue( vars.contains( variableE ) );
         assertTrue( vars.contains( variableF ) );
-        //Make sure that the var connected to program A is not returned as part of collection of vars in program B.
+        //Make sure that the var connected to program A is not returned as part of list of vars in program B.
         assertFalse( vars.contains( variableG ) );
         
     }

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/programrule/ProgramRuleVariableStoreTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/programrule/ProgramRuleVariableStoreTest.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/programrule/ProgramRuleVariableStoreTest.java	2015-06-16 13:17:59 +0000
@@ -31,14 +31,14 @@
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
-import java.util.Collection;
+import java.util.List;
 
-import org.junit.Test;
 import org.hisp.dhis.DhisSpringTest;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementStore;
 import org.hisp.dhis.program.Program;
 import org.hisp.dhis.program.ProgramStore;
+import org.junit.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 
 public class ProgramRuleVariableStoreTest
@@ -79,7 +79,7 @@
         variableStore.save( varB );
         variableStore.save( varC );
         
-        Collection<ProgramRuleVariable> vars = variableStore.get( programA );
+        List<ProgramRuleVariable> vars = variableStore.get( programA );
         
         assertEquals( 3, vars.size() );
         assertTrue( vars.contains( varA ) );

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/relationship/RelationshipServiceTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/relationship/RelationshipServiceTest.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/relationship/RelationshipServiceTest.java	2015-06-16 13:17:59 +0000
@@ -33,7 +33,7 @@
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
-import java.util.Collection;
+import java.util.List;
 
 import org.hisp.dhis.DhisSpringTest;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
@@ -176,7 +176,7 @@
         relationshipService.addRelationship( relationshipA );
         relationshipService.addRelationship( relationshipC );
 
-        Collection<Relationship> relationships = relationshipService
+        List<Relationship> relationships = relationshipService
             .getRelationshipsForTrackedEntityInstance( entityInstanceA );
         assertTrue( equals( relationships, relationshipA, relationshipC ) );
     }

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/relationship/RelationshipStoreTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/relationship/RelationshipStoreTest.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/relationship/RelationshipStoreTest.java	2015-06-16 13:17:59 +0000
@@ -31,7 +31,7 @@
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
-import java.util.Collection;
+import java.util.List;
 
 import org.hisp.dhis.DhisSpringTest;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
@@ -120,7 +120,7 @@
         relationshipStore.save( relationshipA );
         relationshipStore.save( relationshipC );
 
-        Collection<Relationship> relationships = relationshipStore.getForTrackedEntityInstance( entityInstanceA );
+        List<Relationship> relationships = relationshipStore.getForTrackedEntityInstance( entityInstanceA );
         assertTrue( equals( relationships, relationshipA, relationshipC ) );
     }
 
@@ -130,7 +130,7 @@
         relationshipStore.save( relationshipA );
         relationshipStore.save( relationshipC );
 
-        Collection<Relationship> relationships = relationshipStore.getByRelationshipType( relationshipType );
+        List<Relationship> relationships = relationshipStore.getByRelationshipType( relationshipType );
         assertTrue( equals( relationships, relationshipA, relationshipC ) );
     }
 

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeServiceTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeServiceTest.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeServiceTest.java	2015-06-16 13:17:59 +0000
@@ -32,7 +32,6 @@
 import static org.junit.Assert.assertTrue;
 
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.List;
 
 import org.hisp.dhis.DhisSpringTest;
@@ -81,7 +80,7 @@
 
         attributeGroupService.addTrackedEntityAttributeGroup( attributeGroup );
 
-        Collection<TrackedEntityAttribute> attributes = attributeStore.getOptionalAttributesWithoutGroup();
+        List<TrackedEntityAttribute> attributes = attributeStore.getOptionalAttributesWithoutGroup();
         assertEquals( 1, attributes.size() );
         assertTrue( attributes.contains( attributeC ) );
     }
@@ -97,7 +96,7 @@
         attributeStore.save( attributeB );
         attributeStore.save( attributeC );
 
-        Collection<TrackedEntityAttribute> attributes = attributeStore.getByDisplayOnVisitSchedule( true );
+        List<TrackedEntityAttribute> attributes = attributeStore.getByDisplayOnVisitSchedule( true );
         assertEquals( 2, attributes.size() );
         assertTrue( attributes.contains( attributeA ) );
         assertTrue( attributes.contains( attributeB ) );

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeStoreTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeStoreTest.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeStoreTest.java	2015-06-16 13:17:59 +0000
@@ -34,7 +34,6 @@
 import static org.junit.Assert.assertTrue;
 
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.List;
 
 import org.hisp.dhis.DhisSpringTest;
@@ -164,7 +163,7 @@
 
         attributeGroupService.addTrackedEntityAttributeGroup( attributeGroup );
 
-        Collection<TrackedEntityAttribute> attributes = attributeService.getOptionalAttributesWithoutGroup();
+        List<TrackedEntityAttribute> attributes = attributeService.getOptionalAttributesWithoutGroup();
         assertEquals( 1, attributes.size() );
         assertTrue( attributes.contains( attributeC ) );
     }
@@ -180,7 +179,7 @@
         attributeService.addTrackedEntityAttribute( attributeB );
         attributeService.addTrackedEntityAttribute( attributeC );
 
-        Collection<TrackedEntityAttribute> attributes = attributeService.getTrackedEntityAttributesByDisplayOnVisitSchedule( true );
+        List<TrackedEntityAttribute> attributes = attributeService.getTrackedEntityAttributesByDisplayOnVisitSchedule( true );
         assertEquals( 2, attributes.size() );
         assertTrue( attributes.contains( attributeA ) );
         assertTrue( attributes.contains( attributeB ) );

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAuditServiceTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAuditServiceTest.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAuditServiceTest.java	2015-06-16 13:17:59 +0000
@@ -33,8 +33,8 @@
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
-import java.util.Collection;
 import java.util.Date;
+import java.util.List;
 
 import org.hisp.dhis.DhisSpringTest;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
@@ -136,7 +136,7 @@
         auditService.saveTrackedEntityAudit( auditA );
         auditService.saveTrackedEntityAudit( auditB );
 
-        Collection<TrackedEntityAudit> audits = auditService.getTrackedEntityAudits( entityInstanceA );
+        List<TrackedEntityAudit> audits = auditService.getTrackedEntityAudits( entityInstanceA );
         assertEquals( 1, audits.size() );
         assertTrue( audits.contains( auditA ) );
 

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAuditStoreTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAuditStoreTest.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAuditStoreTest.java	2015-06-16 13:17:59 +0000
@@ -31,8 +31,8 @@
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
-import java.util.Collection;
 import java.util.Date;
+import java.util.List;
 
 import org.hisp.dhis.DhisSpringTest;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
@@ -94,7 +94,7 @@
         auditStore.save( auditA );
         auditStore.save( auditB );
 
-        Collection<TrackedEntityAudit> entityInstanceAudits = auditStore.get( entityInstanceA );
+        List<TrackedEntityAudit> entityInstanceAudits = auditStore.get( entityInstanceA );
         assertEquals( 1, entityInstanceAudits.size() );
         assertTrue( entityInstanceAudits.contains( auditA ) );
 

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityFormServiceTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityFormServiceTest.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityFormServiceTest.java	2015-06-16 13:17:59 +0000
@@ -33,8 +33,8 @@
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
-import java.util.Collection;
 import java.util.HashSet;
+import java.util.List;
 
 import org.hisp.dhis.DhisSpringTest;
 import org.hisp.dhis.dataentryform.DataEntryForm;
@@ -167,7 +167,7 @@
         entityFormService.saveTrackedEntityForm( entityFormA );
         entityFormService.saveTrackedEntityForm( entityFormB );
 
-        Collection<TrackedEntityForm> forms = entityFormService.getAllTrackedEntityForms();
+        List<TrackedEntityForm> forms = entityFormService.getAllTrackedEntityForms();
         assertEquals( 2, forms.size() );
         assertTrue( forms.contains( entityFormA ) );
         assertTrue( forms.contains( entityFormB ) );

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentityattributevalue/TrackedEntityAttributeValueServiceTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentityattributevalue/TrackedEntityAttributeValueServiceTest.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentityattributevalue/TrackedEntityAttributeValueServiceTest.java	2015-06-16 13:17:59 +0000
@@ -33,8 +33,8 @@
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
-import java.util.Collection;
-import java.util.HashSet;
+import java.util.ArrayList;
+import java.util.List;
 
 import org.hisp.dhis.DhisSpringTest;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
@@ -175,7 +175,7 @@
         attributeValueService.addTrackedEntityAttributeValue( attributeValueB );
         attributeValueService.addTrackedEntityAttributeValue( attributeValueC );
 
-        Collection<TrackedEntityAttributeValue> attributeValues = attributeValueService.getTrackedEntityAttributeValues( entityInstanceA );
+        List<TrackedEntityAttributeValue> attributeValues = attributeValueService.getTrackedEntityAttributeValues( entityInstanceA );
 
         assertEquals( 2, attributeValues.size() );
         assertTrue( equals( attributeValues, attributeValueA, attributeValueB ) );
@@ -193,7 +193,7 @@
         attributeValueService.addTrackedEntityAttributeValue( attributeValueB );
         attributeValueService.addTrackedEntityAttributeValue( attributeValueC );
 
-        Collection<TrackedEntityAttributeValue> attributeValues = attributeValueService
+        List<TrackedEntityAttributeValue> attributeValues = attributeValueService
             .getTrackedEntityAttributeValues( attributeA );
         assertEquals( 2, attributeValues.size() );
         assertTrue( attributeValues.contains( attributeValueA ) );
@@ -211,11 +211,11 @@
         attributeValueService.addTrackedEntityAttributeValue( attributeValueB );
         attributeValueService.addTrackedEntityAttributeValue( attributeValueC );
 
-        Collection<TrackedEntityInstance> entityInstances = new HashSet<>();
+        List<TrackedEntityInstance> entityInstances = new ArrayList<>();
         entityInstances.add( entityInstanceA );
         entityInstances.add( entityInstanceB );
 
-        Collection<TrackedEntityAttributeValue> attributeValues = attributeValueService.getTrackedEntityAttributeValues( entityInstances );
+        List<TrackedEntityAttributeValue> attributeValues = attributeValueService.getTrackedEntityAttributeValues( entityInstances );
         assertEquals( 3, attributeValues.size() );
         assertTrue( equals( attributeValues, attributeValueA, attributeValueB, attributeValueC ) );
     }
@@ -227,7 +227,7 @@
         attributeValueService.addTrackedEntityAttributeValue( attributeValueB );
         attributeValueService.addTrackedEntityAttributeValue( attributeValueC );
 
-        Collection<TrackedEntityAttributeValue> attributeValues = attributeValueService.searchTrackedEntityAttributeValue(
+        List<TrackedEntityAttributeValue> attributeValues = attributeValueService.searchTrackedEntityAttributeValue(
             attributeA, "A" );
         assertTrue( equals( attributeValues, attributeValueA ) );
     }

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentityattributevalue/TrackedEntityAttributeValueStoreTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentityattributevalue/TrackedEntityAttributeValueStoreTest.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentityattributevalue/TrackedEntityAttributeValueStoreTest.java	2015-06-16 13:17:59 +0000
@@ -33,8 +33,10 @@
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashSet;
+import java.util.List;
 
 import org.hisp.dhis.DhisSpringTest;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
@@ -163,7 +165,7 @@
         attributeValueStore.saveVoid( attributeValueB );
         attributeValueStore.saveVoid( attributeValueC );
 
-        Collection<TrackedEntityAttributeValue> attributeValues = attributeValueStore.get( entityInstanceA );
+        List<TrackedEntityAttributeValue> attributeValues = attributeValueStore.get( entityInstanceA );
 
         assertEquals( 2, attributeValues.size() );
         assertTrue( equals( attributeValues, attributeValueA, attributeValueB ) );
@@ -181,11 +183,11 @@
         attributeValueStore.saveVoid( attributeValueB );
         attributeValueStore.saveVoid( attributeValueC );
 
-        Collection<TrackedEntityInstance> entityInstances = new HashSet<>();
+        List<TrackedEntityInstance> entityInstances = new ArrayList<>();
         entityInstances.add( entityInstanceA );
         entityInstances.add( entityInstanceB );
 
-        Collection<TrackedEntityAttributeValue> attributeValues = attributeValueStore.get( entityInstances );
+        List<TrackedEntityAttributeValue> attributeValues = attributeValueStore.get( entityInstances );
         assertEquals( 3, attributeValues.size() );
         assertTrue( equals( attributeValues, attributeValueA, attributeValueB, attributeValueC ) );
     }
@@ -197,7 +199,7 @@
         attributeValueStore.saveVoid( attributeValueB );
         attributeValueStore.saveVoid( attributeValueC );
 
-        Collection<TrackedEntityAttributeValue> attributeValues = attributeValueStore.searchByValue( attributeA, "A" );
+        List<TrackedEntityAttributeValue> attributeValues = attributeValueStore.searchByValue( attributeA, "A" );
         assertTrue( equals( attributeValues, attributeValueA ) );
     }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueServiceTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueServiceTest.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueServiceTest.java	2015-06-16 13:17:59 +0000
@@ -33,9 +33,10 @@
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
-import java.util.Collection;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 
 import org.hisp.dhis.DhisSpringTest;
@@ -218,7 +219,7 @@
         dataValueService.saveTrackedEntityDataValue( dataValueC );
         dataValueService.saveTrackedEntityDataValue( dataValueD );
 
-        Collection<TrackedEntityDataValue> dataValues = dataValueService.getTrackedEntityDataValues( stageInstanceA );
+        List<TrackedEntityDataValue> dataValues = dataValueService.getTrackedEntityDataValues( stageInstanceA );
         assertEquals( 2, dataValues.size() );
         assertTrue( dataValues.contains( dataValueA ) );
         assertTrue( dataValues.contains( dataValueB ) );
@@ -237,11 +238,11 @@
         dataValueService.saveTrackedEntityDataValue( dataValueC );
         dataValueService.saveTrackedEntityDataValue( dataValueD );
 
-        Collection<DataElement> dataElements = new HashSet<>();
+        List<DataElement> dataElements = new ArrayList<>();
         dataElements.add( dataElementA );
         dataElements.add( dataElementB );
 
-        Collection<TrackedEntityDataValue> dataValues = dataValueService.getTrackedEntityDataValues( stageInstanceA,
+        List<TrackedEntityDataValue> dataValues = dataValueService.getTrackedEntityDataValues( stageInstanceA,
             dataElements );
         assertEquals( 2, dataValues.size() );
         assertTrue( dataValues.contains( dataValueA ) );
@@ -256,11 +257,11 @@
         dataValueService.saveTrackedEntityDataValue( dataValueC );
         dataValueService.saveTrackedEntityDataValue( dataValueD );
 
-        Collection<ProgramStageInstance> programStageInstances = new HashSet<>();
+        List<ProgramStageInstance> programStageInstances = new ArrayList<>();
         programStageInstances.add( stageInstanceA );
         programStageInstances.add( stageInstanceB );
 
-        Collection<TrackedEntityDataValue> dataValues = dataValueService
+        List<TrackedEntityDataValue> dataValues = dataValueService
             .getTrackedEntityDataValues( programStageInstances );
         assertEquals( 4, dataValues.size() );
         assertTrue( dataValues.contains( dataValueA ) );
@@ -277,7 +278,7 @@
         dataValueService.saveTrackedEntityDataValue( dataValueC );
         dataValueService.saveTrackedEntityDataValue( dataValueD );
 
-        Collection<TrackedEntityDataValue> dataValues = dataValueService.getTrackedEntityDataValues( dataElementA );
+        List<TrackedEntityDataValue> dataValues = dataValueService.getTrackedEntityDataValues( dataElementA );
         assertEquals( 2, dataValues.size() );
         assertTrue( dataValues.contains( dataValueA ) );
         assertTrue( dataValues.contains( dataValueC ) );
@@ -296,11 +297,11 @@
         dataValueService.saveTrackedEntityDataValue( dataValueC );
         dataValueService.saveTrackedEntityDataValue( dataValueD );
 
-        Collection<DataElement> dataElements = new HashSet<>();
+        List<DataElement> dataElements = new ArrayList<>();
         dataElements.add( dataElementA );
         dataElements.add( dataElementB );
 
-        Collection<TrackedEntityDataValue> dataValues = dataValueService.getTrackedEntityDataValues( entityInstance,
+        List<TrackedEntityDataValue> dataValues = dataValueService.getTrackedEntityDataValues( entityInstance,
             dataElements, yesterday, tomorrow );
 
         dataValues = dataValueService.getTrackedEntityDataValues( dataElementB );

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueStoreTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueStoreTest.java	2015-06-02 10:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueStoreTest.java	2015-06-16 13:17:59 +0000
@@ -32,9 +32,10 @@
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
-import java.util.Collection;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 
 import org.hisp.dhis.DhisSpringTest;
@@ -184,7 +185,7 @@
         dataValueStore.saveVoid( dataValueC );
         dataValueStore.saveVoid( dataValueD );
 
-        Collection<TrackedEntityDataValue> dataValues = dataValueStore.get( stageInstanceA );
+        List<TrackedEntityDataValue> dataValues = dataValueStore.get( stageInstanceA );
         assertEquals( 2, dataValues.size() );
         assertTrue( dataValues.contains( dataValueA ) );
         assertTrue( dataValues.contains( dataValueB ) );
@@ -203,11 +204,11 @@
         dataValueStore.saveVoid( dataValueC );
         dataValueStore.saveVoid( dataValueD );
 
-        Collection<DataElement> dataElements = new HashSet<>();
+        List<DataElement> dataElements = new ArrayList<>();
         dataElements.add( dataElementA );
         dataElements.add( dataElementB );
 
-        Collection<TrackedEntityDataValue> dataValues = dataValueStore.get( stageInstanceA, dataElements );
+        List<TrackedEntityDataValue> dataValues = dataValueStore.get( stageInstanceA, dataElements );
         assertEquals( 2, dataValues.size() );
         assertTrue( dataValues.contains( dataValueA ) );
         assertTrue( dataValues.contains( dataValueB ) );
@@ -221,11 +222,11 @@
         dataValueStore.saveVoid( dataValueC );
         dataValueStore.saveVoid( dataValueD );
 
-        Collection<ProgramStageInstance> programStageInstances = new HashSet<>();
+        List<ProgramStageInstance> programStageInstances = new ArrayList<>();
         programStageInstances.add( stageInstanceA );
         programStageInstances.add( stageInstanceB );
 
-        Collection<TrackedEntityDataValue> dataValues = dataValueStore.get( programStageInstances );
+        List<TrackedEntityDataValue> dataValues = dataValueStore.get( programStageInstances );
         assertEquals( 4, dataValues.size() );
         assertTrue( dataValues.contains( dataValueA ) );
         assertTrue( dataValues.contains( dataValueB ) );
@@ -241,7 +242,7 @@
         dataValueStore.saveVoid( dataValueC );
         dataValueStore.saveVoid( dataValueD );
 
-        Collection<TrackedEntityDataValue> dataValues = dataValueStore.get( dataElementA );
+        List<TrackedEntityDataValue> dataValues = dataValueStore.get( dataElementA );
         assertEquals( 2, dataValues.size() );
         assertTrue( dataValues.contains( dataValueA ) );
         assertTrue( dataValues.contains( dataValueC ) );
@@ -260,11 +261,11 @@
         dataValueStore.saveVoid( dataValueC );
         dataValueStore.saveVoid( dataValueD );
 
-        Collection<DataElement> dataElements = new HashSet<>();
+        List<DataElement> dataElements = new ArrayList<>();
         dataElements.add( dataElementA );
         dataElements.add( dataElementB );
 
-        Collection<TrackedEntityDataValue> dataValues = dataValueStore.get( entityInstance, dataElements, yesterday,
+        List<TrackedEntityDataValue> dataValues = dataValueStore.get( entityInstance, dataElements, yesterday,
             tomorrow );
 
         dataValues = dataValueStore.get( dataElementB );

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetAllProgramsAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetAllProgramsAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetAllProgramsAction.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
@@ -86,7 +85,7 @@
     {
         OrganisationUnit organisationUnit = selectionManager.getSelectedOrganisationUnit();
 
-        programs = new ArrayList<>( programService.getProgramsByCurrentUser( organisationUnit ) );
+        programs = programService.getProgramsByCurrentUser( organisationUnit );
         programs.removeAll( programService.getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION ) );
 
         Collections.sort( programs, IdentifiableObjectNameComparator.INSTANCE );

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetProgramsByOrgunitAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetProgramsByOrgunitAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetProgramsByOrgunitAction.java	2015-06-16 13:17:59 +0000
@@ -30,6 +30,7 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.List;
 
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager;
@@ -75,7 +76,7 @@
         return organisationUnit;
     }
 
-    private Collection<Program> programs = new ArrayList<>();
+    private List<Program> programs = new ArrayList<>();
 
     public Collection<Program> getPrograms()
     {

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadProgramStageInstanceAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadProgramStageInstanceAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadProgramStageInstanceAction.java	2015-06-16 13:17:59 +0000
@@ -135,8 +135,7 @@
 
         List<ProgramInstance> programInstances = new ArrayList<>();
 
-        programInstances = new ArrayList<>( programInstanceService.getProgramInstances( entityInstance,
-            program ) );
+        programInstances = programInstanceService.getProgramInstances( entityInstance, program );
 
         if ( programInstances != null && programInstances.size() > 0 )
         {

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/MultiDataEntrySelectAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/MultiDataEntrySelectAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/MultiDataEntrySelectAction.java	2015-06-16 13:17:59 +0000
@@ -129,10 +129,10 @@
     public String execute()
         throws Exception
     {
-        attributes = new ArrayList<>( attributeService.getAllTrackedEntityAttributes() );
+        attributes = attributeService.getAllTrackedEntityAttributes();
         Collections.sort( attributes, IdentifiableObjectNameComparator.INSTANCE );
         
-        trackedEntities = new ArrayList<>( trackedEntityService.getAllTrackedEntity() );
+        trackedEntities = trackedEntityService.getAllTrackedEntity();
         Collections.sort( trackedEntities, IdentifiableObjectNameComparator.INSTANCE );
 
         organisationUnit = selectionManager.getSelectedOrganisationUnit();

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ShowEventWithRegistrationFormAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ShowEventWithRegistrationFormAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ShowEventWithRegistrationFormAction.java	2015-06-16 13:17:59 +0000
@@ -199,7 +199,7 @@
         // Get registration form
         // ---------------------------------------------------------------------
 
-        trackedEntities = new ArrayList<>( trackedEntityService.getAllTrackedEntity() );
+        trackedEntities = trackedEntityService.getAllTrackedEntity();
 
         organisationUnit = selectionManager.getSelectedOrganisationUnit();
         healthWorkers = organisationUnit.getUsers();
@@ -232,14 +232,12 @@
 
         if ( customRegistrationForm == null )
         {
-            attributeGroups = new ArrayList<>(
-                attributeGroupService.getAllTrackedEntityAttributeGroups() );
+            attributeGroups = attributeGroupService.getAllTrackedEntityAttributeGroups();
             Collections.sort( attributeGroups, new TrackedEntityAttributeGroupSortOrderComparator() );
 
             if ( program == null )
             {
-                attributes = new ArrayList<>(
-                    attributeService.getTrackedEntityAttributesDisplayInList() );
+                attributes = attributeService.getTrackedEntityAttributesDisplayInList();
                 Collection<Program> programs = programService.getAllPrograms();
 
                 for ( Program p : programs )

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ValidateProgramInstanceAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ValidateProgramInstanceAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ValidateProgramInstanceAction.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
@@ -112,12 +111,9 @@
     public String execute()
         throws Exception
     {
-        programValidationResults = new ArrayList<>();
-
         ProgramStageInstance programStageInstance = programStageInstanceService.getProgramStageInstance( programStageInstanceId );
 
-        List<ProgramValidation> validation = new ArrayList<>(
-            programValidationService.getProgramValidation( programStageInstance.getProgramStage() ) );
+        List<ProgramValidation> validation = programValidationService.getProgramValidation( programStageInstance.getProgramStage() );
 
         programValidationResults = programValidationService.validate( validation, programStageInstance );
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/GetProgramTrackingListAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/GetProgramTrackingListAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/GetProgramTrackingListAction.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 
@@ -127,7 +126,7 @@
     {
         programStageInstance = programStageInstanceService.getProgramStageInstance( programStageInstanceId );
 
-        outboundSms = new ArrayList<>( programStageInstance.getOutboundSms() );
+        outboundSms = programStageInstance.getOutboundSms();
 
         currentUsername = currentUserService.getCurrentUsername();
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetAttributesByProgramAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetAttributesByProgramAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetAttributesByProgramAction.java	2015-06-16 13:17:59 +0000
@@ -120,8 +120,7 @@
         }
         else
         {
-            attributes = new ArrayList<>(
-                attributeService.getTrackedEntityAttributesDisplayInList() );
+            attributes = attributeService.getTrackedEntityAttributesDisplayInList();
         }
 
         Collections.sort( attributes, IdentifiableObjectNameComparator.INSTANCE );

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceAction.java	2015-06-16 13:17:59 +0000
@@ -286,7 +286,7 @@
         throws Exception
     {
         relationshipTypes = relationshipTypeService.getAllRelationshipTypes();
-        trackedEntities = new ArrayList<>( trackedEntityService.getAllTrackedEntity() );
+        trackedEntities = trackedEntityService.getAllTrackedEntity();
         entityInstance = entityInstanceService.getTrackedEntityInstance( id );
 
         healthWorkers = entityInstance.getOrganisationUnit().getUsers();
@@ -329,14 +329,12 @@
 
         if ( customRegistrationForm == null )
         {
-            attributeGroups = new ArrayList<>(
-                attributeGroupService.getAllTrackedEntityAttributeGroups() );
+            attributeGroups = attributeGroupService.getAllTrackedEntityAttributeGroups();
             Collections.sort( attributeGroups, new TrackedEntityAttributeGroupSortOrderComparator() );
 
             if ( program == null )
             {
-                attributes = new ArrayList<>(
-                    attributeService.getTrackedEntityAttributesDisplayInList() );
+                attributes = attributeService.getTrackedEntityAttributesDisplayInList();
                 Collections.sort( attributes, new TrackedEntityAttributeSortOrderInListNoProgramComparator() );
 
                 for ( TrackedEntityAttribute attribute : attributes )

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetVisitScheduleAttributesAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetVisitScheduleAttributesAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetVisitScheduleAttributesAction.java	2015-06-16 13:17:59 +0000
@@ -58,7 +58,7 @@
     // Getter && Setter
     // -------------------------------------------------------------------------
     
-    private List<TrackedEntityAttribute> attributes = new ArrayList<>();
+    private List<TrackedEntityAttribute> attributes;
     
     public List<TrackedEntityAttribute> getAttributes()
     {
@@ -72,8 +72,7 @@
     @Override
     public String execute()
     {
-        attributes = new ArrayList<>(
-            attributeService.getTrackedEntityAttributesByDisplayOnVisitSchedule( true ) );
+        attributes = attributeService.getTrackedEntityAttributesByDisplayOnVisitSchedule( true );
         Collections.sort( attributes, new TrackedEntityAttributeSortOrderComparator() );
         
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ProgramEnrollmentAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ProgramEnrollmentAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ProgramEnrollmentAction.java	2015-06-16 13:17:59 +0000
@@ -182,7 +182,7 @@
         // Load attributes of the selected program
         // ---------------------------------------------------------------------
 
-        attributes = new ArrayList<>( programInstance.getProgram().getProgramAttributes() );
+        attributes = programInstance.getProgram().getProgramAttributes();
 
         if ( attributes != null )
         {

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ProgramEnrollmentSelectAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ProgramEnrollmentSelectAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ProgramEnrollmentSelectAction.java	2015-06-16 13:17:59 +0000
@@ -92,7 +92,7 @@
         return entityInstance;
     }
 
-    private Collection<Program> programs = new ArrayList<>();
+    private Collection<Program> programs;
 
     public Collection<Program> getPrograms()
     {
@@ -112,7 +112,7 @@
 
         // Get all programs
 
-        programs = new ArrayList<>( programService.getProgramsByCurrentUser( orgunit ) );
+        programs = programService.getProgramsByCurrentUser( orgunit );
         programs.retainAll( programService.getProgramsByTrackedEntity( entityInstance.getTrackedEntity() ) );
         programs.removeAll( programService.getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION ) );
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SelectAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SelectAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SelectAction.java	2015-06-16 13:17:59 +0000
@@ -129,15 +129,15 @@
     {
         organisationUnit = selectionManager.getSelectedOrganisationUnit();
 
-        attributes = new ArrayList<>( attributeService.getTrackedEntityAttributesDisplayInList()  );
+        attributes = attributeService.getTrackedEntityAttributesDisplayInList();
         Collections.sort( attributes, IdentifiableObjectNameComparator.INSTANCE );
 
-        trackedEntities = new ArrayList<>( trackedEntityService.getAllTrackedEntity() );
+        trackedEntities = trackedEntityService.getAllTrackedEntity();
         Collections.sort( trackedEntities, IdentifiableObjectNameComparator.INSTANCE );
 
         if ( organisationUnit != null )
         {
-            programs = new ArrayList<>( programService.getProgramsByCurrentUser( organisationUnit ) );
+            programs = programService.getProgramsByCurrentUser( organisationUnit );
             programs.removeAll( programService.getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION ) );
 
             Collections.sort( programs, IdentifiableObjectNameComparator.INSTANCE );

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowActivityPlanFormAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowActivityPlanFormAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowActivityPlanFormAction.java	2015-06-16 13:17:59 +0000
@@ -94,7 +94,7 @@
     {
         organisationUnit = selectionManager.getSelectedOrganisationUnit();
 
-        programs = new ArrayList<>( programService.getAllPrograms() );
+        programs = programService.getAllPrograms();
         programs.retainAll( programService.getProgramsByCurrentUser() );
         programs.removeAll( programService.getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION ) );
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddRelationshipFormAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddRelationshipFormAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddRelationshipFormAction.java	2015-06-16 13:17:59 +0000
@@ -149,7 +149,7 @@
 
         organisationUnit = selectionManager.getSelectedOrganisationUnit();
         
-        relationshipTypes = new ArrayList<>( relationshipTypeService.getAllRelationshipTypes() );
+        relationshipTypes = relationshipTypeService.getAllRelationshipTypes();
 
         attributes = attributeService.getAllTrackedEntityAttributes();
         

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddRepresentativeAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddRepresentativeAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddRepresentativeAction.java	2015-06-16 13:17:59 +0000
@@ -72,7 +72,7 @@
     @Override
     public String execute()
     {
-        relationshipTypes = new ArrayList<>( relationshipTypeService.getAllRelationshipTypes() );
+        relationshipTypes = relationshipTypeService.getAllRelationshipTypes();
 
         attributes = attributeService.getAllTrackedEntityAttributes();
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddTrackedEntityInstanceFormAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddTrackedEntityInstanceFormAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddTrackedEntityInstanceFormAction.java	2015-06-16 13:17:59 +0000
@@ -320,7 +320,7 @@
             }
         }
 
-        trackedEntities = new ArrayList<>( trackedEntityService.getAllTrackedEntity() );
+        trackedEntities = trackedEntityService.getAllTrackedEntity();
 
         organisationUnit = selectionManager.getSelectedOrganisationUnit();
         healthWorkers = organisationUnit.getUsers();
@@ -351,14 +351,12 @@
 
         if ( customRegistrationForm == null )
         {
-            attributeGroups = new ArrayList<>(
-                attributeGroupService.getAllTrackedEntityAttributeGroups() );
+            attributeGroups = attributeGroupService.getAllTrackedEntityAttributeGroups();
             Collections.sort( attributeGroups, new TrackedEntityAttributeGroupSortOrderComparator() );
 
             if ( program == null )
             {
-                attributes = new ArrayList<>(
-                    attributeService.getTrackedEntityAttributesDisplayInList() );
+                attributes = attributeService.getTrackedEntityAttributesDisplayInList();
                 Collections.sort( attributes, new TrackedEntityAttributeSortOrderInListNoProgramComparator() );
 
                 for ( TrackedEntityAttribute attribute : attributes )

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/TrackedEntityInstanceDashboardAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/TrackedEntityInstanceDashboardAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/TrackedEntityInstanceDashboardAction.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Collection;
 import java.util.Collections;
@@ -219,9 +218,9 @@
         // Get entityInstance-attribute-values
         // ---------------------------------------------------------------------
 
-        attributes = new ArrayList<>( attributeService.getAllTrackedEntityAttributes() );
+        attributes = attributeService.getAllTrackedEntityAttributes();
         
-        displayedAttributes = new ArrayList<>( attributeService.getTrackedEntityAttributesDisplayInList() );
+        displayedAttributes = attributeService.getTrackedEntityAttributesDisplayInList();
         Collections.sort( attributes, IdentifiableObjectNameComparator.INSTANCE );
 
         for ( TrackedEntityAttributeValue attributeValue : entityInstance.getAttributeValues() )

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetAggPSDataElementsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetAggPSDataElementsAction.java	2015-03-30 09:30:54 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetAggPSDataElementsAction.java	2015-06-16 13:17:59 +0000
@@ -86,7 +86,7 @@
     {
         ProgramStage stage = programStageService.getProgramStage( psId );
         
-        dataElementList = new ArrayList<>( stage.getAllDataElements() );
+        dataElementList = stage.getAllDataElements();
 
         if ( dataElementList != null && !dataElementList.isEmpty() )
         {

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetDataElementsByDataSetAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetDataElementsByDataSetAction.java	2015-02-19 09:18:17 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetDataElementsByDataSetAction.java	2015-06-16 13:17:59 +0000
@@ -109,8 +109,7 @@
 
         query = StringUtils.trimToNull( query );
 
-        dataElements = new ArrayList<>( dataElementService.getDataElements( dataSet, query,
-            MAX_DATAELEMENTS_DISPLAYED ) );
+        dataElements = dataElementService.getDataElements( dataSet, query, MAX_DATAELEMENTS_DISPLAYED );
 
         Collections.sort( dataElements, IdentifiableObjectNameComparator.INSTANCE );
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/ShowAddCaseAggregationConditionFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/ShowAddCaseAggregationConditionFormAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/ShowAddCaseAggregationConditionFormAction.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
@@ -143,13 +142,13 @@
     @Override
     public String execute()
     {
-        dataSets = new ArrayList<>( dataSetService.getAllDataSets() );
+        dataSets = dataSetService.getAllDataSets();
         Collections.sort( dataSets, IdentifiableObjectNameComparator.INSTANCE );
         
-        programs = new ArrayList<>( programService.getAllPrograms() );
+        programs = programService.getAllPrograms();
         Collections.sort( programs, IdentifiableObjectNameComparator.INSTANCE );
 
-        attributes = new ArrayList<>( attributeService.getAllTrackedEntityAttributes() );
+        attributes = attributeService.getAllTrackedEntityAttributes();
         Collections.sort( attributes, IdentifiableObjectNameComparator.INSTANCE );
 
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/ShowUpdateCaseAggregationConditionFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/ShowUpdateCaseAggregationConditionFormAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/ShowUpdateCaseAggregationConditionFormAction.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
@@ -162,13 +161,13 @@
     public String execute()
         throws Exception
     {
-        dataSets = new ArrayList<>( dataSetService.getAllDataSets() );
+        dataSets = dataSetService.getAllDataSets();
         Collections.sort( dataSets, IdentifiableObjectNameComparator.INSTANCE );
 
-        programs = new ArrayList<>( programService.getAllPrograms() );
+        programs = programService.getAllPrograms();
         Collections.sort( programs, IdentifiableObjectNameComparator.INSTANCE );
 
-        attributes = new ArrayList<>( attributeService.getAllTrackedEntityAttributes() );
+        attributes = attributeService.getAllTrackedEntityAttributes();
         Collections.sort( attributes, IdentifiableObjectNameComparator.INSTANCE );
 
         caseAggregation = aggregationConditionService.getCaseAggregationCondition( id );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/dataentryform/GetTrackedEntityFormListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/dataentryform/GetTrackedEntityFormListAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/dataentryform/GetTrackedEntityFormListAction.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
@@ -110,7 +109,7 @@
             }
         }
 
-        programs = new ArrayList<>( programService.getAllPrograms() );
+        programs = programService.getAllPrograms();
 
         Collections.sort( programs, IdentifiableObjectNameComparator.INSTANCE );
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/dataentryform/ViewDataEntryFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/dataentryform/ViewDataEntryFormAction.java	2015-03-30 09:30:54 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/dataentryform/ViewDataEntryFormAction.java	2015-06-16 13:17:59 +0000
@@ -195,8 +195,7 @@
             listAssociationIds.add( ps.getId() );
         }
 
-        existingDataEntryForms = new ArrayList<>(
-            dataEntryFormService.listDistinctDataEntryFormByProgramStageIds( listAssociationIds ) );
+        existingDataEntryForms = dataEntryFormService.listDistinctDataEntryFormByProgramStageIds( listAssociationIds );
 
         existingDataEntryForms.remove( dataEntryForm );
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/dataentryform/ViewTrackedEntityFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/dataentryform/ViewTrackedEntityFormAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/dataentryform/ViewTrackedEntityFormAction.java	2015-06-16 13:17:59 +0000
@@ -153,7 +153,7 @@
     public String execute()
         throws Exception
     {
-        List<Program> programs = new ArrayList<>( programService.getAllPrograms() );
+        List<Program> programs = programService.getAllPrograms();
 
         programs.removeAll( programService.getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION ) );
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/GetProgramAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/GetProgramAction.java	2015-06-03 14:47:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/GetProgramAction.java	2015-06-16 13:17:59 +0000
@@ -169,7 +169,7 @@
 
         selectionTreeManager.setSelectedOrganisationUnits( program.getOrganisationUnits() );
 
-        userGroups = new ArrayList<>( userGroupService.getAllUserGroups() );
+        userGroups = userGroupService.getAllUserGroups();
 
         programIndicators = new ArrayList<>( program.getProgramIndicators() );
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/GetProgramListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/GetProgramListAction.java	2015-02-19 09:18:17 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/GetProgramListAction.java	2015-06-16 13:17:59 +0000
@@ -92,15 +92,15 @@
         {
             this.paging = createPaging( programService.getProgramCountByName( key ) );
 
-            programs = new ArrayList<>( programService.getProgramBetweenByName( key, paging.getStartPos(),
-                paging.getPageSize() ) );
+            programs = programService.getProgramBetweenByName( key, paging.getStartPos(),
+                paging.getPageSize() );
         }
         else
         {
             this.paging = createPaging( programService.getProgramCount() );
             
-            programs = new ArrayList<>( programService.getProgramsBetween( paging.getStartPos(),
-                paging.getPageSize() ) );
+            programs = programService.getProgramsBetween( paging.getStartPos(),
+                paging.getPageSize() );
         }
 
         Collections.sort( programs, IdentifiableObjectNameComparator.INSTANCE );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/ShowAddProgramFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/ShowAddProgramFormAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/ShowAddProgramFormAction.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,11 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import com.opensymphony.xwork2.Action;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 import org.hisp.dhis.attribute.Attribute;
 import org.hisp.dhis.attribute.AttributeService;
 import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
@@ -44,11 +48,7 @@
 import org.hisp.dhis.user.UserGroupService;
 import org.springframework.beans.factory.annotation.Autowired;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import com.opensymphony.xwork2.Action;
 
 /**
  * @author Abyot Asalefew Gizaw
@@ -154,24 +154,24 @@
     @Override
     public String execute()
     {
-        programs = new ArrayList<>( programService.getAllPrograms() );
+        programs = programService.getAllPrograms();
 
         programs.removeAll( programService.getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION ) );
         Collections.sort( programs, IdentifiableObjectNameComparator.INSTANCE );
 
-        availableAttributes = new ArrayList<>( trackedEntityAttributeService.getAllTrackedEntityAttributes() );
+        availableAttributes = trackedEntityAttributeService.getAllTrackedEntityAttributes();
         Collections.sort( availableAttributes, IdentifiableObjectNameComparator.INSTANCE );
 
-        userGroups = new ArrayList<>( userGroupService.getAllUserGroups() );
+        userGroups = userGroupService.getAllUserGroups();
         Collections.sort( userGroups, IdentifiableObjectNameComparator.INSTANCE );
 
-        relationshipTypes = new ArrayList<>( relationshipTypeService.getAllRelationshipTypes() );
+        relationshipTypes = relationshipTypeService.getAllRelationshipTypes();
         Collections.sort( relationshipTypes, IdentifiableObjectNameComparator.INSTANCE );
 
-        trackedEntities = new ArrayList<>( trackedEntityService.getAllTrackedEntity() );
+        trackedEntities = trackedEntityService.getAllTrackedEntity();
         Collections.sort( trackedEntities, IdentifiableObjectNameComparator.INSTANCE );
 
-        attributes = new ArrayList<>( attributeService.getProgramAttributes() );
+        attributes = attributeService.getProgramAttributes();
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/ShowUpdateProgramFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/ShowUpdateProgramFormAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/ShowUpdateProgramFormAction.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,11 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import com.opensymphony.xwork2.Action;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 import org.hisp.dhis.attribute.Attribute;
 import org.hisp.dhis.attribute.AttributeService;
 import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
@@ -48,11 +52,7 @@
 import org.hisp.dhis.user.UserGroupService;
 import org.springframework.beans.factory.annotation.Autowired;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import com.opensymphony.xwork2.Action;
 
 /**
  * @author Chau Thu Tran
@@ -221,7 +221,7 @@
 
         attributeValues = AttributeUtils.getAttributeValueMap( program.getAttributeValues() );
 
-        availableAttributes = new ArrayList<>( trackedEntityAttributeService.getAllTrackedEntityAttributes() );
+        availableAttributes = trackedEntityAttributeService.getAllTrackedEntityAttributes();
 
         for ( ProgramTrackedEntityAttribute programTrackedEntityAttribute : program.getProgramAttributes() )
         {
@@ -230,20 +230,20 @@
 
         Collections.sort( availableAttributes, IdentifiableObjectNameComparator.INSTANCE );
 
-        programs = new ArrayList<>( programService.getAllPrograms() );
+        programs = programService.getAllPrograms();
         programs.removeAll( programService.getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION ) );
         programs.remove( program );
         Collections.sort( programs, IdentifiableObjectNameComparator.INSTANCE );
 
-        userGroups = new ArrayList<>( userGroupService.getAllUserGroups() );
+        userGroups = userGroupService.getAllUserGroups();
 
-        relationshipTypes = new ArrayList<>( relationshipTypeService.getAllRelationshipTypes() );
+        relationshipTypes = relationshipTypeService.getAllRelationshipTypes();
         Collections.sort( relationshipTypes, IdentifiableObjectNameComparator.INSTANCE );
 
-        trackedEntities = new ArrayList<>( trackedEntityService.getAllTrackedEntity() );
+        trackedEntities = trackedEntityService.getAllTrackedEntity();
         Collections.sort( trackedEntities, IdentifiableObjectNameComparator.INSTANCE );
 
-        attributes = new ArrayList<>( attributeService.getProgramAttributes() );
+        attributes = attributeService.getProgramAttributes();
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programrule/GetProgramRuleListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programrule/GetProgramRuleListAction.java	2015-04-11 13:18:25 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programrule/GetProgramRuleListAction.java	2015-06-16 13:17:59 +0000
@@ -29,7 +29,6 @@
 
 import static org.apache.commons.lang3.StringUtils.isNotBlank;
 
-import java.util.ArrayList;
 import java.util.List;
 
 import org.hisp.dhis.program.Program;
@@ -107,11 +106,11 @@
 
         if ( isNotBlank( key ) )
         {
-            programRules = new ArrayList<ProgramRule>( programRuleService.getProgramRules( program, key ) );
+            programRules = programRuleService.getProgramRules( program, key );
         }
         else
         {
-            programRules = new ArrayList<ProgramRule>( programRuleService.getProgramRule( program ) );
+            programRules = programRuleService.getProgramRule( program );
         }
 
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programrule/ShowAddProgramRuleFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programrule/ShowAddProgramRuleFormAction.java	2015-04-11 13:18:25 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programrule/ShowAddProgramRuleFormAction.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.ArrayList;
 import java.util.List;
 
 import org.hisp.dhis.program.Program;
@@ -96,7 +95,7 @@
     {
         program = programService.getProgram( id );
 
-        ruleVariables = new ArrayList<>( variableService.getProgramRuleVariable( program ));
+        ruleVariables = variableService.getProgramRuleVariable( program );
             
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/GetProgramStageAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/GetProgramStageAction.java	2015-03-31 16:25:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/GetProgramStageAction.java	2015-06-16 13:17:59 +0000
@@ -166,10 +166,10 @@
 
         programStageDataElements = programStage.getProgramStageDataElements();
 
-        userGroups = new ArrayList<>( userGroupService.getAllUserGroups() );
+        userGroups = userGroupService.getAllUserGroups();
 
         attributeValues = AttributeUtils.getAttributeValueMap( programStage.getAttributeValues() );
-        attributes = new ArrayList<>( attributeService.getProgramStageAttributes() );
+        attributes = attributeService.getProgramStageAttributes();
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/ShowAddProgramStageAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/ShowAddProgramStageAction.java	2015-03-31 16:25:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/ShowAddProgramStageAction.java	2015-06-16 13:17:59 +0000
@@ -169,12 +169,12 @@
 
         selectionTreeManager.setSelectedOrganisationUnits( program.getOrganisationUnits() );
 
-        userGroups = new ArrayList<>( userGroupService.getAllUserGroups() );
+        userGroups = userGroupService.getAllUserGroups();
 
-        constants = new ArrayList<>( constantService.getAllConstants());        
+        constants = constantService.getAllConstants();        
         Collections.sort( constants, IdentifiableObjectNameComparator.INSTANCE );
 
-        attributes = new ArrayList<>( attributeService.getProgramStageAttributes() );
+        attributes = attributeService.getProgramStageAttributes();
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/ShowAddProgramStageFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/ShowAddProgramStageFormAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/ShowAddProgramStageFormAction.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
@@ -136,18 +135,18 @@
     @Override
     public String execute()
     {
-        programs = new ArrayList<>( programService.getAllPrograms() );
+        programs = programService.getAllPrograms();
         programs.removeAll( programService.getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION ) );
         Collections.sort( programs, IdentifiableObjectNameComparator.INSTANCE );
 
         availableAttributes = attributeService.getAllTrackedEntityAttributes();
 
-        userGroups = new ArrayList<>( userGroupService.getAllUserGroups() );
+        userGroups = userGroupService.getAllUserGroups();
 
-        relationshipTypes = new ArrayList<>( relationshipTypeService.getAllRelationshipTypes() );
+        relationshipTypes = relationshipTypeService.getAllRelationshipTypes();
         Collections.sort( relationshipTypes, IdentifiableObjectNameComparator.INSTANCE );
 
-        trackedEntities = new ArrayList<>(trackedEntityService.getAllTrackedEntity());
+        trackedEntities = trackedEntityService.getAllTrackedEntity();
         Collections.sort( trackedEntities, IdentifiableObjectNameComparator.INSTANCE );
 
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/relationship/GetRelationshipTypeListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/relationship/GetRelationshipTypeListAction.java	2015-02-19 09:18:17 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/relationship/GetRelationshipTypeListAction.java	2015-06-16 13:17:59 +0000
@@ -91,17 +91,15 @@
         {
             this.paging = createPaging( relationshipTypeService.getRelationshipTypeCountByName( key ) );
 
-            relationshipTypes = new ArrayList<>(
-                relationshipTypeService.getRelationshipTypesBetweenByName( key, paging.getStartPos(),
-                    paging.getPageSize() ) );
+            relationshipTypes = relationshipTypeService.getRelationshipTypesBetweenByName( key, paging.getStartPos(),
+                    paging.getPageSize() );
         }
         else
         {
             this.paging = createPaging( relationshipTypeService.getRelationshipTypeCount() );
 
-            relationshipTypes = new ArrayList<>(
-                relationshipTypeService.getRelationshipTypesBetween( paging.getStartPos(),
-                    paging.getPageSize() ) );
+            relationshipTypes = relationshipTypeService.getRelationshipTypesBetween( paging.getStartPos(),
+                    paging.getPageSize() );
         }
 
         Collections.sort( relationshipTypes, IdentifiableObjectNameComparator.INSTANCE );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentity/GetTrackedEntityListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentity/GetTrackedEntityListAction.java	2015-02-19 09:18:17 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentity/GetTrackedEntityListAction.java	2015-06-16 13:17:59 +0000
@@ -30,7 +30,6 @@
 
 import static org.apache.commons.lang3.StringUtils.isNotBlank;
 
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
@@ -90,15 +89,15 @@
         {
             this.paging = createPaging( trackedEntityService.getTrackedEntityCountByName( key ) );
 
-            trackedEntities = new ArrayList<>( trackedEntityService.getTrackedEntityBetweenByName( key,
-                paging.getStartPos(), paging.getPageSize() ) );
+            trackedEntities = trackedEntityService.getTrackedEntityBetweenByName( key,
+                paging.getStartPos(), paging.getPageSize() );
         }
         else
         {
             this.paging = createPaging( trackedEntityService.getTrackedEntityCount() );
 
-            trackedEntities = new ArrayList<>( trackedEntityService.getTrackedEntitysBetween(
-                paging.getStartPos(), paging.getPageSize() ) );
+            trackedEntities = trackedEntityService.getTrackedEntitysBetween(
+                paging.getStartPos(), paging.getPageSize() );
         }
 
         Collections.sort( trackedEntities, IdentifiableObjectNameComparator.INSTANCE );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentity/ShowAddUpdateTrackedEntityAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentity/ShowAddUpdateTrackedEntityAction.java	2015-03-19 11:14:12 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentity/ShowAddUpdateTrackedEntityAction.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,10 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import com.opensymphony.xwork2.Action;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 import org.hisp.dhis.attribute.Attribute;
 import org.hisp.dhis.attribute.AttributeService;
 import org.hisp.dhis.system.util.AttributeUtils;
@@ -36,10 +39,7 @@
 import org.hisp.dhis.trackedentity.TrackedEntityService;
 import org.springframework.beans.factory.annotation.Autowired;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import com.opensymphony.xwork2.Action;
 
 /**
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
@@ -103,7 +103,7 @@
             attributeValues = AttributeUtils.getAttributeValueMap( trackedEntity.getAttributeValues() );
         }
 
-        attributes = new ArrayList<>( attributeService.getTrackedEntityAttributes() );
+        attributes = attributeService.getTrackedEntityAttributes();
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/GetAttributeListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/GetAttributeListAction.java	2015-02-19 09:18:17 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/GetAttributeListAction.java	2015-06-16 13:17:59 +0000
@@ -91,16 +91,15 @@
         if ( isNotBlank( key ) ) // Filter on key only if set
         {
             this.paging = createPaging( attributeService.getTrackedEntityAttributeCountByName( key ) );
-            attributes = new ArrayList<>(
-                attributeService.getTrackedEntityAttributesBetweenByName( key, paging.getStartPos(),
-                    paging.getPageSize() ) );
+            attributes = attributeService.getTrackedEntityAttributesBetweenByName( key, paging.getStartPos(),
+                    paging.getPageSize() );
         }
         else
         {
             this.paging = createPaging( attributeService.getTrackedEntityAttributeCount() );
             
-            attributes = new ArrayList<>( attributeService.getTrackedEntityAttributesBetween(
-                paging.getStartPos(), paging.getPageSize() ) );
+            attributes = attributeService.getTrackedEntityAttributesBetween(
+                paging.getStartPos(), paging.getPageSize() );
         }
 
         Collections.sort( attributes, IdentifiableObjectNameComparator.INSTANCE );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/ShowAddUpdateAttributeAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/ShowAddUpdateAttributeAction.java	2015-04-08 04:43:57 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/ShowAddUpdateAttributeAction.java	2015-06-16 13:17:59 +0000
@@ -163,16 +163,16 @@
             attribute = trackedEntityAttributeService.getTrackedEntityAttribute( id );
             attributeValues = AttributeUtils.getAttributeValueMap( attribute.getAttributeValues() );
 
-            programs = new ArrayList<>( programService.getAllPrograms() );
+            programs = programService.getAllPrograms();
             programs.removeAll( programService.getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION ) );
             Collections.sort( programs );
         }
 
         periodTypes = periodService.getAllPeriodTypes();
-        optionSets = new ArrayList<>( optionService.getAllOptionSets() );
+        optionSets = optionService.getAllOptionSets();
         legendSets = legendService.getAllLegendSets();
-        attributes = new ArrayList<>( attributeService.getTrackedEntityAttributeAttributes() );
-        trackedEntities = new ArrayList<>( trackedEntityService.getAllTrackedEntity() );
+        attributes = attributeService.getTrackedEntityAttributeAttributes();
+        trackedEntities = trackedEntityService.getAllTrackedEntity();
 
         Collections.sort( optionSets );
         Collections.sort( legendSets );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/ShowAttributeInListNoProgramAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/ShowAttributeInListNoProgramAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/ShowAttributeInListNoProgramAction.java	2015-06-16 13:17:59 +0000
@@ -77,8 +77,7 @@
     public String execute()
         throws Exception
     {
-        selectedAttributes = new ArrayList<>(
-            attributeService.getTrackedEntityAttributesDisplayInList() );
+        selectedAttributes = attributeService.getTrackedEntityAttributesDisplayInList();
         
         Collections.sort( selectedAttributes, new TrackedEntityAttributeSortOrderInListNoProgramComparator() );
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/ShowAttributeVisitScheduleFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/ShowAttributeVisitScheduleFormAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/ShowAttributeVisitScheduleFormAction.java	2015-06-16 13:17:59 +0000
@@ -76,8 +76,7 @@
     public String execute()
         throws Exception
     {
-        selectedAttributes = new ArrayList<>(
-            attributeService.getTrackedEntityAttributesByDisplayOnVisitSchedule( true ) );
+        selectedAttributes = attributeService.getTrackedEntityAttributesByDisplayOnVisitSchedule( true );
         
         Collections.sort( selectedAttributes, new TrackedEntityAttributeSortOrderComparator() );
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattributegroup/GetAttributeGroupAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattributegroup/GetAttributeGroupAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattributegroup/GetAttributeGroupAction.java	2015-06-16 13:17:59 +0000
@@ -104,7 +104,7 @@
     {
         attributeGroup = attributeGroupService.getTrackedEntityAttributeGroup( id );
 
-        attributes = new ArrayList<>( attributeService.getTrackedEntityAttributesWithoutGroup() );
+        attributes = attributeService.getTrackedEntityAttributesWithoutGroup();
 
         Collections.sort( attributes, IdentifiableObjectNameComparator.INSTANCE );
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattributegroup/GetAttributeGroupListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattributegroup/GetAttributeGroupListAction.java	2015-02-19 09:18:17 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattributegroup/GetAttributeGroupListAction.java	2015-06-16 13:17:59 +0000
@@ -92,17 +92,15 @@
         {
             this.paging = createPaging( attributeGroupService.getTrackedEntityAttributeGroupCountByName( key ) );
 
-            attributeGroups = new ArrayList<>(
-                attributeGroupService.getTrackedEntityAttributeGroupsBetweenByName( key, paging.getStartPos(),
-                    paging.getPageSize() ) );
+            attributeGroups = attributeGroupService.getTrackedEntityAttributeGroupsBetweenByName( key, paging.getStartPos(),
+                    paging.getPageSize() );
         }
         else
         {
             this.paging = createPaging( attributeGroupService.getTrackedEntityAttributeGroupCount() );
 
-            attributeGroups = new ArrayList<>(
-                attributeGroupService.getTrackedEntityAttributeGroupsBetween( paging.getStartPos(),
-                    paging.getPageSize() ) );
+            attributeGroups = attributeGroupService.getTrackedEntityAttributeGroupsBetween( paging.getStartPos(),
+                    paging.getPageSize() );
         }
 
         Collections.sort( attributeGroups, IdentifiableObjectNameComparator.INSTANCE );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityinstancereminder/GetInstanceReminderAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityinstancereminder/GetInstanceReminderAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityinstancereminder/GetInstanceReminderAction.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.ArrayList;
 import java.util.List;
 
 import org.hisp.dhis.program.Program;
@@ -132,9 +131,9 @@
 
         program = programService.getProgram( programId );
 
-        userGroups = new ArrayList<>( userGroupService.getAllUserGroups() );
+        userGroups = userGroupService.getAllUserGroups();
 
-        attributes = new ArrayList<>( program.getTrackedEntityAttributes() );
+        attributes = program.getTrackedEntityAttributes();
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityinstancereminder/ShowAddProgramReminderAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityinstancereminder/ShowAddProgramReminderAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityinstancereminder/ShowAddProgramReminderAction.java	2015-06-16 13:17:59 +0000
@@ -103,7 +103,7 @@
     {
         program = programService.getProgram( id );
 
-        userGroups = new ArrayList<>( userGroupService.getAllUserGroups() );
+        userGroups = userGroupService.getAllUserGroups();
 
         attributes = program.getTrackedEntityAttributes();
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityinstancereminder/ShowAddProgramStageReminderAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityinstancereminder/ShowAddProgramStageReminderAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityinstancereminder/ShowAddProgramStageReminderAction.java	2015-06-16 13:17:59 +0000
@@ -103,7 +103,7 @@
     {
         programStage = programStageService.getProgramStage( id );
 
-        userGroups = new ArrayList<>( userGroupService.getAllUserGroups() );
+        userGroups = userGroupService.getAllUserGroups();
 
         attributes = programStage.getProgram().getTrackedEntityAttributes();
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/validation/GetValidationCriteriaListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/validation/GetValidationCriteriaListAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/validation/GetValidationCriteriaListAction.java	2015-06-16 13:17:59 +0000
@@ -28,7 +28,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
@@ -77,7 +76,7 @@
     public String execute()
         throws Exception
     {
-        criterias = new ArrayList<>( validationCriteriaService.getAllValidationCriterias() );
+        criterias = validationCriteriaService.getAllValidationCriterias();
 
         Collections.sort( criterias, new ValidationCriteriaComparator() );