Skip to content

Instantly share code, notes, and snippets.

@asunwoo
Created November 21, 2017 21:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asunwoo/55ede74602dfe92abd70fdd79975a4c5 to your computer and use it in GitHub Desktop.
Save asunwoo/55ede74602dfe92abd70fdd79975a4c5 to your computer and use it in GitHub Desktop.
//Business Logic
//...
Variation variation = this.optimizelyClient.activate(experimentName, userId);
if(variation.is("CategoryProductSort")){
CategoryComparator comparator = new CategoryComparator();
Collections.sort(unSortedList, comparator);
} else if(variation.is("NameProductSort")){
NameComparator comparator = new NameComparator();
Collections.sort(unSortedList, comparator);
} else if(variation.is("PriceProductSort")){
PriceComparator comparator = new PriceComparator();
Collections.sort(unSortedList, comparator);
}
sort.sort(sampleProductList());
//Continue Business Logic
//…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment