| OLD | NEW |
| 1 // Protocol Buffers - Google's data interchange format | 1 // Protocol Buffers - Google's data interchange format |
| 2 // Copyright 2008 Google Inc. All rights reserved. | 2 // Copyright 2008 Google Inc. All rights reserved. |
| 3 // https://developers.google.com/protocol-buffers/ | 3 // https://developers.google.com/protocol-buffers/ |
| 4 // | 4 // |
| 5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
| 6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
| 7 // met: | 7 // met: |
| 8 // | 8 // |
| 9 // * Redistributions of source code must retain the above copyright | 9 // * Redistributions of source code must retain the above copyright |
| 10 // notice, this list of conditions and the following disclaimer. | 10 // notice, this list of conditions and the following disclaimer. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 23 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 25 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 25 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 | 30 |
| 31 package com.google.protobuf; | 31 package com.google.protobuf; |
| 32 | 32 |
| 33 import junit.framework.TestCase; |
| 34 |
| 33 import java.util.ArrayList; | 35 import java.util.ArrayList; |
| 34 import java.util.Arrays; | 36 import java.util.Arrays; |
| 35 import java.util.HashMap; | 37 import java.util.HashMap; |
| 36 import java.util.Iterator; | 38 import java.util.Iterator; |
| 37 import java.util.List; | 39 import java.util.List; |
| 38 import java.util.Map; | 40 import java.util.Map; |
| 39 import java.util.Set; | 41 import java.util.Set; |
| 40 import java.util.TreeSet; | 42 import java.util.TreeSet; |
| 41 import junit.framework.TestCase; | |
| 42 | 43 |
| 43 /** | 44 /** |
| 44 * @author darick@google.com Darick Tong | 45 * @author darick@google.com Darick Tong |
| 45 */ | 46 */ |
| 46 public class SmallSortedMapTest extends TestCase { | 47 public class SmallSortedMapTest extends TestCase { |
| 47 // java.util.AbstractMap.SimpleEntry is private in JDK 1.5. We re-implement it | 48 // java.util.AbstractMap.SimpleEntry is private in JDK 1.5. We re-implement it |
| 48 // here for JDK 1.5 users. | 49 // here for JDK 1.5 users. |
| 49 private static class SimpleEntry<K, V> implements Map.Entry<K, V> { | 50 private static class SimpleEntry<K, V> implements Map.Entry<K, V> { |
| 50 private final K key; | 51 private final K key; |
| 51 private V value; | 52 private V value; |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 fail("Expected UnsupportedOperationException"); | 414 fail("Expected UnsupportedOperationException"); |
| 414 } catch (UnsupportedOperationException expected) { | 415 } catch (UnsupportedOperationException expected) { |
| 415 } | 416 } |
| 416 } | 417 } |
| 417 } | 418 } |
| 418 | 419 |
| 419 private Set<Integer> makeSortedKeySet(Integer... keys) { | 420 private Set<Integer> makeSortedKeySet(Integer... keys) { |
| 420 return new TreeSet<Integer>(Arrays.<Integer>asList(keys)); | 421 return new TreeSet<Integer>(Arrays.<Integer>asList(keys)); |
| 421 } | 422 } |
| 422 } | 423 } |
| OLD | NEW |