### Question:
PreferencesDataStore implements DataStoreFactory<String, Credentials>, DataStore<String, Credentials>, CredentialsProvider { @Override public Credentials get(String key) { return credentialsHelper.convert(getRemoteCredentials()); } PreferencesDataStore(Preferences preferences, String remote, CodenvyClient codenvyClient); @Override Credentials get(String key); @Override synchronized Credentials put(String key, Credentials credentials); @Override Credentials delete(String key); @Override DataStore<String, Credentials> getDataStore(String s); @Override Credentials getCredentials(String s);  }### Answer:
@Test public void testGet() throws Exception { init(); Credentials credentialsFlorent = dataStoreFlorent.getCredentials("dummy"); assertNotNull(credentialsFlorent); assertEquals(credentialsFlorent.username(), "florent"); assertEquals(credentialsFlorent.token().value(), "abc123"); Credentials credentialsStephane = dataStoreStephane.getCredentials("dummy"); assertNotNull(credentialsStephane); assertEquals(credentialsStephane.username(), "stephane"); assertEquals(credentialsStephane.token().value(), "def456"); }
@Test(dependsOnMethods = "testPut") public void testOnlyOneInstanceGet() throws Exception { init(); Credentials one = dataStoreFlorent.get("one"); assertNotNull(one); Credentials two = dataStoreFlorent.get("two"); assertNotNull(two); assertEquals(one, two); }