(Object o)
| 142 | } |
| 143 | |
| 144 | static protected String toString(Object o) { |
| 145 | |
| 146 | |
| 147 | if (o == null) return "null"; |
| 148 | if (o instanceof Throwable) { |
| 149 | StringWriter ps = new StringWriter(); |
| 150 | ((Throwable) o).printStackTrace(new PrintWriter(ps)); |
| 151 | return ps.toString(); |
| 152 | } |
| 153 | if (o instanceof Collection) return "" + ((Collection)o).stream().map( x -> toString(x)).collect(Collectors.toList()); |
| 154 | if (o.getClass().isArray()) return "" + Arrays.asList((Object[]) o).stream().map( x -> toString(x)).collect(Collectors.toList()); |
| 155 | return ("" + o).trim(); |
| 156 | } |
| 157 | |
| 158 | } |
no test coverage detected