### Question:
Position implements Comparable<Position> { public static Position of(String contig, int pos, ImmutableMap<String, Integer> contigs) { return new AutoValue_Position(contig, pos, contigs); }  static Position of(String contig, int pos, ImmutableMap<String, Integer> contigs); static ImmutableList<Position> fromFile(Path file); static ImmutableList<Position> fromFile(Path file, ImmutableMap<String, Integer> contigs); static ImmutableMap<String, Integer> contigsFromFile(Path file); abstract String contig(); abstract int pos(); abstract ImmutableMap<String, Integer> contigs(); @Override boolean equals(Object obj); @Override int hashCode(); @SuppressWarnings("ReferenceEquality") // explained below @Override int compareTo(Position rhs); boolean before(Position rhs); @Override String toString();  }### Answer:
@Test public void ordersCorrectly() throws IOException, ParseException { ImmutableMap<String, Integer> contigs = ImmutableMap.of("chr1", 0, "chr10", 1, "chr11", 2); assertThat(Position.of("chr10", 10, contigs)).isLessThan(Position.of("chr10", 20, contigs)); assertThat(Position.of("chr1", 20, contigs)).isLessThan(Position.of("chr10", 10, contigs)); assertThat(Position.of("chr10", 10, contigs)).isLessThan(Position.of("chr11", 5, contigs)); }
@Test public void noNulls() throws IOException, ParseException { ImmutableMap<String, Integer> contigs = ImmutableMap.of("chr1", 0, "chr10", 1, "chr11", 2); assertThrows(NullPointerException.class, () -> Position.of(null, 0, contigs)); assertThrows(NullPointerException.class, () -> Position.of("chr1", 0, null)); }