(Object obj)
| 280 | } |
| 281 | |
| 282 | private static int roundtrip(Object obj) |
| 283 | throws IOException, ClassNotFoundException { |
| 284 | |
| 285 | ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
| 286 | ObjectOutputStream oos = new ObjectOutputStream(baos); |
| 287 | oos.writeObject(obj); |
| 288 | byte[] data = baos.toByteArray(); |
| 289 | oos.close(); |
| 290 | ByteArrayInputStream bais = new ByteArrayInputStream(data); |
| 291 | ObjectInputStream ois = new ObjectInputStream(bais); |
| 292 | assertThat(ois.readObject() == obj, is(true)); // identity check |
| 293 | ois.close(); |
| 294 | return data.length; |
| 295 | } |
| 296 | |
| 297 | private static PlainDate convert(String date) { |
| 298 | String[] components = date.split("-"); |
no test coverage detected