ValueUtils { public static String formatQuota(Integer currentValue, Integer maxValue) { if (isMeaningless(currentValue, maxValue)) { return null; } return String.format("%s/%s", formatValue(currentValue), formatValue(maxValue)); }  static String getProjectName(Cloud cloud, String region); static String formatQuota(Integer currentValue, Integer maxValue);  }
@Test public void testFormatQuota() { assertThat(formatQuota(null, null), equalTo(null)); assertThat(formatQuota(null, -1), equalTo(null)); assertThat(formatQuota(0, 0), equalTo(null)); assertThat(formatQuota(0, -1), equalTo(null)); assertThat(formatQuota(-1, -1), equalTo(null)); assertThat(formatQuota(-1, 42), equalTo(null)); assertThat(formatQuota(1, null), equalTo("1/?")); assertThat(formatQuota(0, 45), equalTo("0/45")); assertThat(formatQuota(42, 45), equalTo("42/45")); }