Solutions in Java to diverse coding problems