Help with GenericArguments.choices

Could someone please demonstrate how to properly use the choices argument type for a command? I can get other commands to work but after a few tries with it I’m not having any success, no crashes or errors just no command ever gets registered. Thanks in advance.

    Map arg1 = new HashMap<String, String> (){{put("get","get");put("clearcache","clearcache");}};
	CommandSpec command = CommandSpec.builder()
			.executor(new CommandExec(instance))
			.arguments(GenericArguments.choices(Texts.of("Option"), arg1))
			.arguments(GenericArguments.remainingJoinedStrings(Texts.of("remainingArgs")))
			.build();
	game.getCommandManager().register(this, command, "testCommand");

You are using the builder incorrectly.

Calling .arguments after .arguments will just overwrite it with the last used arguments.

What you really want is

Map arg1 = new HashMap<String, String> (){{put("get","get");put("clearcache","clearcache");}};
CommandSpec command = CommandSpec.builder()
  .executor(new CommandExec(instance))
  .arguments(
    GenericArguments.choices(Texts.of("Option"), arg1) ,
    GenericArguments.remainingJoinedStrings(Texts.of("remainingArgs"))
  )
  .build();
game.getCommandManager().register(this, command, "testCommand");