### Question:
CoordinateReferenceSystem implements CRS { public static CoordinateReferenceSystem get( int tableId, int code ) { CRSTable table = CRSTable.find( tableId ); for ( CoordinateReferenceSystem type : TYPES ) { if ( type.table == table && type.code == code ) { return type; } } throw new InvalidValuesArgumentException( "Unknown coordinate reference system: " + tableId + "-" + code ); } private  CoordinateReferenceSystem( String name, CRSTable table, int code, int dimension, boolean geographic ); static Iterable<CoordinateReferenceSystem> all(); static CoordinateReferenceSystem get( int tableId, int code ); static CoordinateReferenceSystem get( CRS crs ); static CoordinateReferenceSystem byName( String name ); static CoordinateReferenceSystem get( String href ); static CoordinateReferenceSystem get( int code ); @Override String toString(); @Override int getCode(); @Override String getType(); @Override String getHref(); String getName(); CRSTable getTable(); int getDimension(); boolean isGeographic(); CRSCalculator getCalculator(); @Override boolean equals( Object o ); @Override int hashCode(); static final CoordinateReferenceSystem Cartesian; static final CoordinateReferenceSystem Cartesian_3D; static final CoordinateReferenceSystem WGS84; static final CoordinateReferenceSystem WGS84_3D; }### Answer:
@Test void shouldFailToGetWithIncorrectCode() { InvalidValuesArgumentException exception = assertThrows( InvalidValuesArgumentException.class, () -> CoordinateReferenceSystem.get( 42 ) ); assertEquals( "Unknown coordinate reference system code: 42", exception.getMessage() ); }
@Test void shouldFindByTableAndCode() { assertThat( CoordinateReferenceSystem.get( 1, 4326 ), equalTo( CoordinateReferenceSystem.WGS84 ) ); assertThat( CoordinateReferenceSystem.get( 1, 4979 ), equalTo( CoordinateReferenceSystem.WGS84_3D ) ); assertThat( CoordinateReferenceSystem.get( 2, 7203 ), equalTo( CoordinateReferenceSystem.Cartesian ) ); assertThat( CoordinateReferenceSystem.get( 2, 9157 ), equalTo( CoordinateReferenceSystem.Cartesian_3D ) ); }