@MediumTest
    @Test
    public void testSearchByGeocodeNotLoggedIn() {
        withMockedLoginDo(() -> {
            // non premium cache
            MockedCache cache = new GC3FJ5F();

            deleteCacheFromDBAndLogout(cache.getGeocode());

            SearchResult search = Geocache.searchByGeocode(cache.getGeocode(), null, true, null);
            assertThat(search).isNotNull();
            assertThat(search.getGeocodes()).containsExactly(cache.getGeocode());
            Geocache searchedCache = search.getFirstCacheFromResult(LoadFlags.LOAD_CACHE_OR_DB);
            // coords must be null if the user is not logged in
            assertThat(searchedCache).isNotNull();
            assertThat(searchedCache.getCoords()).isNull();

            // premium cache. Not fully visible to guests
            cache = new GC2JVEH();

            deleteCacheFromDBAndLogout(cache.getGeocode());

            search = Geocache.searchByGeocode(cache.getGeocode(), null, true, null);
            assertThat(search).isNotNull();
            searchedCache = search.getFirstCacheFromResult(LoadFlags.LOAD_CACHE_OR_DB);
            assertThat(searchedCache).isNotNull();
            assertThat(searchedCache.getCoords()).isNull();
            assertThat(searchedCache.getName()).isEqualTo(cache.getName());
            assertThat(searchedCache.getDifficulty()).isEqualTo(cache.getDifficulty());
            assertThat(searchedCache.getTerrain()).isEqualTo(cache.getTerrain());
            assertThat(searchedCache.getGeocode()).isEqualTo(cache.getGeocode());
            assertThat(searchedCache.getSize()).isEqualTo(cache.getSize());
            assertThat(searchedCache.getType()).isEqualTo(cache.getType());
            // it's not possible in guest sessions to distinguish whether a PM-only cache is disabled or archived
            assertThat(searchedCache.isDisabled()).isEqualTo(cache.isDisabled() || cache.isArchived());
        });
    }
Test {@link Geocache#searchByGeocode(String, String, boolean, DisposableHandler)}
main/src/androidTest/java/cgeo/geocaching/CgeoApplicationTest.java