### Question:
JPQLSerializer extends SerializerBase<JPQLSerializer> { @SuppressWarnings("unchecked") private List<? extends Expression<?>> normalizeNumericArgs(List<? extends Expression<?>> args) { @SuppressWarnings("unchecked") List<? extends Expression<? extends Number>> potentialArgs = (List<? extends Expression<? extends Number>>) args; boolean hasConstants = false; Class<? extends Number> numType = null; for (Expression<? extends Number> arg : potentialArgs) { if (Number.class.isAssignableFrom(arg.getType())) { if (arg instanceof Constant<?>) { hasConstants = true; } else { numType = arg.getType(); } } } if (hasConstants && numType != null) { final List<Expression<?>> newArgs = new ArrayList<Expression<?>>(args.size()); for (final Expression<? extends Number> arg : potentialArgs) { if (arg instanceof Constant<?> && Number.class.isAssignableFrom(arg.getType()) && !arg.getType().equals(numType)) { final Number number = ((Constant<? extends Number>) arg).getConstant(); newArgs.add(ConstantImpl.create(MathUtils.cast(number, numType))); } else { newArgs.add(arg); } } return newArgs; } else { return potentialArgs; } } 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 normalizeNumericArgs() { JPQLSerializer serializer = new JPQLSerializer(HQLTemplates.DEFAULT); NumberPath<Double> doublePath = Expressions.numberPath(Double.class, "doublePath"); serializer.handle(doublePath.add(1)); serializer.handle(doublePath.between((float) 1.0, 1L)); serializer.handle(doublePath.lt((byte) 1)); for (Object constant : serializer.getConstantToAllLabels().keySet()) { assertEquals(Double.class, constant.getClass()); } }