It's a precondition check to ensure that argument "n" is always in the range -2047 to 2047.
An example of design by contract, where each method ensures that the arguments it receives from calling methods are valid.
Configuration.DEBUG is just an application defined variable which is likely set to true only during development phases, to uncover any buggy caller who passes in |n|>=2048.
When those bugs are found and corrected, the flag is set to false and pushed into production.
It's a good programming practice, and in my opinion,
you should retain it even in the C++ version. These are called "assertions" btw - search for that term if you're not familiar with them.
One common technique to implement assertions in C++ would be something like
NDEBUG macro is doing the same thing as java's Configuration.DEBUG. If it's
not defined, the assert condition is evaluated. If it's defined, the condition is not evaluated.
One thing you need to check is whether Configuration.DEBUG value is hardcoded somewhere in code at compile time, or read at runtime from some properties file or other configuration file.
If it's set at runtime, then I suppose the C++ version too should be designed to read the flag at runtime and use it, instead of relying on NDEBUG.