{ public static void main(String[] args) { checkState(args.length > 0, "Too less parameters”); checkNotNull(args, "You have to pass some parameters"); } }
Table of names Table<Character, Integer, String> table = HashBasedTable.create(); // First letter is a row key, length is a column key for (String name : names) { table.put(name.charAt(0), name.length(), name); } // Value corresponding to the given row and column keys table.get('A', 5); // -> Alice table.get('B', 3); // -> Ben // Set of column keys that have one or more values in the table table.columnKeySet(); // -> [4, 5, 3] // View of all mappings that have the given row key table.row('A'); // -> {4=Andy, 5=Alice}
new State("WY", false), new State("SD", false), new State("NE", false), new State("WI", false), new State("IN", false), new State("TX", false), new State("CA", true), new State("AZ", true), new State("NM", true), new State("AR", true), new State("IL", true), new State("IA", true)); Predicate<State> withI = state -> state.getAbbreviation().startsWith("I"); Predicate<State> isExpanded = state -> state.isExpanded(); Collection<State> filtered = filter(states, or(withI, not(isExpanded)));