An implementation of finding the product of four (*) adjacent or diagonal numbers from a string of lines of numbers (table), by demo/test. Java 15 with src (console app + business logic) and unit tests with JUnit (v4.10). Also supports sparse input (converted to sparse matrix with zeros for missing values).
* : Four by default, but you can specify any sequence length when calling the constructor