This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | public class Slack implements Messenger { | |
| @Override | |
| public void send(final String message) { | |
| if (isValid(message)) { | |
| SlackClient client = new SlackClient(); | |
| client.send(message); | |
| } | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | public static void main(String[] args) { | |
| String type = args[0]; | |
| String message = args[1]; | |
| Messenger messanger; | |
| if ("slack".equals(type)) { | |
| messanger = new Slack(); | |
| } else if ("skype".equals(type)) { | |
| messanger = new Skype(); | |
| } else if ("hangout".equals(type)) { | |
| messanger = new Hangout(); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | public static void main(String[] args) { | |
| String type = args[0]; | |
| String message = args[1]; | |
| if ("slack".equals(type) && isValidForSlack(message)) { | |
| Slack slack = new Slack(); | |
| slack.send(message); | |
| } else if ("skype".equals(type) && isValidForSkype(message)) { | |
| Skype skype = new Skype(); | |
| skype.send(message); | |
| } else if ("hangout".equals(type) && isValidForHangout(message)) { | 
NewerOlder