class DefaultCommunicationService implements CommunicationService {

	public Map<String, Direction> computeNewDirectionAfterAddingLink(String startGroupId, Direction startDirection, String endGroupId, Direction endDirection) {
		Map<String, Direction> resDirectionMap = new HashMap<>();

		if (startDirection.equals(Direction.NONE)) {
			resDirectionMap.put(startGroupId, Direction.INCOMING);
		} else if (startDirection.equals(Direction.OUTGOING)) {
			resDirectionMap.put(startGroupId, Direction.BOTH);
		}

		if (endDirection.equals(Direction.NONE)) {
			resDirectionMap.put(endGroupId, Direction.OUTGOING);
		} else if (endDirection.equals(Direction.INCOMING)) {
			resDirectionMap.put(endGroupId, Direction.BOTH);
		}

		return resDirectionMap;
	}

}