LatLonToIsinGridMapper { static int computeB_v( double lat) { int B_v = 0; int v = (int) Math.ceil( R_g * -lat + v_0 ); for( int i = 1; i <= v-1; i++){ double latv = 90 - ((i-1) * 180.0 /2004.0); B_v += computeN_v( latv ); } return B_v; } private  LatLonToIsinGridMapper();   }
@Test public void testComputeB_v() throws Exception { final double cellSizeY = 180.0 / 2004.0; assertEquals(0, LatLonToIsinGridMapper.computeB_v(cellSizeY * 1002)); assertEquals(2, LatLonToIsinGridMapper.computeB_v(cellSizeY * 1001)); assertEquals(10, LatLonToIsinGridMapper.computeB_v(cellSizeY * 1000)); assertEquals(24, LatLonToIsinGridMapper.computeB_v(cellSizeY * 999)); final int equatorB_v = LatLonToIsinGridMapper.computeB_v(cellSizeY * 0); assertEquals(2 * equatorB_v + LatLonToIsinGridMapper.N_eq - 2, LatLonToIsinGridMapper.computeB_v(cellSizeY * -1002)); }