Java Reflection Attributes Hackerrank Solution