Title: Java : Logic to Get the Logic