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