public Command mapArguments(Object[] args) { checkNotNull(args, "args must not be null"); checkArgument(args.length == tupleKeys.length + 2, "Expected %s args, received %s", tupleKeys.length +2, args.length); checkArgument(args[0] instanceof StreamTimestamp, "first argument %s is not a StreamTimestamp", args[0]); checkArgument(args[1] instanceof String, "second argument %s is not a String", args[0]); return Command.of( AggregateId.of(aggregateType, (String) args[1]), (StreamTimestamp) args[0], commandName, makeTupleFromArgs(args), resultType ); }