### Question:
GoogleDriveManager extends FileSender { @Override public boolean isAvailable() { return isLinked(); } GoogleDriveManager(PreferenceHelper preferenceHelper); String getOauth2Scope(); boolean isLinked(); @Override void uploadFile(List<File> files); @Override boolean isAvailable(); @Override boolean hasUserAllowedAutoSending(); void uploadTestFile(File file, String googleDriveFolderName); void uploadFile(final String fileName, @Nullable String googleDriveFolderName); @Override boolean accept(File dir, String name); String getToken();  }### Answer:
@Test public void IsAvailable_AccountAndToken_IsAvailable(){ PreferenceHelper pm = mock(PreferenceHelper.class); when(pm.getGoogleDriveAccountName()).thenReturn("XXXXXXX"); when(pm.getGoogleDriveAuthToken()).thenReturn("YYYYYYYYYYY"); when(pm.isGDocsAutoSendEnabled()).thenReturn(false); GoogleDriveManager gdm = new GoogleDriveManager(pm); assertThat("Account and token indicate availability", gdm.isAvailable(), is(true)); }