I've been tasked with creating a test to run against our Constants
class to ensure that each value in the class is unique. I'm not talking about the constant names (the IDE will tell the developer if those are dup'd) but rather the values that the constants are being set to.
I'm new to Java and am unsure of how to go about doing this.
To be clear, my Constants
class is defined as follows:
public static final String STATUS_RECEIVED = "RE";
public static final String STATUS_CANCELLED = "CA";
public static final String STATUS_REVIEWED = "RE";
In the above example, I would want my test to note that there is a value being duplicated (since STATUS_RECEIVED == STATUS_REVIEWED). How would I do this programmatically?