CassandraTimestampUtils { public static Map<String, byte[]> getValuesFromSelectionResult(CqlResult result) { return result.getRows().stream() .map(CqlRow::getColumns) .collect(Collectors.toMap( cols -> PtBytes.toString(getNamedColumnValue(cols, COLUMN_NAME_COLUMN)), cols -> getNamedColumnValue(cols, VALUE_COLUMN))); } private  CassandraTimestampUtils(); static CqlQuery constructCheckAndSetMultipleQuery(Map<String, Pair<byte[], byte[]>> checkAndSetRequest); static boolean isValidTimestampData(byte[] data); static CqlQuery constructSelectFromTimestampTableQuery(); static Map<String, byte[]> getValuesFromSelectionResult(CqlResult result); static void verifyCompatible(CqlResult casResult, Map<String, Pair<byte[], byte[]>> casMap); static final String ROW_AND_COLUMN_NAME; static final String BACKUP_COLUMN_NAME; static final ByteString INVALIDATED_VALUE; static final long INITIAL_VALUE; }
@Test public void canGetValuesFromSelectionResult() { List<Column> columnList1 = buildKeyValueColumnList(KEY_1, COLUMN_BYTES_1, VALUE_1); List<Column> columnList2 = buildKeyValueColumnList(KEY_2, COLUMN_BYTES_2, VALUE_2); CqlResult mockResult = createMockCqlResult( ImmutableList.of( createMockCqlRow(columnList1), createMockCqlRow(columnList2))); assertThat(CassandraTimestampUtils.getValuesFromSelectionResult(mockResult)) .isEqualTo(ImmutableMap.of(COLUMN_NAME_1, VALUE_1, COLUMN_NAME_2, VALUE_2)); }