### Question:
PreferencesViewModel extends ActivatableViewModel { public String getMediationLanguages() { return mediationManager.getObservableMap().values().stream() .flatMap(mediator -> mediator.getLanguageCodes().stream()) .distinct() .map(LanguageUtil::getDisplayName) .collect(Collectors.joining(", ")); } @Inject  PreferencesViewModel(Preferences preferences,
                                RefundAgentManager refundAgentManager,
                                MediatorManager mediationManager); String getMediationLanguages();  }### Answer:
@Test public void getMediationLanguages() { MediatorManager mediationManager = mock(MediatorManager.class); final ObservableMap<NodeAddress, Mediator> mnediators = FXCollections.observableHashMap(); ArrayList<String> languagesOne = new ArrayList<>() {{ add("en"); add("de"); }}; ArrayList<String> languagesTwo = new ArrayList<>() {{ add("en"); add("es"); }}; Mediator one = new Mediator(new NodeAddress("refundAgent:1"), null, languagesOne, 0L, null, null, null, null, null); Mediator two = new Mediator(new NodeAddress("refundAgent:2"), null, languagesTwo, 0L, null, null, null, null, null); mnediators.put(one.getNodeAddress(), one); mnediators.put(two.getNodeAddress(), two); Preferences preferences = PreferenceMakers.empty; when(mediationManager.getObservableMap()).thenReturn(mnediators); PreferencesViewModel model = new PreferencesViewModel(preferences, null, mediationManager); assertEquals("English, Deutsch, español", model.getMediationLanguages()); }