Merge "Add extra authorative TOSCA concepts"
[policy/models.git] / models-tosca / src / main / java / org / onap / policy / models / tosca / authorative / concepts / ToscaPolicyTypeFilter.java
index c721929..4e9810b 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2019-2020 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,11 +22,9 @@ package org.onap.policy.models.tosca.authorative.concepts;
 
 import java.util.List;
 import java.util.stream.Collectors;
-
 import lombok.Builder;
 import lombok.Data;
 import lombok.NonNull;
-
 import org.onap.policy.models.base.PfObjectFilter;
 
 /**
@@ -57,9 +55,8 @@ public class ToscaPolicyTypeFilter implements PfObjectFilter<ToscaPolicyType> {
         // @formatter:off
 
         if (LATEST_VERSION.equals(version)) {
-            return this.latestVersionFilter(returnList);
-        }
-        else {
+            return this.latestVersionFilter(returnList, new ToscaPolicyTypeComparator());
+        } else  {
             return returnList;
         }
     }