class DefaultCommunicationService implements CommunicationService {

	public String computeWarningMessageForAddLinkCheck(Direction startDirection, Direction endDirection) {
		if (startDirection.equals(Direction.OUTGOING) && endDirection.equals(Direction.INCOMING)) {
			return CommunicationService.WARNING_BOTH_GROUPS_USERS_CAN_COMMUNICATE;
		}

		if (startDirection.equals(Direction.OUTGOING)) {
			return CommunicationService.WARNING_STARTGROUP_USERS_CAN_COMMUNICATE;
		}

		if (endDirection.equals(Direction.INCOMING)) {
			return CommunicationService.WARNING_ENDGROUP_USERS_CAN_COMMUNICATE;
		}

		return null;
	}

}

class DefaultCommunicationServiceTest {

     DefaultCommunicationService service;

    @Test
    public void computeWarningMessageForAddLinkCheck_shouldReturnEndgroupUsersCanCommunicate_GivenSenderIncomingAndReceiverIncoming() {

        Assert.assertEquals(CommunicationService.WARNING_ENDGROUP_USERS_CAN_COMMUNICATE,
                this.service.computeWarningMessageForAddLinkCheck(CommunicationService.Direction.INCOMING, CommunicationService.Direction.INCOMING));
    }

}