### Question:
QuestionsAndAnswersPlugin extends WebControllerPlugin implements TopicPlugin { @Override public JtalksPermission getBranchPermissionByMask(int mask) { return QuestionsPluginBranchPermission.findByMask(mask); }  @Override String getName(); @Override List<PluginProperty> getConfiguration(); @Override boolean supportsJCommuneVersion(String version); @Override List<PluginProperty> getDefaultConfiguration(); @Override String translateLabel(String code, Locale locale); @SuppressWarnings("unchecked") @Override List<T> getBranchPermissions(); @Override CreateTopicBtnDto getCreateTopicBtnDto(long branchId); @Override JtalksPermission getCreateTopicPermission(); @Override JtalksPermission getBranchPermissionByMask(int mask); @Override JtalksPermission getBranchPermissionByName(String name); @Override PluginController getController(); @Override String getTopicType(); @Override JtalksPermission getCommentPermission(); @Override SubscribersFilter getSubscribersFilter(); static final String TOPIC_TYPE; static final String CONTEXT; static final String MESSAGE_PATH; }### Answer:
@Test public void getBranchPermissionByMaskShouldReturnCorrectPermission() { QuestionsPluginBranchPermission expectedPermission = QuestionsPluginBranchPermission.CREATE_QUESTIONS; JtalksPermission actualPermission = new QuestionsAndAnswersPlugin().getBranchPermissionByMask(31); assertEquals(actualPermission, expectedPermission); }
@Test public void getBranchPermissionByMaskShouldReturnNullIfPermissionNotFound() { JtalksPermission actualPermission = new QuestionsAndAnswersPlugin().getBranchPermissionByMask(30); assertNull(actualPermission); }