### Question:
LinearKeyAlgo implements KeyAlgo { @Override public long encode(GHPoint coord) { return encode(coord.lat, coord.lon); } LinearKeyAlgo(int latUnits, int lonUnits); @Override LinearKeyAlgo setBounds(double minLonInit, double maxLonInit, double minLatInit, double maxLatInit); LinearKeyAlgo setBounds(BBox bounds); @Override long encode(GHPoint coord); @Override final long encode(double lat, double lon); @Override final void decode(long linearKey, GHPoint latLon); double getLatDelta(); double getLonDelta();  }### Answer:
@Test public void testEncode() { KeyAlgo algo = new LinearKeyAlgo(3, 4).setBounds(-1, 9, -2, 20); assertEquals(2L, algo.encode(-1, 5)); assertEquals(11L, algo.encode(14, 7)); assertEquals(5L, algo.encode(8, 4)); assertEquals(1L, algo.encode(-4, 3)); assertEquals(3L, algo.encode(2, 22)); assertEquals(0L, algo.encode(-4, -4)); assertEquals(11L, algo.encode(22, 22)); }