SpigotMapper extends Mapper<CommandSender, CommandListenerWrapper> { @Override protected Predicate<CommandListenerWrapper> requirement(CommandNode<CommandSender> command) { var requirement = command.getRequirement(); return requirement == null ? (Predicate<CommandListenerWrapper>) TRUE : listener -> requirement.test(listener.getBukkitSender()); } SpigotMapper(CommandDispatcher<CommandSender> dispatcher);   }
@Test void requirement() { assertSame(SpigotMapper.TRUE, mapper.requirement(Literal.of("a").requires(null).build())); Predicate<CommandSender> predicate = mock(Predicate.class); mapper.requirement(Literal.of("a").requires(predicate).build()).test(listener); verify(predicate).test(sender); }