<NME> TravelBugConnector.java
<BEF> package cgeo.geocaching.connector.trackable;

import cgeo.geocaching.CgeoApplication;
import cgeo.geocaching.R;
import cgeo.geocaching.connector.UserAction;
import cgeo.geocaching.connector.gc.GCConnector;
import cgeo.geocaching.connector.gc.GCParser;
import cgeo.geocaching.enumerations.Loaders;
import cgeo.geocaching.log.AbstractLoggingActivity;
import cgeo.geocaching.log.LogEntry;
import cgeo.geocaching.models.Trackable;
import cgeo.geocaching.network.Network;
import cgeo.geocaching.network.Parameters;
import cgeo.geocaching.settings.Settings;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.WorkerThread;

    private final static Pattern PATTERN_TB_CODE = Pattern.compile("(TB[0-9A-Z]+)|([0-9A-Z]{6})", Pattern.CASE_INSENSITIVE);

    @Override
    public boolean canHandleTrackable(String geocode) {
        return TravelBugConnector.PATTERN_TB_CODE.matcher(geocode).matches() && !StringUtils.startsWithIgnoreCase(geocode, "GC");
    }

    @Override
    public String getUrl(Trackable trackable) {
        return "http://www.geocaching.com//track/details.aspx?tracker=" + trackable.getGeocode();
    }

    @Override
    public int getPreferenceActivity() {
        return R.string.preference_screen_gc;
    }

    @Override
    public Trackable searchTrackable(String geocode, String guid, String id) {
        return GCParser.searchTrackable(geocode, guid, id);
    }

        return PATTERN_TB_CODE.matcher(geocode).matches();
    }

    @NonNull
    @Override
    public String getServiceTitle() {
        return CgeoApplication.getInstance().getString(R.string.settings_title_gc);
    }

    @Override
    @NonNull
    public String getUrl(@NonNull final Trackable trackable) {
        return getHostUrl() + "//track/details.aspx?tracker=" + trackable.getGeocode();
    }

    @Override
    public @Nullable
    String getTrackableCodeFromUrl(@NonNull String url) {
        // coord.info URLs
        String code = StringUtils.substringAfterLast(url, "coord.info/");
        if (code != null && canHandleTrackable(code)) {
            return code;
        }
        code = StringUtils.substringAfterLast(url, "?tracker=");
        if (code != null && canHandleTrackable(code)) {
            return code;
        }
        return null;
    }
    public boolean isLoggable() {
        return true;
    }

    @Override
    public boolean isRegistered() {
        return Settings.hasGCCredentials();
    }

    @Override
    @Nullable
    public Trackable searchTrackable(final String geocode, final String guid, final String id) {
        return GCParser.searchTrackable(geocode, guid, id);
    }

    /**
     * initialization on demand holder pattern
     */
    private static class Holder {
        private static final TravelBugConnector INSTANCE = new TravelBugConnector();
    }

    private TravelBugConnector() {
        // singleton
    }

    public static TravelBugConnector getInstance() {
        return Holder.INSTANCE;
    }

    @Override
    @Nullable
    public String getTrackableCodeFromUrl(@NonNull final String url) {
        // coord.info URLs
        final String code1 = StringUtils.substringAfterLast(url, "coord.info/");
        if (canHandleTrackable(code1)) {
            return code1;
        }
        final String code2 = StringUtils.substringAfterLast(url, "?tracker=");
        if (canHandleTrackable(code2)) {
            return code2;
        }
        return null;
    }

    @Override
    @NonNull
    public List<UserAction> getUserActions(final UserAction.UAContext user) {
        // travel bugs should have the same actions as GC caches
        return GCConnector.getInstance().getUserActions(user);
    }

    @Override
    @NonNull
    public TrackableBrand getBrand() {
        return TrackableBrand.TRAVELBUG;
    }

    @Override
    public int getTrackableLoggingManagerLoaderId() {
        return Loaders.LOGGING_TRAVELBUG.getLoaderId();
    }

    @Override
    public AbstractTrackableLoggingManager getTrackableLoggingManager(final AbstractLoggingActivity activity) {
        return new TravelBugLoggingManager(activity);
    }

    @Override
    @NonNull
    public String getHost() {
        return "www.geocaching.com";
    }

    @Override
    @NonNull
    public String getTestUrl() {
        return "https://" + getHost() + "/play";
    }
}

<MSG> Remove useless null checks

<DFF> @@ -20,12 +20,12 @@ public class TravelBugConnector extends AbstractTrackableConnector {
     private final static Pattern PATTERN_TB_CODE = Pattern.compile("(TB[0-9A-Z]+)|([0-9A-Z]{6})", Pattern.CASE_INSENSITIVE);
 
     @Override
-    public boolean canHandleTrackable(String geocode) {
+    public boolean canHandleTrackable(final String geocode) {
         return TravelBugConnector.PATTERN_TB_CODE.matcher(geocode).matches() && !StringUtils.startsWithIgnoreCase(geocode, "GC");
     }
 
     @Override
-    public String getUrl(Trackable trackable) {
+    public String getUrl(final Trackable trackable) {
         return "http://www.geocaching.com//track/details.aspx?tracker=" + trackable.getGeocode();
     }
 
@@ -35,7 +35,7 @@ public class TravelBugConnector extends AbstractTrackableConnector {
     }
 
     @Override
-    public Trackable searchTrackable(String geocode, String guid, String id) {
+    public Trackable searchTrackable(final String geocode, final String guid, final String id) {
         return GCParser.searchTrackable(geocode, guid, id);
     }
 
@@ -56,15 +56,15 @@ public class TravelBugConnector extends AbstractTrackableConnector {
 
     @Override
     public @Nullable
-    String getTrackableCodeFromUrl(@NonNull String url) {
+    String getTrackableCodeFromUrl(@NonNull final String url) {
         // coord.info URLs
-        String code = StringUtils.substringAfterLast(url, "coord.info/");
-        if (code != null && canHandleTrackable(code)) {
-            return code;
+        final String code1 = StringUtils.substringAfterLast(url, "coord.info/");
+        if (canHandleTrackable(code1)) {
+            return code1;
         }
-        code = StringUtils.substringAfterLast(url, "?tracker=");
-        if (code != null && canHandleTrackable(code)) {
-            return code;
+        final String code2 = StringUtils.substringAfterLast(url, "?tracker=");
+        if (canHandleTrackable(code2)) {
+            return code2;
         }
         return null;
     }

Remove useless null checks