### Question:
LinearKeyAlgo implements KeyAlgo { @Override public final void decode(long linearKey, GHPoint latLon) { double lat = linearKey / lonUnits * latDelta + bounds.minLat; double lon = linearKey % lonUnits * lonDelta + bounds.minLon; latLon.lat = lat + latDelta / 2; latLon.lon = lon + lonDelta / 2; } 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 testDecode() { KeyAlgo algo = new LinearKeyAlgo(3, 4).setBounds(-1, 9, -2, 20); GHPoint latLon = new GHPoint(); algo.decode(5, latLon); assertEquals(9, latLon.lat, 1e-7); assertEquals(2.75, latLon.lon, 1e-7); algo.decode(2, latLon); assertEquals(1.66666666, latLon.lat, 1e-7); assertEquals(5.25, latLon.lon, 1e-7); algo.decode(11, latLon); assertEquals(16.3333333, latLon.lat, 1e-7); assertEquals(7.75, latLon.lon, 1e-7); algo.decode(10, latLon); assertEquals(16.3333333, latLon.lat, 1e-7); assertEquals(5.25, latLon.lon, 1e-7); }