private void processDomainCommand(String command, int expectation) throws ConnectionException, ConfigurationException { byte[] toSend = command.getBytes(); X_OCTET buffer = (X_OCTET) connection.tpalloc("X_OCTET", null); buffer.setByteArray(toSend); Response response = connection.tpcall("BTDomainAdmin", buffer, 0); byte[] responseData = ((X_OCTET) response.getBuffer()).getByteArray(); assertEquals(expectation, responseData[0]); }