Suppose that there is an existing StringTransformer
class
and also the following:
public interface StringTransformable { public String transform(String x); }
StringTransformer
and implements StringTransformable
.
A Pig's transform
method takes a String and puts the word oink
both before and after it.
For example,
given "I am a duck" it would produce "oink I am a duck oink".
StringTransformer
and implements StringTransformable
.
A Cheerleader's transform
method takes a String and puts an appropiate cheer
both before and after it (as in the previous problem).
Different Cheerleaders have different cheers, in general.
For example, given the String "I am the walrus":
while given the String "Coo-coo ch-choo" the same three Cheerleaders would produce, respectively: