Write a Java program to remove duplicate values from an array and sort the resulting elements without using built-in collection sorting methods.