@ParameterizedTest @ArgumentsSource(TestCaseArgumentsProvider.class) @TestCase({"null", ""}) @TestCase({"", ""}) @TestCase({"-128", "200"}) @TestCase({"-1", "377"}) @TestCase({"0", "000"}) @TestCase({"15", "017"}) @TestCase({"127", "177"}) @TestCase({"0, 127, 10", "000177012"}) void octal(byte[] input, String expectedResult) { assertThat(StringUtil.octal(input), is(expectedResult)); }
public static String octal(byte... bytes) { if (bytes == null) { return ""; } StringBuilder builder = new StringBuilder(bytes.length * 3); for (byte b : bytes) { builder.append(String.format("%03o", b)); } return builder.toString(); }
StringUtil extends UtilityClass { public static String octal(byte... bytes) { if (bytes == null) { return ""; } StringBuilder builder = new StringBuilder(bytes.length * 3); for (byte b : bytes) { builder.append(String.format("%03o", b)); } return builder.toString(); } }
StringUtil extends UtilityClass { public static String octal(byte... bytes) { if (bytes == null) { return ""; } StringBuilder builder = new StringBuilder(bytes.length * 3); for (byte b : bytes) { builder.append(String.format("%03o", b)); } return builder.toString(); }  }
StringUtil extends UtilityClass { public static String octal(byte... bytes) { if (bytes == null) { return ""; } StringBuilder builder = new StringBuilder(bytes.length * 3); for (byte b : bytes) { builder.append(String.format("%03o", b)); } return builder.toString(); }  static String lowercaseFirst(String s); static String uppercaseFirst(String s); static String camelToUpper(String camelName); static String hex(byte... bytes); static String octal(byte... bytes); static Function<T,String> prepend(String arg); static Function<T,String> append(String arg); }
StringUtil extends UtilityClass { public static String octal(byte... bytes) { if (bytes == null) { return ""; } StringBuilder builder = new StringBuilder(bytes.length * 3); for (byte b : bytes) { builder.append(String.format("%03o", b)); } return builder.toString(); }  static String lowercaseFirst(String s); static String uppercaseFirst(String s); static String camelToUpper(String camelName); static String hex(byte... bytes); static String octal(byte... bytes); static Function<T,String> prepend(String arg); static Function<T,String> append(String arg);  }