@SuppressWarnings("PMD.UseVarargs")
    public static byte[] toBytes(final char[] chars) {

        // make sure we can handle null inputs
        if (chars == null) {
            return toBytes(new char[0], Charset.defaultCharset().name());
        } else {
            return toBytes(chars, Charset.defaultCharset().name());
        }
    }
@ SuppressWarnings ( "PMD.UseVarargs" ) public static byte [ ] toBytes ( final char [ ] chars ) { if ( chars == null ) { return toBytes ( new char [ 0 ] , Charset . defaultCharset ( ) . name ( ) ) ; } else { return toBytes ( chars , Charset . defaultCharset ( ) . name ( ) ) ; } }
Cannot use varargs here, this would be against the point!