Index: hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java =================================================================== --- hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java (revision 1509790) +++ hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java (working copy) @@ -4373,7 +4373,7 @@ byte[] v1 = Bytes.toBytes("42"); byte[] v2 = Bytes.toBytes("23"); byte [][] QUALIFIERS = new byte [][] { - Bytes.toBytes("a"), Bytes.toBytes("b") + Bytes.toBytes("b"), Bytes.toBytes("a") }; Append a = new Append(ROW); a.add(FAMILY, QUALIFIERS[0], v1); Index: hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java =================================================================== --- hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java (revision 1509790) +++ hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java (working copy) @@ -111,7 +111,14 @@ } // Cast so explicit list type rather than ? extends Cell. Help the compiler out. See // http://stackoverflow.com/questions/6474784/java-using-generics-with-lists-and-interfaces - ((List)list).add(kv); + List l = (List)list; + // find where the new entry should be placed in the List + int idx = 0; + for (KeyValue keyval : l) { + if (Bytes.compareTo(kv.getQualifier(), keyval.getQualifier()) < 0) break; + idx ++; + } + l.add(idx, kv); this.familyMap.put(family, list); return this; }