I have a property and a method both of type `Team`:
`this.team` and `flag.getTeam()` (which is just a single-lined getter of that property).

Here are the respective `toString()` outputs:
`org.bukkit.craftbukkit.v1_12_R1.scoreboard.CraftTeam@674e0730`
and `org.bukkit.craftbukkit.v1_12_R1.scoreboard.CraftTeam@674e0730`

`team == flag.getTeam()` returns `false`, while  

`team.hashCode() == flag.getTeam().hashCode()` returns `true` and  

`team.toString().equals(flag.getTeam().toString())` returns `true`

```
public class PlayerTimer extends BukkitRunnable {

    Domination plugin;
    Player player;
    Team team;
    public PlayerTimer(Domination plugin, Player player) {
        this.plugin = plugin;
        this.player = player;
        for (Team team : plugin.getWorldGameScoreboards().get(plugin.getCurrentWorld()).getTeams()) {
            for (OfflinePlayer offlinePlayer : team.getPlayers()) {
                if (offlinePlayer.getPlayer() == player) {
                    this.team = team;
                    break;
                }
            }
            if (this.team != null) break;
        }
    }

    @Override
    public void run() {
        for (Flag flag : plugin.getWorldFlags().get(plugin.getCurrentWorld())) {
            for (OfflinePlayer offlinePlayer : team.getPlayers()) {
                if (offlinePlayer.isOnline()) {
                    Player player = offlinePlayer.getPlayer();
                    double scaledDistance = player.getLocation().distance(flag.getLocation()) / 5;  // max 5 blocks away
                    if (scaledDistance < 1) {
                        plugin.log(team + " : " + flag.getTeam() + ", " + (team == flag.getTeam()) + "; " + team.equals(flag.getTeam()) + (team.hashCode() == flag.getTeam().hashCode()) + "^ " + team.toString().equals(flag.getTeam().toString());
                        ...
                    }
                }
            }
        }
    }
}

```

Why isn't `==` returning `true`?