<NME> MockedCache.java
<BEF> package cgeo.geocaching.test.mock;

import cgeo.geocaching.connector.gc.GCConstants;
import cgeo.geocaching.location.Geopoint;
import cgeo.geocaching.models.Geocache;
import cgeo.geocaching.models.Image;
import cgeo.geocaching.models.Trackable;
import cgeo.geocaching.utils.TextUtils;

import androidx.annotation.NonNull;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Collections;
import java.util.List;

import junit.framework.Assert;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;

public abstract class MockedCache extends Geocache {

    private final String data;
    private String mockedDataUser;

    public static final List<MockedCache> MOCKED_CACHES;

    static {
        MOCKED_CACHES = Collections.unmodifiableList(Arrays.asList(new GC2CJPF(), new GC1ZXX2(), new GC2JVEH(), new GC3XX5J(), new GC40()));
    }

    protected MockedCache(final Geopoint coords) {
        this.coords = coords;
        this.data = MockedCache.readCachePage(getGeocode());
        // for mocked caches the user logged in is the user who saved the html file(s)
        this.mockedDataUser = TextUtils.getMatch(data, GCConstants.PATTERN_LOGIN_NAME, true, "");
    }

    public String getMockedDataUser() {
        assertThat(StringUtils.isNotBlank(this.mockedDataUser)).isTrue();
        return mockedDataUser;
    }

    public void setMockedDataUser(final String mockedDataUser) {
        this.mockedDataUser = mockedDataUser;
        assertThat(StringUtils.isNotBlank(this.mockedDataUser)).isTrue();
    }

    public static String getDateFormat() {
        return "yyyy-MM-dd";
    }

    /*
     * The data for the caches can be generated by entering the url
     * https://www.geocaching.com/seek/cache_details.aspx?log=y&wp=GCxxxx&numlogs=35&decrypt=y
     * into a browser and saving the file
     */
    public String getData() {
        return this.data;
    }

    public static String readCachePage(final String geocode) {
        InputStream is = null;
        BufferedReader br = null;
        try {
            is = MockedCache.class.getResourceAsStream("/cgeo/geocaching/test/mock/" + geocode + ".html");
            br = new BufferedReader(new InputStreamReader(is), 150000);

            final StringBuilder buffer = new StringBuilder();
            String line;

            while ((line = br.readLine()) != null) {
                buffer.append(line).append('\n');
            }

            return TextUtils.replaceWhitespace(buffer.toString());
        } catch (final IOException e) {
            Assert.fail(e.getMessage());
        } finally {
            IOUtils.closeQuietly(is);
            IOUtils.closeQuietly(br);
        }
        return null;
    }

    @Override
    public boolean isArchived() {
        return false;
    }

    @Override
    public boolean isDisabled() {
        return false;
    }

    @Override
    public boolean isPremiumMembersOnly() {
        return false;
    }

    @Override
    public boolean isOwner() {
        return false;
    }

    @Override
    public String getHint() {
        return "";
    }

    @Override
    public String getShortDescription() {
        return "";
    }

    @Override
    public String getPersonalNote() {
        return null;
    }

    @Override
    public boolean isFound() {
        return false;
    }

    @Override
    public boolean isFavorite() {
        return false;
    }

    @Override
    public int getFavoritePoints() {
        return 0;
    }

    @Override
    public boolean isOnWatchlist() {
        return false;
    }

    @Override
    @NonNull
    public List<Trackable> getInventory() {
        return Collections.emptyList();
    }

    @Override
    @NonNull
    public List<Image> getSpoilers() {
        return Collections.emptyList();
    }

    @Override
    public String getNameForSorting() {
        return getName();
    }

    @Override
    public Geopoint getCoords() {
        return coords;
    }
}

<MSG> use assertj

* more readable (left to right)
* more expressive (hasSize(), contains(), isEmpty()...)
* better error messages
* junit assert is deprecated

Really please don't introduce new assertions using plain junit assert.
<DFF> @@ -19,9 +19,9 @@ import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
-import junit.framework.Assert;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.StringUtils;
+import org.assertj.core.api.Assertions;
 
 public abstract class MockedCache extends Geocache {
 
@@ -80,7 +80,7 @@ public abstract class MockedCache extends Geocache {
 
             return TextUtils.replaceWhitespace(buffer.toString());
         } catch (final IOException e) {
-            Assert.fail(e.getMessage());
+            Assertions.fail("cannot read cache page", e);
         } finally {
             IOUtils.closeQuietly(is);
             IOUtils.closeQuietly(br);

use assertj