Book book = new Book("Harry Potter", "1", "J.K.Rowling"); String bookAsString = objectMapper.writeValueAsString(book);