final String[] TOPIC_REFS = {"GEMEINDE", "LAND", "KREIS"};
final String[] TOPIC_REFS = {"GEMEINDE", "BUNDESLAND", "KREIS"};
    public static String transformSpacialReference(String topicId) {        final String[] TOPIC_REFS = {"GEMEINDE", "LAND", "KREIS"};                String kgsCode = topicId;                  for (int i=0; i< TOPIC_REFS.length; i++) {            if (topicId.startsWith(TOPIC_REFS[i])) {                kgsCode = topicId.substring(TOPIC_REFS[i].length());                if (kgsCode.length() == 10) {                    kgsCode = topicId.substring(TOPIC_REFS[i].length(), TOPIC_REFS[i].length() + 6);                    kgsCode = kgsCode.concat(topicId.substring(TOPIC_REFS[i].length()+8));                } else if (kgsCode.length() < 8) {                    kgsCode = StringUtils.rightPad(kgsCode, 8, "0");                }                break;            }        }                return kgsCode;    }