ScaleContig { public int scale(long position) { if (!positionMap.containsKey(position)) { throw new IllegalArgumentException("Invalid position"); } return positionMap.get(position); } @VisibleForTesting  ScaleContig(@NotNull final String contig, Map<Long, Integer> positionMap);   ScaleContig(@NotNull final String contig, @NotNull final List<Long> positions); boolean isEmpty(); String contig(); int length(); void expand(double factor); int scale(long position); int interpolate(long value);  }
@Test public void testFirstPositionIsAtStart() { ScaleContig victim = new ScaleContig("1", Lists.newArrayList(200L, 10L)); assertEquals(1, victim.scale(10L)); }
@Test public void testScalePosition() { long firstPosition = new Random().nextInt(1000000) + 1; ScaleContig victim = new ScaleContig("1", Lists.newArrayList(firstPosition + 1001, firstPosition, firstPosition + 1, firstPosition)); assertEquals(1, victim.scale(firstPosition)); assertEquals(1 + SCALE_1, victim.scale(firstPosition + 1)); assertEquals(1 + SCALE_1 + SCALE_1000, victim.scale(firstPosition + 1001)); }