class DashboardSerializer {

    public void write(Dashboard dashboard, Writer writer) throws IOException {
        try {
            mapper.writeValue(writer, dashboard);
        } catch (JsonProcessingException e) {
            throw new IllegalArgumentException("dashboard cannot be serialized to JSON." +
                    "It might contain non-serializable values.", e);
        }
    }

}

class DashboardSerializerTest {

    private DashboardSerializer serializer;

    @Test
    @Ignore
    public void printTestDashboard() throws IOException {

        //System.out.println(serializer.toString(testDashboard()));
        serializer.write(testDashboard(), System.out);
    }

}