Source:
<code>private ListenableFuture<BoundStatement> saveQueryAsync(T entity, final EnumMap<Option.Type, Option> options) { <START> final Map<AliasedMappedProperty, Object> columnToValue = new TreeMap<AliasedMappedProperty, Object>(new AliasedMappedPropertyComparator()); <END> final boolean useUnsetForNullValue = !shouldSaveNullFields(options) && manager.protocolVersionAsInt >= 4; final boolean includeColumnsWithNullValue = shouldSaveNullFields(options) || useUnsetForNullValue; for (AliasedMappedProperty col : mapper.allColumns) { Object value = col.mappedProperty.getValue(entity); if (!col.mappedProperty.isComputed() && (includeColumnsWithNullValue || value != null)) { columnToValue.put(col, value); } } return Futures.transform(getPreparedQueryAsync(QueryType.SAVE, columnToValue.keySet(), options), new Function<PreparedStatement, BoundStatement>() { @Override public BoundStatement apply(PreparedStatement input) { BoundStatement bs = input.bind(); int i = 0; for (Map.Entry<AliasedMappedProperty, Object> entry : columnToValue.entrySet()) { AliasedMappedProperty mapper = entry.getKey(); Object value = entry.getValue(); setObject(bs, i++, value, mapper, useUnsetForNullValue); } if (mapper.writeConsistency != null) bs.setConsistencyLevel(mapper.writeConsistency); for (Option option : options.values()) { option.validate(QueryType.SAVE, manager); i = option.apply(bs, i); } return bs; } }); }</code><technical_language>Small nit, instead of creating a new comparator time, 1 static comparator, i.e.: java private static final Comparator<AliasedMappedProperty> PROPERTY_COMPARATOR = new Comparator<AliasedMappedProperty>() { @Override public int compare(AliasedMappedProperty o1, AliasedMappedProperty o2) { String col1Name = o1.mappedProperty.getMappedName(); String col2Name = o2.mappedProperty.getMappedName(); return col1Name.compareTo(col2Name); } };</technical_language>

Target:
private ListenableFuture<BoundStatement> saveQueryAsync(T entity, final EnumMap<Option.Type, Option> options) { final Map<AliasedMappedProperty, Object> columnToValue = new TreeMap<AliasedMappedProperty, Object>(); final boolean useUnsetForNullValue = !shouldSaveNullFields(options) && manager.protocolVersionAsInt >= 4; final boolean includeColumnsWithNullValue = shouldSaveNullFields(options) || useUnsetForNullValue; for (AliasedMappedProperty col : mapper.allColumns) { Object value = col.mappedProperty.getValue(entity); if (!col.mappedProperty.isComputed() && (includeColumnsWithNullValue || value != null)) { columnToValue.put(col, value); } } return Futures.transform(getPreparedQueryAsync(QueryType.SAVE, columnToValue.keySet(), options), new Function<PreparedStatement, BoundStatement>() { @Override public BoundStatement apply(PreparedStatement input) { BoundStatement bs = input.bind(); int i = 0; for (Map.Entry<AliasedMappedProperty, Object> entry : columnToValue.entrySet()) { AliasedMappedProperty mapper = entry.getKey(); Object value = entry.getValue(); setObject(bs, i++, value, mapper, useUnsetForNullValue); } if (mapper.writeConsistency != null) bs.setConsistencyLevel(mapper.writeConsistency); for (Option option : options.values()) { option.validate(QueryType.SAVE, manager); i = option.apply(bs, i); } return bs; } }); }