### Question:
RankBasedPermissions extends KitPermissions { @Override public boolean isAvailableTo(KitChallenger challenger) { return challenger.hasPermission(this.permission); }  @Override boolean isAvailableTo(KitChallenger challenger); @Override Message unavailabilityMessage(KitChallenger challenger);  }### Answer:
@Test public void whenHasRankThenAllowed() { Rank needed = mock(Rank.class); KitPermissions kitPermissions = new RankBasedPermissions( "permission", needed ); KitChallenger kitChallenger = mock(KitChallenger.class); when(kitChallenger.hasPermission(eq("permission"))) .thenReturn(true); assertTrue( kitPermissions.isAvailableTo(kitChallenger)); }