RedisUtils { public static String createKeyWithNameSpace(String key, String nameSpace) { if (key == null || key.isEmpty()) { throw new IrregularKeyValue("Key in KeyvalueStructure cannont be empty"); } return nameSpace + ":" + key; }  static String createKeyWithNameSpace(String key, String nameSpace);  }
@Test public void shouldReturnNameSpace() { assertEquals("namespace:key", RedisUtils.createKeyWithNameSpace("key", "namespace")); }
@Test public void shouldThrowWithNullKey() { assertThrows(IrregularKeyValue.class, () -> RedisUtils.createKeyWithNameSpace(null, "")); }