Your motivation is to return an object of the same type as the one it was called with.
Unfortunately, Generics cannot help you there. On your line
return (T) -objeto.doubleValue();
you would actually have to say
return new T(-objecto.doubleValue());
but that can't work because T is not known at compile time, and that is when the decision about it must be made.
A way to get a similar result, but with far less elegance, would be to have an interface
public interface AbsEvaluator<N extends Number> {
N abs(N n);
}
and have implementations like
AbsEvaluator<Integer> intAbs =
new AbsEvaluator<Integer>() { public Integer abs(Integer n) { return -n; }};
The implementation would be exactly the same for each type, so the scheme is quite weak.
Good examples which rely on type inference of the kind you are looking for are higher-order functions (of course, Java doesn't have first-class functions, so you have to model them with one-method interfaces). Then you could, for example, have
<T,U,V> Function<T, V> compose(Function<U, V> g, Function<T, U> f);
Not exactly beginner's stuff, especially when implementations are also shown, but maybe it fits into your curriculum. Note that this kind of stuff will become very prominent when Java 8 gets released.