@Test public void invite() { SelfCheckingPartyRepository repository = new SelfCheckingPartyRepository(mock(PartyRepository.class)); Assert.assertEquals(InviteResult.INVITE_SELF, repository.invite("owner", "owner", 10)); }
@Override public InviteResult invite(String owner, String player, int expiration) { return owner.equalsIgnoreCase(player) ? InviteResult.INVITE_SELF : delegate.invite(owner, player, expiration); }
SelfCheckingPartyRepository implements PartyRepository { @Override public InviteResult invite(String owner, String player, int expiration) { return owner.equalsIgnoreCase(player) ? InviteResult.INVITE_SELF : delegate.invite(owner, player, expiration); } }
SelfCheckingPartyRepository implements PartyRepository { @Override public InviteResult invite(String owner, String player, int expiration) { return owner.equalsIgnoreCase(player) ? InviteResult.INVITE_SELF : delegate.invite(owner, player, expiration); }  }
SelfCheckingPartyRepository implements PartyRepository { @Override public InviteResult invite(String owner, String player, int expiration) { return owner.equalsIgnoreCase(player) ? InviteResult.INVITE_SELF : delegate.invite(owner, player, expiration); }  @Override CreateResult create(String owner); @Override Set<String> getPartyMembers(String owner); @Override DisbandResult disband(String owner); @Override InviteResult invite(String owner, String player, int expiration); @Override AcceptResult accept(String owner, String player); @Override RemoveResult remove(String caller, String playerName); @Override Optional<String> getPartyOwner(String playerName); }
SelfCheckingPartyRepository implements PartyRepository { @Override public InviteResult invite(String owner, String player, int expiration) { return owner.equalsIgnoreCase(player) ? InviteResult.INVITE_SELF : delegate.invite(owner, player, expiration); }  @Override CreateResult create(String owner); @Override Set<String> getPartyMembers(String owner); @Override DisbandResult disband(String owner); @Override InviteResult invite(String owner, String player, int expiration); @Override AcceptResult accept(String owner, String player); @Override RemoveResult remove(String caller, String playerName); @Override Optional<String> getPartyOwner(String playerName);  }