scott: in java, we can use strategy pattern to mimic one task which have different manner. Let say's we have to have function which do a compression both of rar and zip. This will be fit to use strategy pattern.
In functional programming world like kotlin. We can use a high order function to create extension function. Code will be more concise and convenient