BasicAuthenticationCredentials { @Nonnull public static String encodeBase64(@Nonnull final String source) { assert source != null; final String expected = DatatypeConverter.printBase64Binary(source.getBytes()); return "Basic " + expected; } private  BasicAuthenticationCredentials(); @Nonnull static String encodeBase64(@Nonnull final String source); @Nonnull static String encodeBase64WithNone(@Nonnull final String source);  }
@Test public void testToBase64() { LOG.info("testToBase64"); final String deviceId = "O12022A00028:none"; final String expected = "Basic TzEyMDIyQTAwMDI4Om5vbmU="; Assert.assertEquals(expected, BasicAuthenticationCredentials.encodeBase64(deviceId)); }