### Question:
JPQLSerializer extends SerializerBase<JPQLSerializer> { public void visitLiteral(Object constant) { append(templates.asLiteral(constant)); } JPQLSerializer(JPQLTemplates templates);  JPQLSerializer(JPQLTemplates templates, EntityManager em); void serialize(QueryMetadata metadata, boolean forCountRow, @Nullable String projection); void serializeForDelete(QueryMetadata md); void serializeForInsert(QueryMetadata md, List<Path<?>> columns, List<Object> values, SubQueryExpression<?> query, Map<Path<?>, Expression<?>> inserts); void serializeForUpdate(QueryMetadata md, Map<Path<?>, Expression<?>> updates); @Override void visitConstant(Object constant); void visitLiteral(Object constant); @Override Void visit(ParamExpression<?> param, Void context); @Override Void visit(SubQueryExpression<?> query, Void context); @Override Void visit(Path<?> expr, Void context);  }### Answer:
@Test public void visitLiteral_boolean() { JPQLSerializer serializer = new JPQLSerializer(HQLTemplates.DEFAULT); serializer.visitLiteral(Boolean.TRUE); assertEquals("true", serializer.toString()); }
@Test public void visitLiteral_number() { JPQLSerializer serializer = new JPQLSerializer(HQLTemplates.DEFAULT); serializer.visitLiteral(1.543); assertEquals("1.543", serializer.toString()); }
@Test public void visitLiteral_string() { JPQLSerializer serializer = new JPQLSerializer(HQLTemplates.DEFAULT); serializer.visitLiteral("abc''def"); assertEquals("'abc''''def'", serializer.toString()); }
@Test public void visitLiteral_enum() { JPQLSerializer serializer = new JPQLSerializer(HQLTemplates.DEFAULT); serializer.visitLiteral(JobFunction.MANAGER); assertEquals("com.querydsl.jpa.domain.JobFunction.MANAGER", serializer.toString()); }